![Stacks Image 2228](files/stacks-image-3891971-294x186.png)
- Une nouvelle gestion des traps SNMP
- Un nouveau système de notification interne
- De gros changements dans les ACL
- Une gestion de l'ordre des templates d'hôtes.
L'installation, avec les sources, est assez délicate si vous n'êtes pas habitué au procédure de compilation. Privilégiez l'installation avec CES dans ce cas.
1 Préparation de la VM
![Stacks Image 2943](files/stacks-image-2782cd4-40x38.png)
Attention l'interface Web de Centreon n'est pas compatible avec le PHP > 5.3. Veuillez lire cet article.
1.1 Mise à jour et ssh
apt-get install ssh
apt-get update
apt-get upgrade
1.2 Configuration APT
deb http://ftp.fr.debian.org/debian/ wheezy main non-free
deb-src http://ftp.fr.debian.org/debian/ wheezy main non-free
deb http://security.debian.org/ wheezy/updates main non-free
deb-src http://security.debian.org/ wheezy/updates main non-free
deb http://ftp.fr.debian.org/debian/ squeeze main non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze main non-free
deb http://security.debian.org/ squeeze/updates main non-free
deb-src http://security.debian.org/ squeeze/updates main non-free
Package: php5*
Pin: release a=oldstable
Pin-Priority: 700
Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700
Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700
Package: *
Pin: release a=stable
Pin-Priority: 600
apt-get update
2 Installation de Centreon Clib
![Stacks Image 3086](files/stacks-image-756f486-294x186.png)
Cela va être l'occasion de se confronter aux problèmes des librairies partagées sous Linux. Nous utiliserons la commande ldconfig pour initialiser la librairie partagée.
2.1 Pré requis
apt-get install build-essential cmake -y
2.2 Installation
cd /usr/local/src
wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-clib/centreon-clib-1.4.2.tar.gz
tar xzf centreon-clib-1.4.2.tar.gz
cd centreon-clib-1.4.2/build
cmake \
-DWITH_TESTING=0 \
-DWITH_PREFIX=/usr/local/centreon-lib \
-DWITH_SHARED_LIB=1 \
-DWITH_STATIC_LIB=0 \
-DWITH_PKGCONFIG_DIR=/usr/lib/pkgconfig .
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon Clib
-- - Version 1.4.2
-- - With shared library Yes
-- - With static library No
--
-- System
-- - Name Linux
-- - Version 3.2.0-4-amd64
-- - Processor x86_64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags
-- - Build unit tests No
--
-- Installation
-- - Prefix /usr/local/centreon-lib
-- - Library directory /usr/local/centreon-lib/lib
-- - Include directory /usr/local/centreon-lib/include
-- - Package None
-- - pkg-config directory /usr/lib/pkgconfig
--
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/centreon-clib-1.4.2/build
make
make install
2.3 Prise en compte de la librairie partagée
root@supervision:/usr/local/centreon-engine/bin# ./centengine
./centengine: error while loading shared libraries: libcentreon_clib.so: cannot open shared object file: No such file or directory
# libc default configuration
/usr/local/lib
/usr/local/centreon-lib/lib
ldconfig -v
/usr/local/lib:
/usr/local/centreon-lib/lib:
libcentreon_clib.so -> libcentreon_clib.so
3 Installation des connecteurs Centreon
![Stacks Image 3399](files/stacks-image-f13c42d-294x186.png)
3.1 Centreon Perl Connector
3.1.a Pré requis
apt-get install libperl-dev -y
3.1.b Installation
cd /usr/local/src
wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-connectors/centreon-connector-1.1.1.tar.gz
tar xzf centreon-connector-1.1.1.tar.gz
cd centreon-connector-1.1.1/perl/build
cmake \
-DWITH_PREFIX=/usr/local/centreon-connector \
-DWITH_CENTREON_CLIB_INCLUDE_DIR=/usr/local/centreon-lib/include \
-DWITH_CENTREON_CLIB_LIBRARY_DIR=/usr/local/centreon-lib/lib \
-DWITH_TESTING=0 .
![Stacks Image 3513](files/stacks-image-2782cd4-40x38.png)
Certaines personnes ont eu des souci à la configuration du binaire avec le message ci-dessous
CMake Error at CMakeLists.txt:79 (message):
Could not find Centreon Clib's library in /usr/local/centreon-lib/lib.
-- Configuring incomplete, errors occurred!
Cela se produit en fonction de certaines configurations Debian avec l'installation de certains paquets. Pour l'exemple, ce phénomène se produit, si vous suivez ma procédure, à l'installation des paquets pour Centreon-broker. Il faudra, alors, indiquez clairement le chemin de la librairie clib comme ci-dessous :
cmake \
-DWITH_PREFIX=/usr/local/centreon-connector \
-DWITH_CENTREON_CLIB_INCLUDE_DIR=/usr/local/centreon-lib/include \
-DWITH_CENTREON_CLIB_LIBRARIES=/usr/local/centreon-lib/lib/libcentreon_clib.so \
-DWITH_TESTING=0 .
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon Perl Connector
-- - Version 1.1.1
--
-- System
-- - Name Linux
-- - Version 3.2.0-4-amd64
-- - Processor x86_64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.14/CORE
-- - Unit tests disabled
--
-- Install
-- - Prefix /usr/local/centreon-connector
-- - Binary prefix /usr/local/centreon-connector/bin
-- - Package None
--
-- Libraries
-- - clib include directory /usr/local/centreon-lib/include
-- - clib library directory /usr/local/centreon-lib/lib/libcentreon_clib.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/centreon-connector-1.1.1/perl/build
make
make install
3.2 Centreon SSH Connector
3.2.a Pré requis
apt-get install libssh2-1-dev libgcrypt11-dev -y
3.2.b Installation
cd /usr/local/src/centreon-connector-1.1.1/ssh/build
cmake \
-DWITH_PREFIX=/usr/local/centreon-connector \
-DWITH_CENTREON_CLIB_INCLUDE_DIR=/usr/local/centreon-lib/include \
-DWITH_CENTREON_CLIB_LIBRARY_DIR=/usr/local/centreon-lib/lib \
-DWITH_TESTING=0 .
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon SSH Connector
-- - Version 1.1.1
-- - Known hosts check disabled
--
-- System
-- - Name Linux
-- - Version 3.2.0-4-amd64
-- - Processor x86_64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags
-- - Unit tests disabled
--
-- Install
-- - Prefix /usr/local/centreon-connector
-- - Binary prefix /usr/local/centreon-connector/bin
-- - Package None
--
-- Libraries
-- - clib include directory /usr/local/centreon-lib/include
-- - clib library directory /usr/local/centreon-lib/lib/libcentreon_clib.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/centreon-connector-1.1.1/ssh/build
make
make install
![Stacks Image 3670](files/stacks-image-2782cd4-40x38.png)
La compilation échoue sur Debian Wheezy avec les messages d'erreurs suivants avec Centreon-connector version 1.
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc: In member function ‘void com::centreon::connector::ssh::sessions::session::connect(bool)’:
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc:203:5: error: ‘::close’ has not been declared
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc:209:5: error: ‘::close’ has not been declared
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc:218:7: error: ‘::close’ has not been declared
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc: In member function ‘void com::centreon::connector::ssh::sessions::session::_key()’:
/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc:484:32: error: ‘getuid’ was not declared in this scope
make[2]: *** [CMakeFiles/centreonconnectorssh.dir/usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc.o] Erreur 1
make[1]: *** [CMakeFiles/centreonconnectorssh.dir/all] Erreur 2
make: *** [all] Erreur 2
Ceci est du à une modification des bibliothèques du compilateur GCC 4.7. Il faut rajouter la directive #include <unistd.h> pour le fichier concerné. Rajoutons cette directive dans le fichier /usr/local/src/centreon-connector-1.0.0/ssh/src/sessions/session.cc
.......
#include <unistd.h>
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
.......
Après modification, la compilation se fait sans problème.
4 Installation de Centreon Engine
![Stacks Image 4926](files/stacks-image-9d11632-294x186.png)
4.1 Pré Requis
groupadd -g 6001 centreon-engine
useradd -u 6001 -g centreon-engine -m -r -d /var/lib/centreon-engine -c "Centreon-engine Admin" centreon-engine
Il faut aussi installer des paquets supplémentaires.
apt-get install libcgsi-gsoap-dev zlib1g-dev libssl-dev libxerces-c-dev -y
4.2 Installation
cd /usr/local/src
wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-engine/centreon-engine-1.4.11.tar.gz
tar xzf centreon-engine-1.4.11.tar.gz
cd centreon-engine-1.4.11/build/
cmake \
-DWITH_CENTREON_CLIB_INCLUDE_DIR=/usr/local/centreon-lib/include \
-DWITH_CENTREON_CLIB_LIBRARY_DIR=/usr/local/centreon-lib/lib \
-DWITH_PREFIX=/usr/local/centreon-engine \
-DWITH_USER=centreon-engine \
-DWITH_GROUP=centreon-engine \
-DWITH_LOGROTATE_SCRIPT=1 \
-DWITH_VAR_DIR=/var/log/centreon-engine \
-DWITH_RW_DIR=/var/lib/centreon-engine/rw \
-DWITH_STARTUP_DIR=/etc/init.d \
-DWITH_PKGCONFIG_SCRIPT=1 \
-DWITH_PKGCONFIG_DIR=/usr/lib/pkgconfig \
-DWITH_TESTING=0 \
-DWITH_WEBSERVICE=1 .
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon Engine
-- - Version 1.4.11
--
-- System
-- - Name Linux
-- - Version 3.2.0-4-amd64
-- - Processor x86_64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags
-- - Build static core library yes
-- - External commands module enabled
-- - Webservice module enabled
-- - Unit tests disabled
-- - pkg-config script enabled
-- - logrotate script enabled
-- - Startup script SysV-style script
--
-- Install
-- - Prefix /usr/local/centreon-engine
-- - Binary prefix /usr/local/centreon-engine/bin
-- - Configuration prefix /usr/local/centreon-engine/etc
-- - Library prefix /usr/local/centreon-engine/lib/centreon-engine
-- - Include prefix /usr/local/centreon-engine/include/centreon-engine
-- - var directory /var/log/centreon-engine
-- - Log archive directory /var/log/centreon-engine/archives
-- - RW directory /var/lib/centreon-engine/rw
-- - Lock prefix /var/lock/centengine.lock
-- - pkg-config directory /usr/lib/pkgconfig
-- - logrotate directory /etc/logrotate.d
-- - Startup directory /etc/init.d
-- - User centreon-engine
-- - Group centreon-engine
-- - Package None
--
-- Libraries
-- - clib include directory /usr/local/centreon-lib/include
-- - clib library directory /usr/local/centreon-lib/lib/libcentreon_clib.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/centreon-engine-1.4.11/build
make
make install
/usr/local/centreon-engine/bin/centengine -V
[1419847721] [7424] Centreon Engine 1.4.11
[1419847721] [7424]
[1419847721] [7424] Copyright 1999-2009 Ethan Galstad
[1419847721] [7424] Copyright 2009-2010 Nagios Core Development Team and Community Contributors
[1419847721] [7424] Copyright 2011-2013 Merethis
[1419847721] [7424]
[1419847721] [7424] This program is free software: you can redistribute it and/or
[1419847721] [7424] modify it under the terms of the GNU General Public License version 2
[1419847721] [7424] as published by the Free Software Foundation.
[1419847721] [7424]
[1419847721] [7424] Centreon Engine is distributed in the hope that it will be useful,
[1419847721] [7424] but WITHOUT ANY WARRANTY; without even the implied warranty of
[1419847721] [7424] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[1419847721] [7424] General Public License for more details.
[1419847721] [7424]
[1419847721] [7424] You should have received a copy of the GNU General Public License
[1419847721] [7424] along with this program. If not, see
[1419847721] [7424] http://www.gnu.org/licenses.
update-rc.d centengine defaults
5 Installation des Plugins pour Centreon-Engine
![Stacks Image 5223](files/stacks-image-f113bb8-294x186.png)
Depuis peu, l’équipe de Centreon a réalisé ses propres plugins en Perl. Ces plugins feront partie intégrante de la nouvelle version de Centreon 3.
5.1 Plugins historiques
5.1.a Pré requis
apt-get install libgnutls-dev libssl-dev libkrb5-dev libldap2-dev libsnmp-dev gawk libwrap0-dev libmcrypt-dev smbclient fping gettext dnsutils libmysqlclient-dev -y
5.1.b Récupération des plugins sur le site de nagios-plugins.org
cd /usr/local/src
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
tar -xzf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
5.1.c ou sur le site de monitoring-plugins.org
cd /usr/local/src
wget --no-check-certificate https://www.monitoring-plugins.org/download/monitoring-plugins-2.1.1.tar.gz
tar -xzf monitoring-plugins-2.1.1.tar.gz
cd monitoring-plugins-2.1.1
5.1.d Compilation et installation
./configure --with-nagios-user=centreon-engine --with-nagios-group=centreon-engine --prefix=/usr/local/plugins --enable-perl-modules --with-openssl=/usr/bin/openssl
make
make install
![Stacks Image 5361](files/stacks-image-2782cd4-40x38.png)
La compilation peut échouer sur Debian Wheezy avec les messages d'erreurs suivants.
Validate.xs: In function ‘get_type’:
Validate.xs:208:5: error: duplicate case value
Validate.xs:205:5: error: previously used here
make[3]: *** [Validate.o] Erreur 1
make[3]: quittant le répertoire « /usr/local/src/nagios-plugins-1.4.16/perlmods/Params-Validate-0.88 »
Can't run make at ../tools/build_perl_modules line 69.
make[2]: *** [all-local] Erreur 2
make[2]: quittant le répertoire « /usr/local/src/nagios-plugins-1.4.16/perlmods »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /usr/local/src/nagios-plugins-1.4.16 »
make: *** [all] Erreur 2
Pour résoudre ce problème, se positionnez dans le dossier suivant
cd perlmods/Params-Validate-0.88
Lancez la commande suivante
perl Makefile.PL --pm
retournez au dossier précédent et compilez
cd -
make
La compilation se fait sans problème.
5.2 Plugin Centreon
5.2.a Pré requis
apt-get install libxml-libxml-perl libjson-perl libwww-perl libxml-xpath-perl libnet-telnet-perl libnet-ntp-perl libnet-dns-perl libdbi-perl libdbd-mysql-perl libdbd-pg-perl -y
5.2.b Récupération des plugins sur le dépôt de Centreon
apt-get install git-core
5.2.c Installation
cd /usr/local/src
git clone https://github.com/centreon/centreon-plugins.git
cd centreon-plugins
chmod +x centreon_plugins.pl
cp -R * /usr/local/plugins/libexec/
6 Installation de Centreon-Broker
![Stacks Image 5493](files/stacks-image-f029d6c-294x186.png)
A partir de la version 2.5, Centreon-Broker exige une version Qt 4.7.4. Debian 6 en version stable n'offre que la version 4.6.3 et par conséquent il n'est plus possible d'effectuer une mise à jour des dernières versions de Centreon. Néanmoins, il est possible de compiler manuellement une version de QT largement compatible avec la dernière version de Centreon-Broker. J'attire votre attention que cette procédure a été réalisée sur une machine fraîchement installée donc prenez vos précautions d'usage sur une machine de production.
Ce chapitre présente l'installation de Centreon-broker version 2.7, c'est la suite pour l'installation finale de Centreon 2.5.x. Nous installerons la dernière version 2.7.0.
6.1 Pré requis
groupadd -g 6002 centreon-broker
useradd -u 6002 -g centreon-broker -m -r -d /var/lib/centreon-broker -c "Centreon-broker Admin" centreon-broker
usermod -aG centreon-broker centreon-engine
apt-get install librrd-dev libqt4-dev libqt4-sql-mysql libgnutls-dev lsb-release -y
![Stacks Image 5607](files/stacks-image-2782cd4-40x38.png)
Le package lsb-release est important pour l'installation du script cbd sur une distribution Debian. Si vous n'installez pas ce paquet, à la préparation de la compilation, vous aurez ce message d'erreur.
-- Attempting to determine OS distributor.
CMake Warning at CMakeLists.txt:66 (message):
lsb_release in not installed
Ce message d'erreur n'est pas bloquant, mais vous n'aurez pas la bonne version du script de démarrage cbd pour le fonctionnement de Centreon-Broker.
6.2 Installation
cd /usr/local/src
wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-broker/centreon-broker-2.8.1.tar.gz
tar xzf centreon-broker-2.8.1.tar.gz
cd /usr/local/src/centreon-broker-2.8.1/build/
cmake \
-DWITH_DAEMONS='central-broker;central-rrd' \
-DWITH_GROUP=centreon-broker \
-DWITH_PREFIX=/usr/local/centreon-broker \
-DWITH_STARTUP_DIR=/etc/init.d \
-DWITH_STARTUP_SCRIPT=auto \
-DWITH_TESTING=0 \
-DWITH_USER=centreon-broker .
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon Broker
-- - Version 2.8.1
--
-- System
-- - Name Linux
-- - Version 3.2.0-4-amd64
-- - Processor x86_64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags
-- - Qt 4.8.2
-- - Unit tests disabled
-- - Startup script sysv
-- - Module stats, neb, file, compression, correlation, dumper, local, rrd, sql, storage, bam, tcp, tls, bbdo, ndo
--
-- Install
-- - Prefix /usr/local/centreon-broker
-- - Binary prefix /usr/local/centreon-broker/bin
-- - Library prefix /usr/local/centreon-broker/lib
-- - Modules prefix /usr/local/centreon-broker/lib/centreon-broker
-- - Include prefix /usr/local/centreon-broker/include/centreon-broker
-- - Configuration prefix /usr/local/centreon-broker/etc
-- - Startup dir /etc/init.d
-- - User centreon-broker
-- - Group centreon-broker
-- - Package None
--
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/centreon-broker-2.8.1/build
make
make install
![Stacks Image 5097](files/stacks-image-2782cd4-40x38.png)
Un nouveau module est apparu avec la version 2.7.x, il s'agit du module dumper. Son fichier respectif se nomme 05-dumper.so. Par décalage, le module stats se nomme 15-stats.so. Les versions précédentes du Broker utilisent un module stats 05-stats.so. Ce dernier fichier provoque l'arrêt du processus cbd en version 2.7.0 s'il l'on affiche la page des statistiques. Il est impératif de le supprimer avant de relancer le service cbd.
rm /usr/local/centreon-broker/lib/centreon-broker/05-stats.so
Vous pourrez de nouveau, afficher les statistiques du broker.
update-rc.d cbd defaults
7 Installation du protocole SNMP
7.1 Pré requis
apt-get install snmp snmpd libnet-snmp-perl libsnmp-perl -y
7.2 Paramétrages
agentAddress udp:localhost:161
rocommunity public localhost
iquerySecName internalUser
trapsink localhost public
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-LS4d -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
.....
TRAPDRUN=yes
.....
# snmptrapd options (use syslog).
TRAPDOPTS='-On -Lsd -p /var/run/snmptrapd.pid'
7.3 Installation des mibs
7.3.a Modification du dépôt Debian
deb http://ftp.fr.debian.org/debian/ squeeze main non-free
deb-src http://ftp.fr.debian.org/debian/ squeeze main non-free
apt-get update
7.3.b Ajout des mibs
apt-get install snmp-mibs-downloader -y
7.3.c Modification de la configuration SNMP
ln -s /usr/share/mibs/ /usr/share/snmp/mibs
export MIBDIRS=/usr/share/snmp/mibs
export MIBS=ALL
#mibs ALL
service snmpd restart
7.3.d Vérification du fonctionnement
snmpwalk -c public -v 2c localhost
![Stacks Image 5581](files/stacks-image-fa0737e-48x46.png)
Lors des manipulations ultérieures avec Centreon-Clapi ou des visualisations de logs, des erreurs se rapportant au MIBS polluent les résultats. Par exemple, lors d'une commande de Centreon-Clapi, voici le résultat.
./centreon -u admin -p password -o nagioscfg -a show
No log handling enabled - turning on stderr logging
Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= { mib-2 57 }
Undefined identifier: mib-2 near line 18 of /usr/share/mibs/ietf/IPATM-IPMC-MIB
Bad operator (INTEGER): At line 73 in /usr/share/mibs/ietf/SNMPv2-PDU
Undefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2195 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Undefined OBJECT-GROUP (diffServMultiFieldClfrNextFree): At line 2157 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Undefined OBJECT-GROUP (diffServMIBMultiFieldClfrGroup): At line 2062 in /usr/share/mibs/ietf/IPSEC-SPD-MIB
Expected "::=" (RFC5644): At line 493 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Expected "{" (EOF): At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad object identifier: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
Bad parse of OBJECT-IDENTITY: At line 651 in /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB
nagios id;nagios name;instance;nagios comment
1;Nagios CFG 1;Central;Default Nagios.cfg
La seule solution, actuellement, que j'ai trouvée est d'éliminer les MIBS posant problème soit en déplaçant, soit en les supprimant.
mv /usr/share/mibs/ietf/IPATM-IPMC-MIB /root
mv /usr/share/mibs/ietf/SNMPv2-PDU /root
mv /usr/share/mibs/ietf/IPSEC-SPD-MIB /root
mv /usr/share/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB /root
8 Installation de Centreon UI
![Stacks Image 33996](files/stacks-image-0793eb4-294x186.png)
8.1 Pré requis
groupadd -g 6000 centreon useradd -u 6000 -g centreon -m -r -d /var/lib/centreon -c "Centreon Admin" centreon
apt-get install sudo tofrodos bsd-mailx lsb-release mysql-server libmysqlclient-dev apache2 apache2-mpm-prefork php5 php5-mysql php-pear php5-ldap php5-snmp php5-gd rrdtool librrds-perl libconfig-inifiles-perl libcrypt-des-perl libdigest-hmac-perl libdigest-sha-perl libgd-gd2-perl php5-sqlite -y
apt-get install phpmyadmin -y
8.2 Installation en ligne de commande
cd /usr/local/src wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon/centreon-2.5.4.tar.gz tar xzf centreon-2.5.4.tar.gz cd centreon-2.5.4
./install.sh -i
############################################################################### # # # Centreon (www.centreon.com) # # Thanks for using Centreon # # # # v2.5.3 # # # # infos@centreon.com # # # # Make sure you have installed and configured # # sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### ------------------------------------------------------------------------ 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 You will now read Centreon Licence. Press enter to continue.
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Do you accept GPL license ? [y/n], default to [n]: > y
------------------------------------------------------------------------ Please choose what do you want to install ------------------------------------------------------------------------ Do you want to install Centreon Web Front [y/n], default to [n]: > y Do you want to install Centreon CentCore [y/n], default to [n]: > y Do you want to install Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install Centreon Snmp Traps process [y/n], default to [n]: > y
Commençons par Centreon Web, l'interface de centreon.
------------------------------------------------------------------------ Start CentWeb Installation ------------------------------------------------------------------------ Where is your Centreon directory? default to [/usr/local/centreon] >
Where is your Centreon directory? default to [/usr/local/centreon] > Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK
Where is your Centreon log directory default to [/usr/local/centreon/log/] > Do you want me to create this directory ? [/usr/local/centreon/log/] [y/n], default to [n]: > y Path /usr/local/centreon/log/ OK
Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon OK Where is your Centreon binaries directory default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Where is your Centreon data informations directory default to [/usr/local/centreon/data] > Do you want me to create this directory ? [/usr/local/centreon/data] [y/n], default to [n]: > y Path /usr/local/centreon/data OK Where is your Centreon variable library directory? default to [/var/lib/centreon] > Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK /usr/bin/rrdtool OK /usr/bin/mail OK /usr/bin/php OK Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] > Path /usr/share/php OK /usr/bin/perl OK Finding Apache user : www-data Finding Apache group : www-data
What is the Centreon group ? [centreon] default to [centreon] > What is the Centreon user ? [centreon] default to [centreon] >
What is the Monitoring engine user ? > centreon-engine What is the Broker user ? (optional) > centreon-broker What is the Monitoring engine log directory ? > /var/log/centreon-engine Where is your monitoring plugins (libexec) directory ? default to [/usr/lib/nagios/plugins] > /usr/local/plugins/libexec Path /usr/local/plugins/libexec OK Add group centreon to user www-data OK Add group centreon to user centreon-engine OK Add group centreon-engine to user www-data OK Add group centreon-engine to user centreon OK
------------------------------------------------------------------------ Configure Sudo ------------------------------------------------------------------------ Where is sudo configuration file default to [/etc/sudoers] > /etc/sudoers OK What is the Monitoring engine init.d script ? > /etc/init.d/centengine What is the Monitoring engine binary ? > /usr/local/centreon-engine/bin/centengine What is the Monitoring engine configuration directory ? > /usr/local/centreon-engine/etc Where is the configuration directory for broker module ? > /usr/local/centreon-broker/etc Where is the init script for broker module daemon ? > /etc/init.d/cbd Your sudo is not configured Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Configuring Sudo OK
------------------------------------------------------------------------ Configure Apache server ------------------------------------------------------------------------ Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service OK Preparing Centreon temporary files Change right on /usr/local/centreon/log OK Change right on /etc/centreon OK Change macros for insertBaseConf.sql OK Change macros for sql update files OK Change macros for php files OK Change macros for perl binary OK Change right on /usr/local/centreon-engine/etc OK Add group centreon-broker to user www-data OK Add group centreon-broker to user centreon-engine OK Add group centreon to user centreon-broker OK Change right on /usr/local/centreon-broker/etc OK Copy CentWeb in system directory Install CentWeb (web front of centreon) OK Change right for install directory Change right for install directory OK Install libraries OK Write right to Smarty Cache OK Copying libinstall OK Change macros for centreon.cron OK Install Centreon cron.d file OK Change macros for centAcl.php OK Change macros for downtimeManager.php OK Install cron directory OK Change right for eventReportBuilder OK Change right for dashboardBuilder OK Change macros for centreon.logrotate OK Install Centreon logrotate.d file OK Prepare centFillTrapDB OK Install centFillTrapDB OK Prepare centreon_trap_send OK Install centreon_trap_send OK Prepare centreon_check_perfdata OK Install centreon_check_perfdata OK Prepare centreonSyncPlugins OK Install centreonSyncPlugins OK Prepare centreonSyncArchives OK Install centreonSyncArchives OK Install generateSqlLite OK Install changeRrdDsName.pl OK Prepare export-mysql-indexes OK Install export-mysql-indexes OK Prepare import-mysql-indexes OK Install import-mysql-indexes OK Centreon Web Perl lib installed OK ------------------------------------------------------------------------ Pear Modules ------------------------------------------------------------------------ Check PEAR modules PEAR 1.4.9 1.9.4 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.7 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK Archive_Zip 0.1.2 NOK Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > y
Upgrading PEAR modules Installing PEAR modules DB 1.7.6 1.7.14 OK DB_DataObject 1.8.4 1.11.3 OK DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK MDB2 2.0.0 2.4.1 OK HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK HTML_Table 1.6.1 1.8.3 OK Auth_SASL 1.0.1 1.0.6 OK Net_SMTP 1.2.8 1.6.2 OK Net_Traceroute 0.21 0.21.3 OK Net_Ping 2.4.1 2.4.5 OK Validate 0.6.2 0.8.5 OK XML_RPC 1.4.5 1.5.5 OK SOAP 0.10.1 0.13.0 OK Log 1.9.11 1.12.8 OK Archive_Zip 0.1.2 0.1.2 OK Check PEAR modules PEAR 1.4.9 1.9.5 OK DB 1.7.6 1.7.14 OK DB_DataObject 1.8.4 1.11.3 OK DB_DataObject_FormBuilder 1.0.0RC4 1.0.2 OK MDB2 2.0.0 2.4.1 OK Date 1.4.6 1.4.7 OK HTML_Common 1.2.2 1.2.5 OK HTML_QuickForm 3.2.5 3.2.13 OK HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK HTML_Table 1.6.1 1.8.3 OK Archive_Tar 1.1 1.3.7 OK Auth_SASL 1.0.1 1.0.6 OK Console_Getopt 1.2 1.3.0 OK Net_SMTP 1.2.8 1.6.2 OK Net_Socket 1.0.1 1.0.14 OK Net_Traceroute 0.21 0.21.3 OK Net_Ping 2.4.1 2.4.5 OK Validate 0.6.2 0.8.5 OK XML_RPC 1.4.5 1.5.5 OK SOAP 0.10.1 0.13.0 OK Log 1.9.11 1.12.8 OK Archive_Zip 0.1.2 0.1.2 OK All PEAR modules OK ------------------------------------------------------------------------ Centreon Post Install ------------------------------------------------------------------------ Create /usr/local/centreon/www/install/install.conf.php OK Create /etc/centreon/instCentWeb.conf OK
------------------------------------------------------------------------ Start CentStorage Installation ------------------------------------------------------------------------ Where is your Centreon Run Dir directory? default to [/var/run/centreon] > Do you want me to create this directory ? [/var/run/centreon] [y/n], default to [n]: > y Path /var/run/centreon OK Where is your CentStorage binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin OK Where is your CentStorage RRD directory default to [/var/lib/centreon] > Path /var/lib/centreon OK Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql OK Creating Centreon Directory '/var/lib/centreon/status' OK Creating Centreon Directory '/var/lib/centreon/metrics' OK Install CentStorage binary OK Change right : /var/run/centreon OK Change macros for centstorage init script OK Replace Centstorage default script Macro OK Do you want me to install CentStorage init script ? [y/n], default to [n]: > y CentStorage init script installed OK CentStorage default script installed OK Do you want me to install CentStorage run level ? [y/n], default to [n]: > y update-rc.d: using dependency based boot sequencing CentStorage Perl lib installed OK Install logAnalyser OK Install logAnalyserBroker OK Install nagiosPerfTrace OK Change macros for centstorage.cron OK Install CentStorage cron OK Change macros for centstorage.logrotate OK Install Centreon Storage logrotate.d file OK Create /etc/centreon/instCentStorage.conf OK
------------------------------------------------------------------------ Start CentCore Installation ------------------------------------------------------------------------ Where is your CentCore binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin OK Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Copy CentCore in binary directory OK Change right : /var/run/centreon OK Change right : /var/lib/centreon OK Change macros for centcore.logrotate OK Install Centreon Core logrotate.d file OK Replace CentCore init script Macro OK Replace CentCore default script Macro OK Do you want me to install CentCore init script ? [y/n], default to [n]: > y CentCore init script installed OK CentCore default script installed OK Do you want me to install CentCore run level ? [y/n], default to [n]: > y update-rc.d: using dependency based boot sequencing CentCore Perl lib installed OK Create /etc/centreon/instCentCore.conf OK
------------------------------------------------------------------------ Start CentPlugins Installation ------------------------------------------------------------------------ Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed ------------------------------------------------------------------------ Start CentPlugins Traps Installation ------------------------------------------------------------------------ Where is your SNMP configuration directory default to [/etc/snmp] > /etc/snmp OK Where is your CentreonTrapd binaries directory default to [/usr/local/centreon/bin] > /usr/local/centreon/bin OK Finding Apache user : www-data Preparing Centreon temporary files /tmp/centreon-setup exists, it will be moved... Change macros for snmptrapd.conf OK Replace CentreonTrapd init script Macro OK Replace CentreonTrapd default script Macro OK Do you want me to install CentreonTrapd init script ? [y/n], default to [n]: > y CentreonTrapd init script installed OK CentreonTrapd default script installed OK Do you want me to install CentreonTrapd run level ? [y/n], default to [n]: > y update-rc.d: using dependency based boot sequencing trapd Perl lib installed OK Install : snmptrapd.conf OK Install : centreontrapdforward OK Install : centreontrapd OK Create /etc/centreon/instCentPlugins.conf OK ############################################################################### # # # Go to the URL : http://debian7.localmac/centreon/ # # to finish the setup # # # # Report bugs at http://forge.centreon.com # # # # Thanks for using Centreon. # # ----------------------- # # Contact : infos@centreon.com # # http://www.centreon.com # # # ###############################################################################
8.3 Installation en mode Web
http://ip du serveur centreon/centreon/
![install-centreon01](files/install-centreon01.png)
Démarrage de l'installation Web, cliquez sur "Next"
![install-centreon02](files/install-centreon02.png)
Validation des dépendances, cliquez sur "next".
![install-centreon03a.png](files/install-centreon03a.png)
Nous choisirons comme moteur de supervision centreon-engine. Saisissez les chemins ci-dessous.
Centreon Engine directory: /usr/local/centreon-engine Centreon Engine Stats binary: /usr/local/centreon-engine/bin/centenginestats Centreon Engine var lib directory: /var/lib/centreon-engine Centreon Engine Connector path: /usr/local/centreon-connector Centreon Engine Library (*.so) directory: /usr/local/centreon-engine/lib/centreon-engine
![install-centreon04](files/install-centreon04.png)
Nous choisirons comme broker centreon-broker. Saisissez les chemins ci-dessous. Auparavant, il faudra créer le dossier /var/log/centreon-broker et donner la permission au processus centengine d'écrire le fichier de statistique.
mkdir /var/log/centreon-broker chown centreon-broker:centreon-broker /var/log/centreon-broker chmod 775 /var/log/centreon-broker chmod 775 /var/lib/centreon-broker
Centreon Broker etc directory: /usr/local/centreon-broker/etc Centreon Broker module (cbmod.so): /usr/local/centreon-broker/lib/cbmod.so Centreon Broker log directory: /var/log/centreon-broker Retention file directory: /var/lib/centreon-broker Centreon Broker lib (*.so) directory: /usr/local/centreon-broker/lib/centreon-broker
![install-centreon05](files/install-centreon05.png)
Création du user "Administrateur", admin et son mot de passe. Saisir une adresse valide pour l’email. Cliquez sur Next.
![install-centreon06](files/install-centreon06.png)
Définir les Accès MySQL, le mot de passe de MySQL. Laisser les noms de base par défaut CENTREON, CENTSTORAGE et CENTSTATUS. Saisir le mot de passe pour ces bases de données. Cliquez sur Next.
![install-centreon07](files/install-centreon07.png)
Cette fenêtre indique que vous devez modifier le fichier de configuration de MySql /etc/mysql/my.cnf. Ajoutez la ligne suivante.
innodb_file_per_table=1
service mysql restart
![install-centreon08](files/install-centreon08.png)
Création des bases de données, cliquez sur Next.
![install-centreon09](files/install-centreon09.png)
Fin de l'installation, cliquez sur Finish
![Stacks Image 6244](files/stacks-image-12f05c8.png)
8.4 Configuration des services
service centcore start service centreontrapd start
![Stacks Image 6116](files/stacks-image-f439916-800x392.png)
![Stacks Image 6137](files/stacks-image-e0138b1-800x198.png)
service cbd start
![Stacks Image 6174](files/stacks-image-c6ee738.png)
![Stacks Image 6195](files/stacks-image-31ddb23-800x224.png)