Outils personnels

Installation de PNP4Nagios

De wikiGite

Révision datée du 5 juin 2012 à 17:00 par Frank (discussion | contributions) (Paramétrage)

PNP is an addon to nagios which analyzes performance data provided by plugins and stores them automatically into RRD-databases.

Pré-Requis

apt-get install rrdtool
apt-get install librrds-perl
apt-get install zlib1g zlib1g-dev libpng12-0 libpng12-dev libfreetype6 libfreetype6-dev libart-2.0-2 libart-2.0-dev librrd-dev
apt-get install php5-gd
a2enmod rewrite

Téléchargement et compilation de PNP4Nagios

wget http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.17.tar.gz
tar -xvzf pnp4nagios-*.tar.gz
cd pnp4nagios-*
./configure --with-nagios-user=shinken --with-nagios-group=shinken 
make all
make install
make fullinstall

L'installation paramètre Apache en ajoutant un fichier /etc/apache2/conf.d/pnp4nagios.conf, puis relance le serveur web.

Paramétrage

Vérifier l'emplacement du fichier htpasswd (dans/etc/apache2/conf.d/pnp4nagios.conf, ligne AuthUserFile). Si le chemin est bon (attention notamment à remplacer "nagios" par "pnp4nagios"), créer ce fichier (ou pointer vers un fichier existant, par exemple celui de" Shinken /etc/shinken/htpasswd.users)

htpasswd -c /usr/local/pnp4nagios/htpasswd.users admin
process_performance_data=1
#
# service performance data
#
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$\tSERVICEOUTPUT::$SERVICEOUTPUT$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
#
# host performance data starting with Nagios 3.0
# 
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tHOSTOUTPUT::$HOSTOUTPUT$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
  • Démarrer le service NPCD
/etc/init.d/npcd start
  • Se connecter à : http://localhost/pnp4nagios
  • Si tout est correct (en vert), renommer ou supprimer le fichier /usr/local/pnp4nagios/share/install.php

Accès à l'interface Web

http://<@IP-serveur>/pnp4nagios

Plus d'informations sur Shinken & PNP : http://shinken-monitoring.org/wiki/use_with_pnp