Installation de Centreon 1.4.2.2 / Nagios 2.10 / Plugins 1.4.11 sous OpenSuse 10.2

© Pascal MARTIN (NiTroZ) 01/2008 http://pmartin.net

INSTALLATION DU SYSTEME

Installation minimale d'OpenSuse 10.2 sans interface graphique

puis sélection des Rpm suivants:

apache2-2.2.3-20
apache2-mod_perl-2.0.2-38
apache2-mod_php5-5.2.0-10
php5-5.2.0-10
php5-gd-5.2.0-10
php5-ldap-5.2.0-10
php5-mysql-5.2.0-10
php5-pear-5.2.0-10
php5-posix-5.2.0-10
php5-snmp-5.2.0-10
mysql-5.0.26-12
mysql-client-5.0.26-12
mysql-devel-5.0.26-12
gd-2.0.32-49
libpng-1.2.12-23
libpng-devel-1.2.12-23
glibc-2.5-25
glibc-devel-2.5-25
perl-5.8.8-32
perl-Config-IniFiles-2.39-31
perl-Crypt-DES-2.05-30
perl-Digest-HMAC-1.01-525
perl-Digest-SHA1-2.11-20
perl-GD-2.35-18
perl-GDGraph-1.43-43
perl-GDTextUtil-0.85-160
perl-Net-SNMP-5.2.0-30
rrdtool-1.2.15-25
make-3.81-23
libstdc++41-4.1.2_20061115-5
libstdc++41-devel-4.1.2_20061115-5
libgcc41-4.1.2_20061115-5
gcc-4.1.3-29
gcc-c++-4.1.3-29
postfix-2.3.2-28
net-snmp-5.4.rc2-4
net-tools-1.60-606
nmap-4.12

UPGRADE ET INSTALLATION DES PACKAGES PEAR

pear upgrade PEAR
pear install -o -f --alldeps Mail Mail_Mime Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate Image_Graph Image_GraphViz HTML_Table HTML_QuickForm_advmultiselect Auth_SASL HTTP Numbers_Roman Numbers_Words MDB2 DB_DataObject_FormBuilder DB_DataObject DB Date XML_RPC SOAP

RECUPERATION DES SOURCES

cd /tmp 

Centreon 1.4.2.2

wget http://download.oreon-project.org/index.php?id=71

Nagios 2.10

wget http://kent.dl.sourceforge.net/sourceforge/nagios/nagios-2.10.tar.gz

Nagios-plugins 1.4.11

wget http://kent.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

gd-2.0.35

wget http://www.libgd.org/releases/gd-2.0.35.tar.gz

INSTALLATION de GD

cd /tmp
tar -zxvf gd-2.0.35.tar.gz
cd gd-2.0.35/
./configure
make
make install

INSTALLATION de NAGIOS

Créations des utilisateurs, groupes et répertoires utiles à l'installation de Nagios

groupadd nagios
useradd -g nagios nagios
mkdir -p /usr/local/nagios
chown nagios:nagios /usr/local/nagios
groupadd nagioscmd
usermod -G nagioscmd wwwrun
usermod -G nagioscmd nagios

Décompression de la source, configuration et compilation de Nagios

tar -zxvf nagios-2.10.tar.gz
cd nagios-2.10
./configure --enable-embedded-perl --with-perlcache --disable-statuswrl --with-default-perfdata --prefix=/usr/local/nagios
make all
make install
make install-init
make install-commandmode
make install-config

Mise en place des droits:

chown -R nagios:nagios /usr/local/nagios/etc
chown -R nagios:nagioscmd /usr/local/nagios/var/rw
chmod 775 /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw

Modification des autorisations utilisateur dans Nagios

Editer le fichier /usr/local/nagios/etc/cgi.cfg et modifer à votre convenance les lignes commencant par authorized …

Test de Nagios

Renommer les fichiers .cfg.sample en .cfg dans le répertoire /usr/local/nagios/etc

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

S'il n'y a pas d'erreur :

/etc/init.d/nagios start
/etc/init.d/nagios status

INSTALLATION DES PLUGINS NAGIOS

Décompression de la source, configuration et compilation

cd /tmp	
tar -zxvf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --prefix=/usr/local/nagios --with-cgiurl=/nagios/cgi-bin
make
make install

Mise en place des droits

chmod -R 775 /usr/local/nagios/libexec

CONFIGURATION D'APACHE

Modifier le fichier /etc/php5/apache2/php.ini

memory_limit = **32M**  ( au lieu de 16M)

Création du fichier /etc/apache2/conf.d/nagios.conf

