Nagios : Instalation de NagVis
NagVis est un plugin de visualisation pour Nagios. Il permet de faire de la cartographie sur vos hôtes et services et c’est très simple à mettre en oeuvre. Suivez le guide !
Vous devez avoir installé Nagios, voici un billet qui détaille l’installation ici : http://www.admin6.fr/2010/04/instalation-de-nagios/
1. Prérequis
Avant tout assurez-vous d’avoir un nagios 3 avec le plugin NDO
Installez aussi le paquet graphviz, il est indispensable :
aptitude install graphviz |
2.Téléchargement et Installation de NagVis :
Les paquets de NagVis sont disponibles ici : http://www.nagvis.org/downloads. Ici j’utilise la dernière version satable (1.4.6).
cd /usr/local/src/ wget http://downloads.sourceforge.net/project/nagvis/NagVis%201.4%20%28stable%29/NagVis-1.4.6/nagvis-1.4.6.tar.gz tar zxf nagvis-1.4.6.tar.gz mv nagvis-1.4.6 /usr/local/nagios/share/nagvis |
3. Configuration
La configuration de NagVis s’effectue dans le fichier /usr/local/nagios/share/nagvis/etc/nagvis.ini.php. Nous devons créer ce fichier (à parti du fichier sample) :
cd /usr/local/nagios/share/nagvis/etc/ cp nagvis.ini.php-sample nagvis.ini.php |
Puis vous devrez éditer le fichier de façon à ce qu’il utilise bien votre table ndo :
vim /etc/nagvis.ini.php |
[...] ; ---------------------------- ; Backend definitions ; ---------------------------- ; Example definition of a livestatus backend. In this case the backend_id is live_1 [backend_live_1] backendtype="mklivestatus" ;socket="unix:/usr/local/nagios/var/rw/live" ; in this example the ID of the Backend is "ndomy_1" you can define another ID. [backend_ndomy_1] ; type of backend - MUST be set backendtype="ndomy" ; hostname for NDO-db dbhost="localhost" ; portname for NDO-db dbport=3306 ; database name for NDO-db dbname="ndo" ; username for NDO-db dbuser="ndouser" ; password for NDO-db dbpass="ndopasswd" ; prefix for tables in NDO-db dbprefix="nagios_" ; instance name for tables in NDO-db Nom de votre instance renseignée dans Nagios dbinstancename="Central" ; maximum delay of the NDO Database in seconds ;maxtimewithoutupdate=180 ; path to the cgi-bin of this backend ;htmlcgi="/nagios/cgi-bin" [...] |
Maintenant il faut modifier les droits :
chown -R nagios:nagios /usr/local/nagios/share/nagvis chmod 2755 /usr/local/nagios/share/nagvis chmod 664 /usr/local/nagios/share/nagvis/etc/nagvis.ini.php chmod 775 /usr/local/nagios/share/nagvis/nagvis/images/maps chmod 664 /usr/local/nagios/share/nagvis/nagvis/images/maps/* chmod 775 /usr/local/nagios/share/nagvis/etc/maps chmod 664 /usr/local/nagios/share/nagvis/etc/maps/* chmod -R 775 /usr/local/nagios/share/nagvis/var chmod 664 /usr/local/nagios/share/nagvis/var/* |
Vous pouvez maintenant lancer l’interface de configuration web : http://adresse_serveur_nagios/nagios/nagvis/config.php
N’hésitez pas à commenter si vous rencontrez des problèmes 😉
Bonjour,
merci pour ce tuto bien organisé.
Suite à un apt-get upgrade sur mon serveur nagios, je rencontre une erreur de socket sur nagvis : Problem backend : live_1, alors que tout fonctionnait correctement avant. J’ai vérifié les droits et ça semble correspondre.
Une idée ?
Salut sarahgros, le backend devrait etre ndomy_1, le live c’est pour celui de l’automap.
Minimoi