NRPE » Historique » Version 21
Patrice Nadeau, 2017-07-27 16:51
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 | <pre><code class="bash"> |
||
34 | mkdir ~/tmp |
||
35 | cd ~/tmp |
||
36 | 19 | Patrice Nadeau | wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.0.tar.gz |
37 | 1 | Patrice Nadeau | # Décompresse le fichier |
38 | 19 | Patrice Nadeau | tar xvf nrpe-3.2.0.tar.gz |
39 | cd nrpe-nrpe-3.2.0 |
||
40 | 1 | Patrice Nadeau | </code></pre> |
41 | |||
42 | 2 | Patrice Nadeau | h2. check_nrpe |
43 | 1 | Patrice Nadeau | |
44 | 21 | Patrice Nadeau | Sur le serveur Nagios |
45 | |||
46 | 1 | Patrice Nadeau | <pre><code class="bash"> |
47 | # openSUSE |
||
48 | ./configure |
||
49 | 7 | Patrice Nadeau | # Debian/Ubuntu |
50 | 1 | Patrice Nadeau | ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf |
51 | # All Linux |
||
52 | make clean |
||
53 | make check_nrpe |
||
54 | make install-plugin |
||
55 | </code></pre> |
||
56 | |||
57 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
58 | |||
59 | <pre><code class="bash"> |
||
60 | 5 | Patrice Nadeau | # openSUSE |
61 | 1 | Patrice Nadeau | mkdir -p /usr/local/nagios/libexec |
62 | cp src/check_nrpe /usr/local/nagios/libexec |
||
63 | cp sample-config/nrpe.cfg /etc |
||
64 | 5 | Patrice Nadeau | # Debian/Ubuntu |
65 | 1 | Patrice Nadeau | sudo cp src/check_nrpe /usr/local/nagios/libexec |
66 | cp sample-config/nrpe.cfg /etc |
||
67 | </code></pre> |
||
68 | |||
69 | 2 | Patrice Nadeau | h2. nrpe |
70 | 1 | Patrice Nadeau | |
71 | 20 | Patrice Nadeau | Pour les machines « sous surveillance » |
72 | |||
73 | 1 | Patrice Nadeau | <pre><code class="bash"> |
74 | # openSUSE |
||
75 | 9 | Patrice Nadeau | ./configure --enable-command-args |
76 | 1 | Patrice Nadeau | # All Linux |
77 | make clean |
||
78 | make nrpe |
||
79 | make install-daemon |
||
80 | make install-config |
||
81 | make install-init |
||
82 | systemctl enable nrpe.service |
||
83 | systemctl start nrpe.service |
||
84 | </code></pre> |
||
85 | 15 | Patrice Nadeau | |
86 | Ouvrir dans le pare-feu (yast firewall) le port *TCP 5666* |
||
87 | 16 | Patrice Nadeau | |
88 | Éditer le fichier */etc/nrpe.cfg* et modifier les lignes suivantes : |
||
89 | <pre><code class="text"> |
||
90 | # Add Nagios server (IP or FQDN) |
||
91 | allowed_hosts=127.0.0.1,::1 |
||
92 | 17 | Patrice Nadeau | # Permit Remote execution |
93 | 16 | Patrice Nadeau | dont_blame_nrpe=1 |
94 | </code></pre> |