Installation de NRPE à partir du tarball sur Ubuntu Server 8.04 LTS

Nagios Remote Plugin Executor est un plugin qui permet de faire exécuter des tests sur la machine à monitorer et de ne renvoyer que le résultat des tests, allégeant ainsi énormément la charge du réseau ainsi que de la machine hébergeant nagios.


NRPE Client

Création de l’utilisateur

/usr/sbin/useradd nagios
passwd nagios

Sécurisation de l’utilisateur

nano /etc/password

Passer /bin/bash à /bin/noshell

Installation des dépendances

apt-get install libssl-dev openssl build-essential xinetd

Installation des plugins nagios

wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/nagios-plugins-1.4.13.tar.gz
tar xzf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13/
./configure
make
make install

Rattrapage des Permissions

chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec

Installtion de NRPE remote

wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.12.tar.gz
tar xzf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd

Copie manuelle de check_nrpe

cp src/check_nrpe /usr/local/nagios/libexec/

Ajout NRPE du port du daemon

printf « nrpe\t\t5666/tcp\t\t# NRPE » >>/etc/services

Ajout NRPE IP Liste blanche (séparées par des virgules)

nano /etc/xinetd.d/nrpe

Rattrapage NRPE daemon init exec pour l’autorun

chmod +x /etc/xinetd.d/nrpe

Commande NRPE relance

/etc/init.d/xinetd restart

Commande de verification du daemon

netstat -at | grep nrpe

doit afficher

tcp 0 0 *:nrpe *:* LISTEN

Commande NRPE vérification

/usr/local/nagios/libexec/check_nrpe -H localhost

doit afficher

NRPE v2.12

Si il y a un timout, essayer

/usr/local/nagios/libexec/check_nrpe -n -H localhost

Sinon cela veut dire que la compilation s’est faite sans le support ssl

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

NRPE sur le serveur nagios

Installation des dépendances

apt-get install libssl-dev

Plugins NRPE Installation

wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.12.tar.gz
tar xzf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin

Test NRPE remote daemon

/usr/local/nagios/libexec/check_nrpe -H

Edition NRPE command.cfg

nano /usr/local/nagios/etc/objects/commands.cfg

Pour y ajouter

##########################################

# NRPE CHECK COMMAND

#

# Command to use NRPE to check remote host systems

##########################################

define command{

command_name check_nrpe

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}

Edition de la Config des remotes (privilégiez hostgroup_name à host_name)

nano /usr/local/nagios/etc/objects/linux-box-remote.cfg

Exemple type :

define host{

name linux-box-remote ; Name of this template

use generic-host ; Inherit default values

check_period 24×7

check_interval 5

retry_interval 1

max_check_attempts 10

check_command check-host-alive

notification_period 24×7

notification_interval 30

notification_options d,r

contact_groups admins

register 0 ; DONT REGISTER THIS – ITS A TEMPLATE

}

define host{

use linux-box-remote ; Inherit default values from a template

host_name testalfred ; The name we’re giving to this server

alias testalfred ; A longer name for the server

address 192.168.10.98 ; IP address of the server

}

define service{

use generic-service

host_name testalfred

service_description CPU Load

check_command check_nrpe!check_load

}

Rajout de la remote-box dans les templates

nano /usr/local/nagios/etc/nagios.cfg

Pour y ajouter

# Definitions for monitoring remote Linux machine

cfg_file=/usr/local/nagios/etc/objects/linux-box-remote.cfg

Et son application

/etc/init.d/nagios restart

Zephilou

Laisser un commentaire

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

Post comment