Projet

Général

Profil

Actions

NRPE » Historique » Révision 19

« Précédent | Révision 19/39 (diff) | Suivant »
Patrice Nadeau, 2017-07-27 16:46


h1. Nagios Remote Plugin Executor

https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details

Ce « add-on » se divise en deux parties

  • Le « plugin » check_nrpe qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes.
  • Le deamon nrpe qui roule comme agent sur la machine sous surveillance

{{TOC}}

h2. Prérequis


zypper install make gcc libopenssl-devel
# Remove if already installed with the OS
zypper remove nrpe
# Remove the one installed from source
/usr/local/nagios/bin/nrpe-uninstall all

h2. Création de l'usager


useradd nagios
groupadd nagcmd
/usr/sbin/groupadd nagios
usermod -a -G nagcmd nagios
usermod -a -G nagios nagios

h2. Téléchargement


mkdir ~/tmp
cd ~/tmp
wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.0.tar.gz
# Décompresse le fichier
tar xvf nrpe-3.2.0.tar.gz
cd nrpe-nrpe-3.2.0

h2. check_nrpe


# openSUSE
./configure
# Debian/Ubuntu
./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf
# All Linux
make clean
make check_nrpe
make install-plugin

Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement.


# openSUSE
mkdir -p /usr/local/nagios/libexec
cp src/check_nrpe /usr/local/nagios/libexec
cp sample-config/nrpe.cfg /etc
# Debian/Ubuntu
sudo cp src/check_nrpe /usr/local/nagios/libexec
cp sample-config/nrpe.cfg /etc

h2. nrpe


# openSUSE
./configure --enable-command-args
# All Linux
make clean
make nrpe
make install-daemon
make install-config
make install-init
systemctl enable nrpe.service
systemctl start nrpe.service

Ouvrir dans le pare-feu (yast firewall) le port TCP 5666

Éditer le fichier /etc/nrpe.cfg et modifier les lignes suivantes :


# Add Nagios server (IP or FQDN)
allowed_hosts=127.0.0.1,::1
# Permit Remote execution
dont_blame_nrpe=1

Mis à jour par Patrice Nadeau il y a plus de 7 ans · 19 révisions