NRPE » Historique » Version 31
Patrice Nadeau, 2018-08-17 14:25
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 | 26 | Patrice Nadeau | ## check_nrpe |
45 | 1 | Patrice Nadeau | |
46 | 21 | Patrice Nadeau | Sur le serveur Nagios |
47 | |||
48 | 26 | Patrice Nadeau | ```bash |
49 | 1 | Patrice Nadeau | # openSUSE |
50 | ./configure |
||
51 | 7 | Patrice Nadeau | # Debian/Ubuntu |
52 | 1 | Patrice Nadeau | ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf |
53 | # All Linux |
||
54 | make clean |
||
55 | make check_nrpe |
||
56 | make install-plugin |
||
57 | 26 | Patrice Nadeau | ``` |
58 | 1 | Patrice Nadeau | |
59 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
60 | |||
61 | 27 | Patrice Nadeau | ```bash |
62 | 29 | Patrice Nadeau | # openSUSE |
63 | 27 | Patrice Nadeau | mkdir -p /usr/local/nagios/libexec |
64 | 1 | Patrice Nadeau | cp src/check_nrpe /usr/local/nagios/libexec |
65 | 27 | Patrice Nadeau | cp sample-config/nrpe.cfg /etc |
66 | 29 | Patrice Nadeau | # Debian/Ubuntu |
67 | 1 | Patrice Nadeau | sudo cp src/check_nrpe /usr/local/nagios/libexec |
68 | cp sample-config/nrpe.cfg /etc |
||
69 | 29 | Patrice Nadeau | ``` |
70 | 1 | Patrice Nadeau | |
71 | 28 | Patrice Nadeau | ## nrpe |
72 | 1 | Patrice Nadeau | |
73 | 20 | Patrice Nadeau | Pour les machines « sous surveillance » |
74 | 1 | Patrice Nadeau | |
75 | 31 | Patrice Nadeau | ```bash |
76 | 28 | Patrice Nadeau | |
77 | 1 | Patrice Nadeau | # openSUSE |
78 | 9 | Patrice Nadeau | ./configure --enable-command-args |
79 | 30 | Patrice Nadeau | |
80 | 1 | Patrice Nadeau | # All Linux |
81 | make clean |
||
82 | make nrpe |
||
83 | make install-daemon |
||
84 | make install-config |
||
85 | make install-init |
||
86 | systemctl enable nrpe.service |
||
87 | systemctl start nrpe.service |
||
88 | 30 | Patrice Nadeau | ``` |
89 | 15 | Patrice Nadeau | |
90 | Ouvrir dans le pare-feu (yast firewall) le port *TCP 5666* |
||
91 | 16 | Patrice Nadeau | |
92 | 23 | Patrice Nadeau | Éditer le fichier */usr/local/nagios/etc/nrpe.cfg* et modifier les lignes suivantes : |
93 | 1 | Patrice Nadeau | <pre><code class="text"> |
94 | 30 | Patrice Nadeau | |
95 | 16 | Patrice Nadeau | # Add Nagios server (IP or FQDN) |
96 | 24 | Patrice Nadeau | allowed_hosts=127.0.0.1,::1,nagios.fqdn |
97 | 16 | Patrice Nadeau | </code></pre> |
98 | 25 | Patrice Nadeau | |
99 | Ce fichier contient aussi les items à vérifier ainsi que leurs paramètres. |