From source » Historique » Version 62
  Patrice Nadeau, 2015-02-08 21:33 
  
| 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 | 4 | Patrice Nadeau | h2. Prérequis  | 
| 10 | 1 | Patrice Nadeau | |
| 11 | 45 | Patrice Nadeau | Installer les utilitaires pour la compilation et la librairie de développement SSL:  | 
| 12 | 35 | Patrice Nadeau | |
| 13 | openSUSE :  | 
||
| 14 | 5 | Patrice Nadeau | <pre><code class="bash">  | 
| 15 | 45 | Patrice Nadeau | zypper install make gcc libopenssl-devel  | 
| 16 | 35 | Patrice Nadeau | </code></pre>  | 
| 17 | |||
| 18 | 36 | Patrice Nadeau | Ubuntu/Debian :  | 
| 19 | 35 | Patrice Nadeau | <pre><code class="bash">  | 
| 20 | 47 | Patrice Nadeau | sudo apt-get install make gcc libssl-dev  | 
| 21 | 5 | Patrice Nadeau | </code></pre>  | 
| 22 | 4 | Patrice Nadeau | |
| 23 | 9 | Patrice Nadeau | h2. Fichiers  | 
| 24 | |||
| 25 | 2 | Patrice Nadeau | Télécharger  | 
| 26 | 1 | Patrice Nadeau | <pre><code class="bash">  | 
| 27 | 21 | Patrice Nadeau | mkdir ~/tmp  | 
| 28 | cd ~/tmp  | 
||
| 29 | 1 | Patrice Nadeau | wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz  | 
| 30 | wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz  | 
||
| 31 | 3 | Patrice Nadeau | </code></pre>  | 
| 32 | 1 | Patrice Nadeau | |
| 33 | 9 | Patrice Nadeau | h2. Création de l'usager et groupe  | 
| 34 | |||
| 35 | 37 | Patrice Nadeau | openSUSE :  | 
| 36 | 3 | Patrice Nadeau | <pre><code class="bash">  | 
| 37 | useradd nagios  | 
||
| 38 | groupadd nagcmd  | 
||
| 39 | 11 | Patrice Nadeau | /usr/sbin/groupadd nagios  | 
| 40 | 1 | Patrice Nadeau | usermod -a -G nagcmd nagios  | 
| 41 | 11 | Patrice Nadeau | usermod -a -G nagios nagios  | 
| 42 | 24 | Patrice Nadeau | # Permet de soumettre des check via l'interface web  | 
| 43 | usermod -a -G nagcmd wwwrun  | 
||
| 44 | 37 | Patrice Nadeau | </code></pre>  | 
| 45 | |||
| 46 | Debian/Ubuntu :  | 
||
| 47 | <pre><code class="bash">  | 
||
| 48 | sudo useradd nagios  | 
||
| 49 | sudo groupadd nagcmd  | 
||
| 50 | sudo /usr/sbin/groupadd nagios  | 
||
| 51 | sudo usermod -a -G nagcmd nagios  | 
||
| 52 | sudo usermod -a -G nagios nagios  | 
||
| 53 | # Permet de soumettre des check via l'interface web  | 
||
| 54 | sudo usermod -a -G nagcmd www-data  | 
||
| 55 | 9 | Patrice Nadeau | </code></pre>  | 
| 56 | |||
| 57 | 17 | Patrice Nadeau | h2. Nagios Core  | 
| 58 | |||
| 59 | h3. Compilation  | 
||
| 60 | 1 | Patrice Nadeau | |
| 61 | 9 | Patrice Nadeau | <pre><code class="bash">  | 
| 62 | 38 | Patrice Nadeau | tar xvf nagios-4.0.8.tar.gz  | 
| 63 | 21 | Patrice Nadeau | cd ~/tmp/nagios-4.0.8  | 
| 64 | 9 | Patrice Nadeau | ./configure --with-command-group=nagcmd  | 
| 65 | make all  | 
||
| 66 | 39 | Patrice Nadeau | </code></pre>  | 
| 67 | |||
| 68 | openSUSE :  | 
||
| 69 | <pre><code class="bash">  | 
||
| 70 | 12 | Patrice Nadeau | make install  | 
| 71 | make install-init  | 
||
| 72 | make install-commandmode  | 
||
| 73 | make install-config  | 
||
| 74 | 13 | Patrice Nadeau | make install-webconf  | 
| 75 | 39 | Patrice Nadeau | </code></pre>  | 
| 76 | |||
| 77 | Debian/Ubuntu :  | 
||
| 78 | <pre><code class="bash">  | 
||
| 79 | sudo make install  | 
||
| 80 | sudo make install-init  | 
||
| 81 | sudo make install-commandmode  | 
||
| 82 | sudo make install-config  | 
||
| 83 | sudo make install-webconf  | 
||
| 84 | 3 | Patrice Nadeau | </code></pre>  | 
| 85 | 14 | Patrice Nadeau | |
| 86 | 19 | Patrice Nadeau | h3. Configuration de l'usager web  | 
| 87 | 14 | Patrice Nadeau | |
| 88 | 41 | Patrice Nadeau | openSUSE :  | 
| 89 | 14 | Patrice Nadeau | <pre><code class="bash">  | 
| 90 | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin  | 
||
| 91 | 15 | Patrice Nadeau | systemctl restart apache2  | 
| 92 | 41 | Patrice Nadeau | </code></pre>  | 
| 93 | |||
| 94 | Ubuntu/Debian :  | 
||
| 95 | <pre><code class="bash">  | 
||
| 96 | sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin  | 
||
| 97 | sudo systemctl restart apache2.service  | 
||
| 98 | 14 | Patrice Nadeau | </code></pre>  | 
| 99 | 16 | Patrice Nadeau | |
| 100 | 22 | Patrice Nadeau | h2. Nagios Plugins  | 
| 101 | |||
| 102 | h3. Compilation  | 
||
| 103 | |||
| 104 | <pre><code class="bash">  | 
||
| 105 | 43 | Patrice Nadeau | cd ~/tmp  | 
| 106 | 1 | Patrice Nadeau | tar xvf nagios-plugins-2.0.3.tar.gz  | 
| 107 | 43 | Patrice Nadeau | cd /nagios-plugin-2.0.3  | 
| 108 | 22 | Patrice Nadeau | ./configure --with-nagios-user=nagios --with-nagios-group=nagios  | 
| 109 | 1 | Patrice Nadeau | make  | 
| 110 | 43 | Patrice Nadeau | # openSUSE  | 
| 111 | 1 | Patrice Nadeau | make install  | 
| 112 | 43 | Patrice Nadeau | # Debian/Ubuntu  | 
| 113 | sudo make install  | 
||
| 114 | 22 | Patrice Nadeau | </code></pre>  | 
| 115 | |||
| 116 | 26 | Patrice Nadeau | h2. Nagios Remote Plugin Executor  | 
| 117 | |||
| 118 | 29 | Patrice Nadeau | Ce « add-on » se divise en deux parties  | 
| 119 | 31 | Patrice Nadeau | * Le deamon _NRPE_ qui roule comme agent sur la machine sous surveillance  | 
| 120 | 33 | Patrice Nadeau | * Le « plugin » _nrpe_check_ qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes.  | 
| 121 | 1 | Patrice Nadeau | |
| 122 | 29 | Patrice Nadeau | h3. Téléchargement  | 
| 123 | |||
| 124 | 26 | Patrice Nadeau | <pre><code class="bash">  | 
| 125 | 48 | Patrice Nadeau | cd ~/tmp  | 
| 126 | 44 | Patrice Nadeau | wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz  | 
| 127 | 50 | Patrice Nadeau | # Décompresse le fichier  | 
| 128 | tar xvf nrpe-2.15.tar.gz  | 
||
| 129 | cd nrpe-2.15  | 
||
| 130 | 26 | Patrice Nadeau | </code></pre>  | 
| 131 | 1 | Patrice Nadeau | |
| 132 | 29 | Patrice Nadeau | h3. Compilation  | 
| 133 | |||
| 134 | 50 | Patrice Nadeau | openSUSE :  | 
| 135 | 1 | Patrice Nadeau | <pre><code class="bash">  | 
| 136 | ./configure  | 
||
| 137 | make all  | 
||
| 138 | </code></pre>  | 
||
| 139 | 50 | Patrice Nadeau | |
| 140 | 51 | Patrice Nadeau | Debian :  | 
| 141 | 50 | Patrice Nadeau | <pre><code class="bash">  | 
| 142 | ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf  | 
||
| 143 | make all  | 
||
| 144 | </code></pre>  | 
||
| 145 | |||
| 146 | 31 | Patrice Nadeau | |
| 147 | h4. Installation  | 
||
| 148 | |||
| 149 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement.  | 
||
| 150 | |||
| 151 | 32 | Patrice Nadeau | h5. check_nrpe  | 
| 152 | |||
| 153 | 52 | Patrice Nadeau | openSUSE:  | 
| 154 | 31 | Patrice Nadeau | <pre><code class="bash">  | 
| 155 | cp src/check_nrpe /usr/local/nagios/libexec  | 
||
| 156 | 52 | Patrice Nadeau | </code></pre>  | 
| 157 | |||
| 158 | Debian/Ubuntu :  | 
||
| 159 | <pre><code class="bash">  | 
||
| 160 | sudo cp src/check_nrpe /usr/local/nagios/libexec  | 
||
| 161 | 29 | Patrice Nadeau | </code></pre>  | 
| 162 | 32 | Patrice Nadeau | |
| 163 | h5. NRPE  | 
||
| 164 | |||
| 165 | 34 | Patrice Nadeau | Problème #31  | 
| 166 | 26 | Patrice Nadeau | |
| 167 | 55 | Patrice Nadeau | h2. Daemon  | 
| 168 | 1 | Patrice Nadeau | |
| 169 | 56 | Patrice Nadeau | openSUSE :  | 
| 170 | 20 | Patrice Nadeau | <pre><code class="bash">  | 
| 171 | systemctl enable nagios  | 
||
| 172 | 1 | Patrice Nadeau | </code></pre>  | 
| 173 | |||
| 174 | 58 | Patrice Nadeau | Debian/Ubuntu :  | 
| 175 | 57 | Patrice Nadeau | > Ne semble pas nécessaire  | 
| 176 | |||
| 177 | 53 | Patrice Nadeau | h3. Vérification de la configurations  | 
| 178 | |||
| 179 | openSUSE:  | 
||
| 180 | 22 | Patrice Nadeau | <pre><code class="bash">  | 
| 181 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  | 
| 182 | 53 | Patrice Nadeau | </code></pre>  | 
| 183 | |||
| 184 | Debian/Ubuntu :  | 
||
| 185 | <pre><code class="bash">  | 
||
| 186 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  | 
||
| 187 | 22 | Patrice Nadeau | </code></pre>  | 
| 188 | 20 | Patrice Nadeau | |
| 189 | 55 | Patrice Nadeau | h3. Lancement du daemon  | 
| 190 | 54 | Patrice Nadeau | |
| 191 | openSUSE :  | 
||
| 192 | 20 | Patrice Nadeau | <pre><code class="bash">  | 
| 193 | 22 | Patrice Nadeau | systemctl start nagios  | 
| 194 | 54 | Patrice Nadeau | </code></pre>  | 
| 195 | |||
| 196 | Debian/Ubuntu :  | 
||
| 197 | <pre><code class="bash">  | 
||
| 198 | sudo systemctl start nagios3.service  | 
||
| 199 | 1 | Patrice Nadeau | </code></pre>  | 
| 200 | 28 | Patrice Nadeau | |
| 201 | La page est disponible à http://server.domain/nagios  |