NRPE » Historique » Version 36
Patrice Nadeau, 2018-08-17 14:36
| 1 | 26 | Patrice Nadeau | # Nagios Remote Plugin Executor |
|---|---|---|---|
| 2 | 1 | Patrice Nadeau | |
| 3 | > https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details |
||
| 4 | |||
| 5 | Ce « add-on » se divise en deux parties |
||
| 6 | * Le « plugin » _check_nrpe_ qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes. |
||
| 7 | * Le deamon _nrpe_ qui roule comme agent sur la machine sous surveillance |
||
| 8 | |||
| 9 | 4 | Patrice Nadeau | {{TOC}} |
| 10 | 3 | Patrice Nadeau | |
| 11 | 26 | Patrice Nadeau | ## Prérequis |
| 12 | 8 | Patrice Nadeau | |
| 13 | 26 | Patrice Nadeau | ```bash |
| 14 | 12 | Patrice Nadeau | zypper install make gcc libopenssl-devel |
| 15 | 10 | Patrice Nadeau | # Remove if already installed with the OS |
| 16 | zypper remove nrpe |
||
| 17 | 13 | Patrice Nadeau | # Remove the one installed from source |
| 18 | 18 | Patrice Nadeau | /usr/local/nagios/bin/nrpe-uninstall all |
| 19 | 26 | Patrice Nadeau | ``` |
| 20 | 8 | Patrice Nadeau | |
| 21 | 26 | Patrice Nadeau | ## Création de l'usager |
| 22 | 14 | Patrice Nadeau | |
| 23 | 26 | Patrice Nadeau | ```bash |
| 24 | 14 | Patrice Nadeau | useradd nagios |
| 25 | groupadd nagcmd |
||
| 26 | /usr/sbin/groupadd nagios |
||
| 27 | usermod -a -G nagcmd nagios |
||
| 28 | usermod -a -G nagios nagios |
||
| 29 | 26 | Patrice Nadeau | ``` |
| 30 | 14 | Patrice Nadeau | |
| 31 | 26 | Patrice Nadeau | ## Téléchargement |
| 32 | 1 | Patrice Nadeau | |
| 33 | 22 | Patrice Nadeau | > Bogue avec la version 3.2.0 : https://github.com/NagiosEnterprises/nrpe/issues/148 |
| 34 | |||
| 35 | 26 | Patrice Nadeau | ```bash |
| 36 | 1 | Patrice Nadeau | mkdir ~/tmp |
| 37 | cd ~/tmp |
||
| 38 | 19 | Patrice Nadeau | wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.0.tar.gz |
| 39 | 1 | Patrice Nadeau | # Décompresse le fichier |
| 40 | 19 | Patrice Nadeau | tar xvf nrpe-3.2.0.tar.gz |
| 41 | cd nrpe-nrpe-3.2.0 |
||
| 42 | 26 | Patrice Nadeau | ``` |
| 43 | 1 | Patrice Nadeau | |
| 44 | 35 | Patrice Nadeau | ```bash |
| 45 | wget https://github.com/NagiosEnterprises/nrpe/archive/master.zip |
||
| 46 | unzip master.zip |
||
| 47 | cd nrpe-master |
||
| 48 | ``` |
||
| 49 | |||
| 50 | 26 | Patrice Nadeau | ## check_nrpe |
| 51 | 1 | Patrice Nadeau | |
| 52 | 21 | Patrice Nadeau | Sur le serveur Nagios |
| 53 | |||
| 54 | 26 | Patrice Nadeau | ```bash |
| 55 | 1 | Patrice Nadeau | # openSUSE |
| 56 | ./configure |
||
| 57 | 7 | Patrice Nadeau | # Debian/Ubuntu |
| 58 | 1 | Patrice Nadeau | ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf |
| 59 | # All Linux |
||
| 60 | make clean |
||
| 61 | make check_nrpe |
||
| 62 | make install-plugin |
||
| 63 | 26 | Patrice Nadeau | ``` |
| 64 | 1 | Patrice Nadeau | |
| 65 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
| 66 | |||
| 67 | 27 | Patrice Nadeau | ```bash |
| 68 | 29 | Patrice Nadeau | # openSUSE |
| 69 | 27 | Patrice Nadeau | mkdir -p /usr/local/nagios/libexec |
| 70 | 1 | Patrice Nadeau | cp src/check_nrpe /usr/local/nagios/libexec |
| 71 | 27 | Patrice Nadeau | cp sample-config/nrpe.cfg /etc |
| 72 | 29 | Patrice Nadeau | # Debian/Ubuntu |
| 73 | 1 | Patrice Nadeau | sudo cp src/check_nrpe /usr/local/nagios/libexec |
| 74 | cp sample-config/nrpe.cfg /etc |
||
| 75 | 29 | Patrice Nadeau | ``` |
| 76 | 1 | Patrice Nadeau | |
| 77 | 28 | Patrice Nadeau | ## nrpe |
| 78 | 1 | Patrice Nadeau | |
| 79 | 20 | Patrice Nadeau | Pour les machines « sous surveillance » |
| 80 | 1 | Patrice Nadeau | |
| 81 | 31 | Patrice Nadeau | ```bash |
| 82 | 1 | Patrice Nadeau | # openSUSE |
| 83 | 9 | Patrice Nadeau | ./configure --enable-command-args |
| 84 | 1 | Patrice Nadeau | # All Linux |
| 85 | make clean |
||
| 86 | make nrpe |
||
| 87 | make install-daemon |
||
| 88 | make install-config |
||
| 89 | make install-init |
||
| 90 | systemctl enable nrpe.service |
||
| 91 | systemctl start nrpe.service |
||
| 92 | 30 | Patrice Nadeau | ``` |
| 93 | 15 | Patrice Nadeau | |
| 94 | Ouvrir dans le pare-feu (yast firewall) le port *TCP 5666* |
||
| 95 | 16 | Patrice Nadeau | |
| 96 | 36 | Patrice Nadeau | ```bash |
| 97 | firewall-cmd --permanent --add-service=nrpe |
||
| 98 | firewall-cmd --reload |
||
| 99 | ``` |
||
| 100 | |||
| 101 | 23 | Patrice Nadeau | Éditer le fichier */usr/local/nagios/etc/nrpe.cfg* et modifier les lignes suivantes : |
| 102 | 33 | Patrice Nadeau | |
| 103 | ```text |
||
| 104 | 16 | Patrice Nadeau | # Add Nagios server (IP or FQDN) |
| 105 | 24 | Patrice Nadeau | allowed_hosts=127.0.0.1,::1,nagios.fqdn |
| 106 | 32 | Patrice Nadeau | ``` |
| 107 | 25 | Patrice Nadeau | |
| 108 | Ce fichier contient aussi les items à vérifier ainsi que leurs paramètres. |