Installation de Nagvis avec NDOutils à partir du tarball sur Ubuntu Serveur 8.04 LTS

Nagvis est un plugin qui s’appuie sur un Nagios en version base de données. Je traiterai ici d’une installation de Nagvis s’appuyant sur NDOutils et non Merlin.
Ce plugin permet de créer des maps à la volée sans travailler sur les fichiers de configuration le tout saupoudré d’AJAX.

Installation des dépendances

apt-get install graphviz php5 php5-gd php5-mysql libapache2-mod-php5

Installation de nagvis :

wget http://downloads.sourceforge.net/sourceforge/nagvis/nagvis-1.4.1.tar.gz?use_mirror=superb-east
tar xzf nagvis-1.4.1.tar.gz
cd nagvis-1.4.1
./install.sh

Correction du timezone php :

nano /etc/php5/apache2/php.ini

Adaptez la ligne

date.timezone = « Europe/Paris »

Relancez apache

/etc/init.d/apache2 restart

Configuration de nagvis :

nano /usr/local/nagios/share/nagvis/etc/nagvis.ini.php

Vérifiez les paramètres

; Path definitions
[paths]
; absolute physical NagVis path
base= »/usr/local/nagios/share/nagvis/ »
; absolute html NagVis path
htmlbase= »/nagios/nagvis »
; absolute html NagVis cgi path
htmlcgi= »/nagios/cgi-bin »

; target for the icon links
urltarget= »_self »
; URL template for host object links
hosturl= »[htmlcgi]/status.cgi?host=[host_name] »
; URL template for hostgroup object links
hostgroupurl= »[htmlcgi]/status.cgi?hostgroup=[hostgroup_name] »
; URL template for service object links
serviceurl= »[htmlcgi]/extinfo.cgi?type=2&host=[host_name]&service=[service_description] »
; URL template for servicegroup object links
servicegroupurl= »[htmlcgi]/status.cgi?servicegroup=[servicegroup_name]&style=detail »

; Options for the Automap
[automap]
; Default URL parameters for links to the automap
defaultparams= »&maxLayers=2″
; Default root host (NagVis uses this if it can’t detect it via NDO)
;defaultroot= » »
; Path to the graphviz binaries (dot,neato,…); Only needed if not in ENV PATH
graphvizpath= »/usr/bin/ »
; Show the automap in the lists (Map index and dropdown menu in header)
showinlists=1

; —————————-
; Backend definitions
; —————————-

; 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= »XXXXXXXXXXXXXXXXXXXXXXXXXX »
; prefix for tables in NDO-db
dbprefix= »nagios_ »
; instance name for tables in NDO-db
dbinstancename= »default »
; maximum delay of the NDO Database in seconds
maxtimewithoutupdate=180
; path to the cgi-bin of this backend

htmlcgi= »/nagios/cgi-bin »

Rattrapage des droits à faire à chaque upload dans un des répertoires suivant :

Ou le tout en un bloc pour les fainéants ou les tetes en l’air

chown -R www-data:www-data /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 775 /usr/local/nagios/share/nagvis/var &&
chmod 664 /usr/local/nagios/share/nagvis/var/* ;

Optionnel > Installation de nouvelles icônes :

cd
wget http://www.nagvis.org/sites/default/files/NagVis-Iconset-Lemon-0.2.tgz
tax zxf NagVis-Iconset-Lemon-0.2.tgz
cp lemon/nagvis/nagvis/images/iconsets/* /usr/local/nagios/share/nagvis/nagvis/images/iconsets/

Optionnel > Installation de nouvelles images  :

cd
wget http://www.nagvis.org/sites/default/files/NagVis-Shapes-Server-Dropline.tgz
tar xzf NagVis-Shapes-Server-Dropline.tgz
cp shapes_dropline/* /usr/local/nagios/share/nagvis/nagvis/images/shapes/

Optionnel > Installation de nouveaux skins  :

cd
wget http://www.nagvis.org/sites/default/files/NagVis-Template-Darkglass-0.4.tgz
tar zxf NagVis-Template-Darkglass-0.4.tgz
cd darkglass/
cp -r nagvis/ /usr/local/nagios/share/nagvis/

Pour la création des maps je vous laisse voir ca sur le wiki nagios-fr

Zephilou

1 Response

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Post comment