shinken-solutions / shinken

Flexible and scalable monitoring framework
http://www.shinken-monitoring.org
GNU Affero General Public License v3.0
1.14k stars 335 forks source link

Ubuntu 20.04 - Install Shinken pip install #2013

Open gamersalpha opened 3 years ago

gamersalpha commented 3 years ago

Hello there,

I want install Shinken on my ubuntu 20.04

i look the doc : https://shinken.readthedocs.io/en/latest/02_gettingstarted/installations/shinken-installation.html#requirements

First attempt : the pip install :

root@dragon:/home/stagiaire# pip install shinken
Collecting shinken
  Using cached Shinken-2.4.3.tar.gz (27.9 MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f92l_b99/shinken/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f92l_b99/shinken/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-f92l_b99/shinken/pip-egg-info
         cwd: /tmp/pip-install-f92l_b99/shinken/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-f92l_b99/shinken/setup.py", line 124
        except KeyError, exp:
                       ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

the install via apt-get :

root@dragon:/home/stagiaire# sudo apt-get update -y
Hit:1 http://fr.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://fr.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://fr.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://fr.archive.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
root@dragon:/home/stagiaire# sudo apt-get install -y shinken
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package shinken

can u have some help to install shinken on ubuntu 20.04

thanks

geektophe commented 3 years ago

I think this is simply because Shinken has not been ported to Python 3 for the moment, and it has been the default on Focal.

Is there a pip2 command ?

chakl commented 3 years ago

We ran into the same issue and found a workaround (I would not call it a solution)

TL;DR: install pycurl-7.43.0.3 (exactly that version)

We had Shinken installed on Ubuntu 18 LTS using the pip install method. It was running but not put into production yet. Last week the Ops team upgraded that server to Ubuntu 20.04. That broke the Shinken installation, it would fail to start with an error CURL_OPENSSL_3 not found.

Pycurl was also installed from pip as documented in the installation instructions. At installation time, pycurl seems to have been linked to the libcurl3 library. libcurl3 seems to have been replaced by libcurl4 in 20.04, and there is no libcurl3 package anymore. Which explains the error quite nicely.

We then tried to pip install pycurl --upgrade and noticed it would upgrade pycurl in /usr/local/python3.8/dist-packages - the python3 environment. This does not help Shinken which is using python2.7. The pip command in 20.04 uses python3.

So try to run pip2 instead, but this has been removed from 20.04 as well. We tried a get-pip2.py script referenced in the Webs, which got us a locally installed pip2, but that gave other errors and we did not follow this further.

We then tried to install the latest pycurl (7.43.0.6) manually by downloading the source and executing python2 ./setup.py install. Worked without errors, start Shinken, get a different error. Progress!

That error was about PyUnicode_DecodeLocale. Some web search revealed this is python3 only, and the last version of pycurl that supports python2 is 7.43.0.3.

Repeat the manual installation step with pycurl-7.43.0.3. There, it works! :)

The main issue here is that Shinken seems to require Python 2.x and does not work with Python 3.x (?). Ubuntu 20.04 has deprecated Python2 already, other distributions might follow.

Any plans/status on a Python3 version of Shinken?

[debugging credits: @agh2342]

FrancoisT44 commented 2 years ago

Bonsoir j'étais aussi avec un besoin de shinken mais lors de l'installation j'ai été confronté au même problèmes cités au-dessus. Du coup il n'existe pas d'alternative si je comprends bien? françois

starouille commented 2 years ago

upgraded ubuntu 18.04->20.04 with shinken.

My notes: apt-add-repository universe apt install python2-minimal curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py python2 get-pip.py

(don't forget adding /usr/local/bin to your path)

(yes it's bionic repos but i don't care) deb http://fr.archive.ubuntu.com/ubuntu/ bionic main restricted deb http://fr.archive.ubuntu.com/ubuntu/ bionic universe deb http://fr.archive.ubuntu.com/ubuntu/ bionic multiverse apt update apt install libssl1.0.0

apt install libcurl3 -y

starting shinken.... it's works <3 :)