scriptalias /nagios/cgi-bin /usr/local/nagios/sbin
<directory "/usr/local/nagios/sbin">
      allowoverride authconfig
      options none
      order allow,deny
      allow from all
</directory>
alias /nagios /usr/local/nagios/share
<directory "/usr/local/nagios/share">
      allowoverride authconfig
      options none
      order allow,deny
      allow from all
</directory>

Mise en place des fichiers .htaccess dans /usr/local/nagios/share et /usr/local/nagios/sbin

Contenu du fichier .htaccess

authname "Acces Nagios"
authtype basic
authuserfile /usr/local/nagios/etc/htpasswd.users
require valid-user

Création du htpasswd.users

htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Redémarrage d'Apache

/etc/init.d/apache2 start

Test de Nagios via le navigateur

http://@ipserveur/nagios/

CONFIGURATION DE MYSQL

Démarrage du service

/etc/init.d/mysql start

Mise en place du password pour root

/usr/bin/mysqladmin -u root password 'VotreMotDePasse'

INSTALLATION CENTREON

Creation d'un lien symbolique pour Perl

mkdir -p /usr/local/rrdtool/lib/
ln -s /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/ /usr/local/rrdtool/lib/perl

Décompression de la source

cd /tmp
tar -zxvf centreon-1.4.2.2.tar.gz
cd centreon-1.4.2.2

Lancement du script d'installation

./install.sh

Are you sure to continue ?
[y/n], default to [n]:y

Where is installed Nagios ?
default to [/usr/local/nagios]:/usr/local/nagios

Where are your nagios etc directory ?
default to [/usr/local/nagios/etc]:/usr/local/nagios/etc
Path /usr/local/nagios/etc/nagios.cfg OK

Where are your nagios plugins / libexec directory ?
default to [/usr/local/nagios/libexec]:/usr/local/nagios/libexec

Where are your nagios bin directory ?
default to [/usr/local/nagios/bin]:/usr/local/nagios/bin

Where do I install Oreon ?
default to [/usr/local/oreon]:/usr/local/oreon

Where is sudo ?
default to [/etc/sudoers]:/etc/sudoers

Where is installed RRD perl modules (RRDs.pm) ?
Just put directory, not full path.
default to [/usr/local/rrdtool/lib/perl]:/usr/local/rrdtool/lib/perl
← lien symbolique vers /usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/

Where is rrdtool binary ?
default to [/usr/bin/rrdtool]:/usr/bin/rrdtool

Where is mail binary ?
default to [/usr/bin/mail]:/usr/bin/mail

Where is PEAR Path ?
default to [/usr/share/pear]:/usr/share/php5/PEAR

    User Management

Finding Apache group : www
Finding Apache user : wwwrun
Finding Nagios group : nagios
Finding nagios group 'nagios' in /etc/group YES
Finding Nagios user : nagios
Finding nagios user 'nagios' in /etc/passwd YES

   Other Stuff

Nagios libexec directory OK
TrueType verdana installed OK
Finding PEAR Path : /usr/share/php5/PEAR OK
PEAR Font installed OK

  Configure Apache server

/usr/local/oreon already exists PASSED
Create '/etc/apache2/conf.d/oreon.conf' OK
Configuring Apache OK
User wwwrun added to nagios group OK

    Start Oreon Installation

Oreon Directory already exists PASSED
Copy 'filesGeneration' OK
Copy 'filesUpload' OK
Copy 'GPL_LIB' OK
Copy 'log' OK
Copy 'www' OK
Copy 'cron' OK
Copy 'ODS' OK
Copy 'ODS_SRC_ETC' OK
Copy 'doc' OK

    Start Plugins Oreon Installation

/usr/local/nagios/libexec already exists PASSED

Preparing Oreon Plugins…
→ check_centreon_TcpConn OK
→ check_centreon_dell_temperature OK
→ check_centreon_http OK
→ check_centreon_nt OK
→ check_centreon_packetErrors OK
→ check_centreon_ping OK
→ check_centreon_snmp_loadaverage OK
→ check_centreon_snmp_process OK
→ check_centreon_snmp_remote_storage OK
→ check_centreon_snmp_traffic OK
→ check_centreon_snmp_uptime OK
→ check_centreon_snmp_value OK
→ check_meta_service OK
→ check_nt_centreon OK
→ check_snmp_cpfw.pl OK
→ check_snmp_load.pl OK
→ check_snmp_mem.pl OK
→ check_snmp_process.pl OK
→ check_snmp_processus_loaded.pl OK
→ check_snmp_script_result.pl OK
→ check_snmp_storage.pl OK
→ check_snmp_win.pl OK
→ oreon.conf OK
→ oreon.pm OK
→ process-service-perfdata OK
→ submit_host_check_result OK
→ submit_service_check_result OK

