NRPE » Historique » Version 22
Patrice Nadeau, 2017-07-27 17:29
1 | 2 | Patrice Nadeau | h1. 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 | 8 | Patrice Nadeau | h2. Prérequis |
12 | |||
13 | <pre><code class="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 | 8 | Patrice Nadeau | </code></pre> |
20 | |||
21 | 14 | Patrice Nadeau | h2. Création de l'usager |
22 | |||
23 | <pre><code class="bash"> |
||
24 | useradd nagios |
||
25 | groupadd nagcmd |
||
26 | /usr/sbin/groupadd nagios |
||
27 | usermod -a -G nagcmd nagios |
||
28 | usermod -a -G nagios nagios |
||
29 | </code></pre> |
||
30 | |||
31 | 2 | Patrice Nadeau | h2. 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 | 1 | Patrice Nadeau | <pre><code class="bash"> |
36 | 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 | 1 | Patrice Nadeau | </code></pre> |
43 | |||
44 | 2 | Patrice Nadeau | h2. check_nrpe |
45 | 1 | Patrice Nadeau | |
46 | 21 | Patrice Nadeau | Sur le serveur Nagios |
47 | |||
48 | 1 | Patrice Nadeau | <pre><code class="bash"> |
49 | # 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 | </code></pre> |
||
58 | |||
59 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
60 | |||
61 | <pre><code class="bash"> |
||
62 | 5 | Patrice Nadeau | # openSUSE |
63 | 1 | Patrice Nadeau | mkdir -p /usr/local/nagios/libexec |
64 | cp src/check_nrpe /usr/local/nagios/libexec |
||
65 | cp sample-config/nrpe.cfg /etc |
||
66 | 5 | 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 | </code></pre> |
||
70 | |||
71 | 2 | Patrice Nadeau | h2. nrpe |
72 | 1 | Patrice Nadeau | |
73 | 20 | Patrice Nadeau | Pour les machines « sous surveillance » |
74 | |||
75 | 1 | Patrice Nadeau | <pre><code class="bash"> |
76 | # openSUSE |
||
77 | 9 | Patrice Nadeau | ./configure --enable-command-args |
78 | 1 | Patrice Nadeau | # All Linux |
79 | make clean |
||
80 | make nrpe |
||
81 | make install-daemon |
||
82 | make install-config |
||
83 | make install-init |
||
84 | systemctl enable nrpe.service |
||
85 | systemctl start nrpe.service |
||
86 | </code></pre> |
||
87 | 15 | Patrice Nadeau | |
88 | Ouvrir dans le pare-feu (yast firewall) le port *TCP 5666* |
||
89 | 16 | Patrice Nadeau | |
90 | Éditer le fichier */etc/nrpe.cfg* et modifier les lignes suivantes : |
||
91 | <pre><code class="text"> |
||
92 | # Add Nagios server (IP or FQDN) |
||
93 | allowed_hosts=127.0.0.1,::1 |
||
94 | 17 | Patrice Nadeau | # Permit Remote execution |
95 | 16 | Patrice Nadeau | dont_blame_nrpe=1 |
96 | </code></pre> |