Outils personnels

Installation de PNP4Nagios : Différence entre versions

De wikiGite

(Page créée avec « == PNP4Nagios (Graph) == PNP is an addon to nagios which analyzes performance data provided by plugins and stores them automatically into RRD-databases. === Pré-Requis ===... »)
 
(Plugins)
 
(32 révisions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
== PNP4Nagios (Graph) ==
+
PNP est un addon à Nagios (et Shinken) qui analyse les données de performance fournies par les plugins et les stocke automatiquement dans des bases RRD.
PNP is an addon to nagios which analyzes performance data provided by plugins and stores them automatically into RRD-databases.
 
  
 
=== Pré-Requis ===
 
=== Pré-Requis ===
Ligne 10 : Ligne 9 :
  
 
=== Téléchargement et compilation de PNP4Nagios ===
 
=== Téléchargement et compilation de PNP4Nagios ===
  wget http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.13.tar.gz
+
  wget <nowiki>http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.17.tar.gz</nowiki>
 +
tar -xvzf pnp4nagios-*.tar.gz
 +
cd pnp4nagios-*
 
  ./configure --with-nagios-user=shinken --with-nagios-group=shinken  
 
  ./configure --with-nagios-user=shinken --with-nagios-group=shinken  
 
  make all
 
  make all
 
  make install
 
  make install
 
  make fullinstall
 
  make fullinstall
 +
L'installation paramètre Apache en ajoutant un fichier /etc/apache2/conf.d/pnp4nagios.conf, puis relance le serveur web.
  
=== Installation ===
+
=== Paramétrage ===
*Se connecter à : http://localhost/pnp4nagios
+
* 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 [[Installation_de_Shinken_sur_une_Debian]])
*Attention à l'emplacement du fichier htpasswd (Utiliser celui de Thruk?)
+
htpasswd -c /usr/local/pnp4nagios/htpasswd.users admin
*Renommer ou supprimer le fichier install.php
+
 
*Ajouter les lignes suivantes dans /etc/shinken/nagios.cfg :
+
* Dans /etc/shinken/shinken-specific.cfg, vérifier les lignes :
nagios.cfg
+
define module{
 +
  module_name  NPCDMOD
 +
  module_type  npcdmod
 +
  config_file  /usr/local/pnp4nagios/etc/npcd.cfg
 +
}
 +
et
 +
define broker{
 +
      broker_name      broker-1
 +
[...]
 +
      modules          Simple-log,''NPCDMOD''
 +
}
 +
 
 +
Shinken semble embarquer son propre module NPCDMOD (à vérifier ?) et n'a pas besoin de la configuration de nagios.cfg comme indiqué sur le site de pnp4nagios.
 +
<!-- *Ajouter les lignes suivantes dans /etc/shinken/nagios.cfg (on active le "BULK" mode plutôt que le mode synchrone http://docs.pnp4nagios.org/pnp-0.6/config):
 
  process_performance_data=1
 
  process_performance_data=1
 
  #
 
  #
 
  # service performance data
 
  # service performance data
 
  #
 
  #
  service_perfdata_file=/usr/local/nagios/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=/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_mode=a
 
  service_perfdata_file_processing_interval=15
 
  service_perfdata_file_processing_interval=15
Ligne 33 : Ligne 49 :
 
  # host performance data starting with Nagios 3.0
 
  # host performance data starting with Nagios 3.0
 
  #  
 
  #  
  host_perfdata_file=/usr/local/nagios/var/host-perfdata
+
  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_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_mode=a
 
  host_perfdata_file_processing_interval=15
 
  host_perfdata_file_processing_interval=15
  host_perfdata_file_processing_command=process-host-perfdata-file
+
  host_perfdata_file_processing_command=process-host-perfdata-file -->
 +
 
 +
* Démarrer le service NPCD (le démon est quand même nécessaire pour traiter ce que le module empile dans le répertoire var/spool de pnp4nagios !). Il est installé par pnp4nagios.
 +
/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
  
* Démarrer le service NCPD
+
=== Accès à l'interface Web ===
  /etc/init.d/ncpd start
+
  <nowiki>http://<@IP-serveur>/pnp4nagios</nowiki>
  
 +
=== Plugins ===
 +
Attention certains plugins Shinken/Nagios (check_host, check_ssh,...) ne fournissent pas de données de performance ! Pour SSH par exemple on préférera "check_tcp!22" plutôt que "check_ssh".
 +
 +
=== Liens ===
 
Plus d'informations sur Shinken & PNP : http://shinken-monitoring.org/wiki/use_with_pnp
 
Plus d'informations sur Shinken & PNP : http://shinken-monitoring.org/wiki/use_with_pnp
 +
 +
Pnp4nagios : http://docs.pnp4nagios.org

Version actuelle datée du 27 juillet 2012 à 07:30

PNP est un addon à Nagios (et Shinken) qui analyse les données de performance fournies par les plugins et les stocke automatiquement dans des bases RRD.

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 Installation_de_Shinken_sur_une_Debian)
htpasswd -c /usr/local/pnp4nagios/htpasswd.users admin
  • Dans /etc/shinken/shinken-specific.cfg, vérifier les lignes :
define module{
 module_name  NPCDMOD
 module_type  npcdmod
 config_file  /usr/local/pnp4nagios/etc/npcd.cfg
}

et

define broker{
      broker_name      broker-1
[...]
      modules          Simple-log,NPCDMOD
}

Shinken semble embarquer son propre module NPCDMOD (à vérifier ?) et n'a pas besoin de la configuration de nagios.cfg comme indiqué sur le site de pnp4nagios.

  • Démarrer le service NPCD (le démon est quand même nécessaire pour traiter ce que le module empile dans le répertoire var/spool de pnp4nagios !). Il est installé par pnp4nagios.
/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

Plugins

Attention certains plugins Shinken/Nagios (check_host, check_ssh,...) ne fournissent pas de données de performance ! Pour SSH par exemple on préférera "check_tcp!22" plutôt que "check_ssh".

Liens

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

Pnp4nagios : http://docs.pnp4nagios.org