From source » Historique » Version 31
Patrice Nadeau, 2015-01-03 10:42
| 1 | 18 | Patrice Nadeau | {{TOC}} |
|---|---|---|---|
| 2 | |||
| 3 | 25 | Patrice Nadeau | h1. Installation à partir des sources |
| 4 | 1 | Patrice Nadeau | |
| 5 | 7 | Patrice Nadeau | L'installation à partir des sources permet |
| 6 | 6 | Patrice Nadeau | * d'avoir la version la plus récente |
| 7 | * n'est pas relier à une plate-forme spécifique (i686 vs x86_64 vs ARM) |
||
| 8 | |||
| 9 | 10 | Patrice Nadeau | Les test ont été fait à partir d'un BeagleBone Black sous openSUSE 13.2. |
| 10 | 8 | Patrice Nadeau | |
| 11 | 4 | Patrice Nadeau | h2. Prérequis |
| 12 | 1 | Patrice Nadeau | |
| 13 | 6 | Patrice Nadeau | Installer les utilitaires pour la compilation : |
| 14 | 5 | Patrice Nadeau | <pre><code class="bash"> |
| 15 | zypper install make gcc |
||
| 16 | </code></pre> |
||
| 17 | 4 | Patrice Nadeau | |
| 18 | 9 | Patrice Nadeau | h2. Fichiers |
| 19 | |||
| 20 | 2 | Patrice Nadeau | Télécharger |
| 21 | 1 | Patrice Nadeau | <pre><code class="bash"> |
| 22 | 21 | Patrice Nadeau | mkdir ~/tmp |
| 23 | cd ~/tmp |
||
| 24 | 1 | Patrice Nadeau | wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz |
| 25 | wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz |
||
| 26 | 3 | Patrice Nadeau | </code></pre> |
| 27 | 1 | Patrice Nadeau | |
| 28 | 9 | Patrice Nadeau | h2. Création de l'usager et groupe |
| 29 | |||
| 30 | 3 | Patrice Nadeau | <pre><code class="bash"> |
| 31 | useradd nagios |
||
| 32 | groupadd nagcmd |
||
| 33 | 11 | Patrice Nadeau | /usr/sbin/groupadd nagios |
| 34 | 1 | Patrice Nadeau | usermod -a -G nagcmd nagios |
| 35 | 11 | Patrice Nadeau | usermod -a -G nagios nagios |
| 36 | 24 | Patrice Nadeau | # Permet de soumettre des check via l'interface web |
| 37 | usermod -a -G nagcmd wwwrun |
||
| 38 | 9 | Patrice Nadeau | </code></pre> |
| 39 | |||
| 40 | 17 | Patrice Nadeau | h2. Nagios Core |
| 41 | |||
| 42 | h3. Compilation |
||
| 43 | 1 | Patrice Nadeau | |
| 44 | 9 | Patrice Nadeau | <pre><code class="bash"> |
| 45 | 21 | Patrice Nadeau | cd ~/tmp/nagios-4.0.8 |
| 46 | 9 | Patrice Nadeau | ./configure --with-command-group=nagcmd |
| 47 | make all |
||
| 48 | 12 | Patrice Nadeau | make install |
| 49 | make install-init |
||
| 50 | make install-commandmode |
||
| 51 | make install-config |
||
| 52 | 13 | Patrice Nadeau | make install-webconf |
| 53 | 3 | Patrice Nadeau | </code></pre> |
| 54 | 14 | Patrice Nadeau | |
| 55 | 19 | Patrice Nadeau | h3. Configuration de l'usager web |
| 56 | 14 | Patrice Nadeau | |
| 57 | <pre><code class="bash"> |
||
| 58 | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
| 59 | 15 | Patrice Nadeau | systemctl restart apache2 |
| 60 | 14 | Patrice Nadeau | </code></pre> |
| 61 | 16 | Patrice Nadeau | |
| 62 | 22 | Patrice Nadeau | h2. Nagios Plugins |
| 63 | |||
| 64 | h3. Compilation |
||
| 65 | |||
| 66 | <pre><code class="bash"> |
||
| 67 | cd ~/tmp/nagios-plugin |
||
| 68 | ./configure --with-nagios-user=nagios --with-nagios-group=nagios |
||
| 69 | make |
||
| 70 | make install |
||
| 71 | </code></pre> |
||
| 72 | |||
| 73 | 26 | Patrice Nadeau | h2. Nagios Remote Plugin Executor |
| 74 | |||
| 75 | 29 | Patrice Nadeau | Ce « add-on » se divise en deux parties |
| 76 | 31 | Patrice Nadeau | * Le deamon _NRPE_ qui roule comme agent sur la machine sous surveillance |
| 77 | * Le « plugin » _nrpc_check_ qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes. |
||
| 78 | 1 | Patrice Nadeau | |
| 79 | 29 | Patrice Nadeau | h3. Téléchargement |
| 80 | |||
| 81 | 26 | Patrice Nadeau | <pre><code class="bash"> |
| 82 | http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz |
||
| 83 | </code></pre> |
||
| 84 | 1 | Patrice Nadeau | |
| 85 | h3. Compilation |
||
| 86 | 29 | Patrice Nadeau | |
| 87 | <pre><code class="bash"> |
||
| 88 | # Installe les librairies de développement SSL |
||
| 89 | 30 | Patrice Nadeau | zypper install libopenssl-devel |
| 90 | 29 | Patrice Nadeau | # Décompresse le fichier |
| 91 | tar xvf nrpe-2.15.tar.gz |
||
| 92 | cd nrpe-2.15 |
||
| 93 | 1 | Patrice Nadeau | # lance la compilation |
| 94 | ./configure |
||
| 95 | make all |
||
| 96 | 31 | Patrice Nadeau | </code></pre> |
| 97 | |||
| 98 | h4. Installation |
||
| 99 | |||
| 100 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
| 101 | |||
| 102 | <pre><code class="bash"> |
||
| 103 | cp src/check_nrpe /usr/local/nagios/libexec |
||
| 104 | 29 | Patrice Nadeau | </code></pre> |
| 105 | 26 | Patrice Nadeau | |
| 106 | 23 | Patrice Nadeau | h2. Services |
| 107 | 1 | Patrice Nadeau | |
| 108 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 109 | systemctl enable nagios |
||
| 110 | 1 | Patrice Nadeau | </code></pre> |
| 111 | |||
| 112 | 22 | Patrice Nadeau | Vérifier si les fichiers de configurations sont bon |
| 113 | <pre><code class="bash"> |
||
| 114 | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
| 115 | </code></pre> |
||
| 116 | 20 | Patrice Nadeau | |
| 117 | 22 | Patrice Nadeau | Lancer Nagios |
| 118 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 119 | 22 | Patrice Nadeau | systemctl start nagios |
| 120 | 1 | Patrice Nadeau | </code></pre> |
| 121 | 28 | Patrice Nadeau | |
| 122 | La page est disponible à http://server.domain/nagios |