Centreon-Community / centreon-discovery

An extension to discover resources to monitor with Centreon
GNU General Public License v2.0
7 stars 19 forks source link

CES 3.3 : Module MySQLdb FAIL, Modules Python weren't installed with success FAIL #3

Open LFrederic opened 8 years ago

LFrederic commented 8 years ago

Hi everyone,

I'm trying to install centreon-discovery on CES 3.3. Mariadb-devel is installed. I followed this issue to resolve "MariaDB-devel FAIL" --> https://github.com/Centreon-Community/centreon-discovery/issues/2

But now i got the following error :

`[root@vpc-gda-centreon centreon-discovery-master]# ./install.sh -i -t both Waiting ...

http://community.centreon.com/projects/centreon-discovery

Thanks for using Centreon

v2.3.1

OS found: CENTOS OK


    Checking all needed binaries

rm OK cp OK mv OK /bin/chmod OK /bin/chown OK echo OK more OK mkdir OK find OK /bin/grep OK /bin/cat OK /bin/sed OK /usr/bin/python OK /usr/bin/gcc OK /usr/bin/nmap OK /usr/bin/yum OK


    Checking all needed packages

python-devel OK

MariaDB-devel OK


    Accepting licence

You will now read Centreon Discovery module Licence. Press enter to continue.

Do you accept GPL license ? [y/n], default to [n]:

y


    Checking version number

python 2.6 (min. 2.4) OK nmap 5.51 (min. 5.0) OK


    Install Python modules

Module PyCrypto ... OK Module NMAP ... OK Module SetupTools ... OK Module MySQLdb ... FAIL Modules Python weren't installed with success FAIL INSTALL ABORT `

I found with "echo" flags that the script is trying to "install modPython;" on line 321. That's why i have a FAIL.

Do you have some advices to help me ?

Thank you.

Frédéric LAINÉ

lolo54000 commented 8 years ago

Hi I have exactly the same problem with CES 3.3 someone know how to resolve this issue?

Thank You

Loic

fab-dub commented 8 years ago

Hi,

I have the same issue with v 2.3.1 on CES 3.3, has anyone managed to resolve it ?

install.log finish with :

error: command 'gcc' failed with exit status 1
Module MySQLdb : FAIL
Modules Python weren't installed with success : FAIL

Full install.log attached install.log.txt

Thank you for any help.

Fab

fab-dub commented 8 years ago

Hi,

I finally managed to install this version on CES 3.3 by updating git and then git cloning centreon-discovery rather than downloading it :/

lolo54000 commented 8 years ago

Hi Can you explain what you do exactly? on my Ces3.3 I have git 1.7.1 If I clone Git I have a local copie ok . When I launch install.sh it's fail on Python Modules Mysqldb

fab-dub commented 8 years ago

@lolo54000 Everything I did is here, I think I forget nothing :

Add MariaDB repository and update

echo "# MariaDB 5.5 CentOS repository list - created 2016-09-01 11:56 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" > /etc/yum.repos.d/MariaDB.repo

yum update

Install requirements

yum groupinstall "Development tools" yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel python-devel MariaDB-devel rpm -vhU http://nmap.org/dist/nmap-7.12-1.x86_64.rpm

wget http://github.com/git/git/archive/v2.9.3.tar.gz
tar -xzf v2.9.3.tar.gz
cd git-2.9.3
make prefix=/usr/local all
make prefix=/usr/local install

Clone Centreon-Discovery

git clone http://github.com/Centreon-Community/centreon-discovery.git

Prepare before install

cd centreon-discovery
nano install.sh

replace line 210 PACKAGES="python-devel mysql-devel" by PACKAGES="python-devel MariaDB-devel"

chmod 755 install.sh

Install

./install.sh -i -t central

Then you should be able to install the module in Centreon Web administration.

... but it looks like discovering does not work anyway, still something missing :/

fab-dub commented 8 years ago

Got it !

First don't install last version of nmap, it won't work with it, if you did, do this :

rpm -e nmap
rpm -vhU https://nmap.org/dist/nmap-5.51-1.x86_64.rpm

Next, if you only have a central, you must install the module in "both" mode : ./install.sh -i -t both

Last, there is an error in the file /usr/share/centreon-discovery/DiscoveryAgent_central.py somewhere in here line 69:

if ligne.lstrip().startswith("$conf_centreon['password']"):
         conf_password = ligne.replace("$conf_centreon['password'] = \"","").replace("\";","").rstrip()

so it does not find the database password. As I am really new to all this, I don't know how to fix this in a clean way, my temporary fix is on line 74 : db=MySQLdb.connect(host=conf_host,user=conf_user,passwd='actual_db_passwd_here',db=conf_db)

I guess someone can provide a cleaner fix :)

fab-dub commented 8 years ago

best fix I can find : nano /etc/centreon/centreon.conf.php

replace line 22 $conf_centreon['password'] = 'your_db_password'; by $conf_centreon['password'] = "your_db_password";