Do you want to install Oreon Plugins ?
[y/n], default to [y]:y

Installing Oreon Plugins on '/usr/local/nagios/libexec' OK

   Start Traps Handler Installation

Preparing Oreon Plugins…
→ fill_trapDB
→ genSnmpttConfFile
→ trapHandler

Do you want to install Oreon Traps Plugins ?
[y/n], default to [y]:y

Installing Oreon Traps Plugins on
/usr/local/nagios/libexec/traps already exists PASSED

Where is your SNMP configuration file?
default to [/etc/snmp/]:/etc/snmp/

Moving snmptrapd.conf to /etc/snmp/ OK
/etc/snmp/centreon_traps already exists PASSED
Moving snmptt.ini to /etc/snmp/centreon_traps/ OK
Moving snmp.conf to /etc/snmp/ OK
Moving snmptt to /usr/sbin/ OK
Moving snmpttconvertmib to /usr/sbin/ OK
/usr/local/nagios/libexec/traps/' OK
/usr/local/nagios/etc already exists PASSED
/usr/local/oreon/filesGeneration/nagiosCFG already exists PASSED
/usr/local/oreon/filesUpload/nagiosCFG already exists PASSED

   Start ODS Installation

Checking ODS data folder : ODS Directory already exists PASSED
Checking ODS database folder :
ODS Directory already exists PASSED
Checking ODS log folder :
ODS Directory already exists PASSED
Replace ODS Macro OK
Install ODS Binary OK
Set ODS properties OK

    Replace Macro In ODS cron script

in /usr/local/oreon/cron/inventory_update.php OK
in /usr/local/oreon/cron/reporting/ArchiveLogInDB.php OK
in /usr/local/oreon/cron/parsing_status.pl OK
in /usr/local/oreon/cron/parsing_log.pl OK

    Start Oreon Cron Configuration

Please specify user do you use for oreon cron
By default, oreon use nagios user, it's correct ?
[y] or specifie user, default to [nagios] y
You old crontab is backup on /tmp/crontab_nagios.5177 file

      Configure Sudo

Finding nagios init script : /etc/init.d/nagios
Sudo is already configurated PASSED

      Oreon Post Install

Finding mail binary : /usr/bin/mail OK
Finding rrdtool binary : /usr/bin/rrdtool OK
Create /usr/local/oreon/www/install/installoreon.conf.php OK
Create /etc/oreon.conf OK
Configuring Oreon post-install OK

###############################################################################
# Go to the URL : http://your-server/oreon/ to finish the setup #
# #
# Report bugs at bugs@oreon-project.org #
# #
# Thanks for using OREON. #
# ———————– #
# Contact : infos@oreon-project.org #
# http://www.oreon-project.org #
###############################################################################


CONFIGURATION DU DEMARRAGE DES SERVICES

      chkconfig -a mysql
      chkconfig -a apache2
      chkconfig -a nagios
      chkconfig -a ods
      chkconfig -a snmpd

CONFIGURATION DE CENTREON POST-INSTALLATION

Se connecter via le navigateur

      http://@ipserveur/oreon/

FINALISATION DE LA CONFIGURATION

Se connecter sous centreon

Aller au menu Configuration / Nagios / Nagios CFG
Modifier Nagios CFG 1 comme suit afin de prendre en charge les données de performance:

Aller au menu Configuration / Nagios / CGI CFG
Modifier CGI.cfg comme suit :

Aller au menu Options / Oreon / Options générales / Nagios et vérifier les paramètres :

Aller au menu Options / Oreon / Options générales / SNMP et vérifier le path des librairies Perl :

Aller au menu Options / Oreon / Options générales / RRDTOOL et vérifier la version de RRDTOOL :

Aller au menu Options / Oreon / Options générales / CentreonDataStorage et vérifier les paramètres :
A noter que les bases RRD seront dans /var/lib/ods/database

CREATION D'UN GROUPE D'UTILISATEUR

Aller au menu Configuration / Utilisateurs / Groupe d'utilisateur / Ajouter

Modifier l'utilisateur admin dans le menu Configuration / Utilisateurs / Utilisateurs

Ajout d'un host à superviser Configuration / Hosts / Ajouter

DEPLOIEMENT DE LA CONFIGURATION VERS LE MOTEUR NAGIOS

Menu Configuration / Nagios

Puis Générer

 
supervision/centreon_installation.txt · Dernière modification: 05/02/2008 12:28 par nitroz