1 Comment installer Nagios, Centreon et Nagvis sous Redhat ou CentOs? Ce tuto v

1 Comment installer Nagios, Centreon et Nagvis sous Redhat ou CentOs? Ce tuto vous permettra d’installer le trio Nagios, Nagvis et Centreon avec NDOutils très facilement sur Redhat ou CentOs. Prérequis : Vous pouvez les télécharger avec ces liens. • Nagios 3.4.1 core • Nagios plugins 1.4.15 • Centreon 2.3.8 • Ndoutils 1.4b9 Pour sauvegarder ou restaurer votre installation et votre configuration à l’aide d’un script suivez ce lien : Sauvegarder et Restaurer Nagios, Centreon et Nagvis On installe tous les packages nécessaires : yum -y install make gcc php-pear* mysql mysql-server php-mbstring mysql- devel httpd net-snmp php-mysql gd-devel perl-GD perl-Config-IniFiles perl- Crypt-DES perl-Digest-HMAC perl-IO-Socket-INET6 perl-Net-SNMP php-ldap php- snmp perl-Socket6 php-gd php-xml mlocate sendmail openssh-clients php-posix mailx system-config-network-tui ntp rrdtool rrdtool-devel php-rrdtool perl- rrdtool net-snmp-utils bc Tous les packages qui ne s’installeront pas devront être téléchargés et installés manuellement sur : Pour 64 bits : http://dl.fedoraproject.org/pub/epel/5/x86_64/repoview/ Pour 32 bits : http://dl.fedoraproject.org/pub/epel/5/i386/repoview/ Le site de référence est : http://fedoraproject.org/wiki/EPEL Installation de Mysql 2 On lance Mysql-Server, Apache, et on crée un user « nagios » : # chkconfig mysqld on # service mysqld start # chkconfig httpd on # service httpd start # user add nagios # reboot Ensuite, on télécharge tous les packages nécessaires (si ce n’est pas déjà fait) : # cd /root # mkdir centreoninst # cd centreoninst # wget http://tuto-web.fr/DL/centreon-2.3.8.tar.gz # wget http://tuto-web.fr/DL/nagios-3.4.1.tar.gz # wget http://tuto-web.fr/DL/nagios-plugins-1.4.15.tar.gz # wget http://tuto-web.fr/DL/ndoutils-1.4b9.tar.gz Installation de NTP (synchro horloge). # yum install ntp # chkconfig ntpd on # ntpdate pool.ntp.org # service ntpd start Installation de Nagios # tarxvzf nagios-3.4.1.tar.gz # cd nagios # ./configure # make all # make install # make install-init # make install-commandmode # make install-config # make install-webconf Création d’un password pour l’interface de Nagios # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin # chkconfig nagios on # service nagios start Installation des plugins : cd .. # tar xvzf nagios-plugins-1.4.15.tar.gz # cd nagios-plugins-1.4.15 #./configure # make # make install Installation de NDOutils 1.4b9 : 3 # cd .. # tar xvzf ndoutils-1.4b9.tar.gz # cd ndoutils-1.4b9 # ./configure --disable-pgsql --with-mysql-lib=/usr/lib64/mysql --with- ndo2db-user=nagios --with-ndo2db-group=nagios Pour un OS 32 bits utiliser : –with-mysql-lib=/usr/lib/mysql # make # make install # make install-init # chown nagios:nagios /usr/local/nagios/bin/ndo* Ndomod a besoin de deux fichiers pour fonctionner correctement, on les importent : mv /root/centreoninst/ndoutils-1.4b9/config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg mv /root/centreoninst/ndoutils-1.4b9/config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg chown nagios:nagios /usr/local/nagios/etc/ndo* vi /usr/local/nagios/etc/ndomod.cfg instance_name=Central output_type=unixsocket output=/usr/local/nagios/var/ndo.sock tcp_port=5668 output_buffer_items=5000 buffer_file=/usr/local/nagios/var/ndomod.tmp vi /usr/local/nagios/etc/ndo2db.cfg ndo2db_user=nagios ndo2db_group=nagiosgrp socket_type=unix socket_name=/usr/local/nagios/var/ndo.sock tcp_port=5668 db_servertype=mysql db_host=localhost db_name=ndo db_port=3306 db_prefix=nagios_ db_user=ndouser db_pass=ndopassword vi /usr/local/nagios/etc/nagios.cfg event_broker_options=-1 broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg Le broker_module tiens sur une seule ligne !!! 4 Pour que votre configuration soit prise en compte, il faut lancer NDO et relancer Nagios: # /etc/init.d/ndo2db start # /etc/init.d/nagios restart Si tout se passe bien, Nagios devrait commencer à écrire les informations dans la base de données MySQL. Pour vous en assurer, allez voir du côté du fichier de log si vous avez les messages suivants: tail -f /usr/local/nagios/var/nagios.log ... [1234886298] Auto-save of retention data completedsuccessfully. ... Configuration de la base de donnée NDO Pour que NDO2DB puisse écrire des informations dans la base de donnée, il faut la créer et la configurer. Création de la base de données MySQL NDO: # mysqladmin -u root -p create ndo # mysql -u root -p mysql mysql> GRANT ALL ON ndo.* TO ndouser@localhost IDENTIFIED BY 'ndopassword'; Query OK, 0 rowsaffected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rowsaffected (0.00 sec) mysql> exit Configuration : # cd db # ./installdb -u ndouser -p ndopassword -h localhost -d ndo … Table ‘nagios.nagis_dbversion’ doesn’texistat ./installdb line 51… Remarque: vous pouvez ignorer l’erreur. On lance le service NDO et on l’ajoute automatiquement au démarrage : # service ndo2db start # chkconfig ndo2db on Installation de Nagvis : Téléchargez la dernière version de Nagvis à l’adresse : 5 http://sourceforge.net/projects/nagvis/files/NagVis%201.7/ On installe les modules PHP avec la commande yum. # yum install php php-gd php-mysql php-mbstring php-xml php-common php-session n’est pas présent dans les dépôts, mais ce paquet est compris dans le paquet php- common déjà installé normalement mais on le remet pour être sûr. # yum install graphviz Si la commande ne passe pas, allez dans le dossier et installez graphviz via les rpm téléchargés sur le site http://fedoraproject.org/wiki/EPEL. Nagvis 1.4 demande une version supérieur à 2.14 de graphviz or dans le dépôt EPEL, ce sont les version 2.12 qui sont fournit. Cela fonctionnera mais il est préférable de trouver les versions suivantes et les installer. # rpm -ivh graphviz-2.22.2-1.el5.i386.rpm # rpm -ivh graphviz-doc-2.22.2-1.el5.i386.rpm # rpm -ivh graphviz-gd-2.22.2-1.el5.i386.rpm # rpm -ivh graphviz-graphs-2.22.2-1.el5.i386.rpm # rpm -ivh graphviz-perl-2.22.2-1.el5.i386.rpm # tar xvzf nagvis-1.7.9.tar.gz # cd nagvis-1.7.9 On lance l’install : # ./install.sh +-------------------------------------------------------------------------- ----+ | Welcome to NagVis Installer | +-------------------------------------------------------------------------- ----+ | This script is built to facilitate the NagVis installation and update | | procedure for you. The installer has been tested on the following systems: | | - Debian Etch, Hardy (4.0, 5.0) | | - Ubuntu Hardy, Intrepid, Jaunty, Karmic, Lucid (8.04 to 10.04) | | - SuSE Linux Enterprise Server 10 and 11 | | | | Similar distributions to the ones mentioned above should work as well. | | That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE | | | | If you experience any problems using these or other distributions, please | | report that to the NagVis team. | 6 +-------------------------------------------------------------------------- ----+ | Do you want to proceed? [y]: y +-------------------------------------------------------------------------- ----+ | Starting installation of NagVis 1.7.9 | +-------------------------------------------------------------------------- ----+ | OS : Debian GNU/Linux 5.0 | | Perl: 5.010000 | | | +--- Checking for tools --------------------------------------------------- ----+ | Using packet manager /usr/bin/dpkg found | | | +--- Checking paths ------------------------------------------------------- ----+ | Please enter the path to the nagios base directory [/usr/local/nagios]: | nagios path /usr/local/nagios found | | Please enter the path to NagVis base [/usr/local/nagvis]: | | +--- Checking prerequisites ----------------------------------------------- ----+ | Nagios Core 3.2.3 found | | PHP 5.2 found | | PHP Module: gd 5.2 found | | PHP Module: mbstring compiled_in found | | PHP Module: gettext compiled_in found | | PHP Module: session compiled_in found | | PHP Module: xml compiled_in found | | Apache mod_php found | Répondre y pour le backend ndo2db et n pour les autres backend que nous n’utiliserons pas. | Checking Backends. (Available: mklivestatus,ndo2db,ido2db,merlinmy) | | Do you want to use backend mklivestatus? [y]: n | Do you want to use backend ndo2db? [n]: y | Do you want to use backend ido2db? [n]: n | Do you want to use backend merlinmy? [n]: n | /usr/local/nagios/bin/ndo2db-3x (ndo2db) found | | PHP Module: mysql 5.2 found | 7 | Graphviz 2.20 found | | Graphviz Module dot 2.20.2 found | | Graphviz Module neato 2.20.2 found | | Graphviz Module twopi 2.20.2 found | | Graphviz Module circo 2.20.2 found | | Graphviz Module fdp 2.20.2 found | | | +--- Trying to detect Apache settings ------------------------------------- ----+ | Please enter the web path to NagVis [/nagvis]: | Please enter the name of the web-server user [www-data]: | Please enter the name of the web-server group [www-data]: | create Apache config file [y]: y Configuration Apache, valider par défaut. | | +--- Checking for existing NagVis ----------------------------------------- ----+ | | +-------------------------------------------------------------------------- ----+ | Summary | +-------------------------------------------------------------------------- ----+ | NagVis home will be: /usr/local/nagvis | | Owner of NagVis files will be: www-data | | Group of NagVis files will be: www-data | | Path to Apache config dir is: /etc/apache2/conf.d | | Apache config will be created: yes | | | | Installation mode: install | | | | Do you really want to continue? [y]: y Répondre y pour réaliser l’installation. +-------------------------------------------------------------------------- ----+ | Starting installation | 8 +-------------------------------------------------------------------------- ----+ | Creating directory /usr/local/nagvis... done | | Creating directory /usr/local/nagvis/var... done | | Creating directory /usr/local/nagvis/var/tmpl/cache... done | | Creating directory /usr/local/nagvis/var/tmpl/compile... done | | Creating directory /usr/local/nagvis/share/var... done | | Copying files to /usr/local/nagvis... done | | Creating main configuration file... done | | setting backend to ndomy_1 done | | Creating web configuration file... done | | Setting permissions for web configuration file... done | | | | | | | +--- Setting permissions... ----------------------------------------------- ----+ | /usr/local/nagvis/etc/nagvis.ini.php-sample done | | /usr/local/nagvis/etc done | | /usr/local/nagvis/etc/maps done | | /usr/local/nagvis/etc/maps/* done | | /usr/local/nagvis/etc/automaps done | | /usr/local/nagvis/etc/automaps/* done | | /usr/local/nagvis/share/userfiles/images/maps done | | /usr/local/nagvis/share/userfiles/images/maps/* done | | /usr/local/nagvis/share/userfiles/images/shapes done | | /usr/local/nagvis/share/userfiles/images/shapes/* done | | /usr/local/nagvis/var done | | /usr/local/nagvis/var/* done | | /usr/local/nagvis/var/tmpl done | | /usr/local/nagvis/var/tmpl/cache done | | /usr/local/nagvis/var/tmpl/compile done | 9 | /usr/local/nagvis/share/var done | | | +-------------------------------------------------------------------------- ----+ | Installation complete | | | | You can safely remove this source directory. | | | | For later update/upgrade you may use this command to have a faster update: | | ./install.sh -n /usr/local/nagios -p /usr/local/nagvis -B /usr/local/nagios/bin/nagios -b ndo2db -u www-data -g www-data -w /etc/apache2/conf.d -a y | | | What to do next? | | - Read the documentation | | - Maybe you want to edit the main configuration file? | | uploads/s3/ comment-installer-nagios.pdf

  • 91
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager