From source » Historique » Version 102
Patrice Nadeau, 2017-04-29 11:00
| 1 | 25 | Patrice Nadeau | h1. Installation à partir des sources |
|---|---|---|---|
| 2 | 1 | Patrice Nadeau | |
| 3 | 7 | Patrice Nadeau | L'installation à partir des sources permet |
| 4 | 1 | Patrice Nadeau | * d'avoir la version la plus récente |
| 5 | * n'est pas relier à une plate-forme spécifique (i686 vs x86_64 vs ARM) |
||
| 6 | 92 | Patrice Nadeau | |
| 7 | {{TOC}} |
||
| 8 | 6 | Patrice Nadeau | |
| 9 | 90 | Patrice Nadeau | h2. Outils et librairies de développement |
| 10 | 79 | 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 | 74 | Patrice Nadeau | > Les dernières versions sont disponibles au |
| 26 | * https://www.nagios.org/downloads/core-stay-informed/ |
||
| 27 | * https://www.nagios.org/downloads/nagios-plugins/ |
||
| 28 | 72 | Patrice Nadeau | |
| 29 | 2 | Patrice Nadeau | Télécharger |
| 30 | 1 | Patrice Nadeau | <pre><code class="bash"> |
| 31 | mkdir ~/tmp |
||
| 32 | cd ~/tmp |
||
| 33 | 91 | Patrice Nadeau | wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.1.tar.gz |
| 34 | wget https://nagios-plugins.org/download/nagios-plugins-2.1.4.tar.gz |
||
| 35 | 3 | Patrice Nadeau | </code></pre> |
| 36 | 1 | Patrice Nadeau | |
| 37 | 9 | Patrice Nadeau | h2. Création de l'usager et groupe |
| 38 | |||
| 39 | 37 | Patrice Nadeau | openSUSE : |
| 40 | 3 | Patrice Nadeau | <pre><code class="bash"> |
| 41 | useradd nagios |
||
| 42 | groupadd nagcmd |
||
| 43 | 11 | Patrice Nadeau | /usr/sbin/groupadd nagios |
| 44 | 1 | Patrice Nadeau | usermod -a -G nagcmd nagios |
| 45 | 11 | Patrice Nadeau | usermod -a -G nagios nagios |
| 46 | 24 | Patrice Nadeau | # Permet de soumettre des check via l'interface web |
| 47 | usermod -a -G nagcmd wwwrun |
||
| 48 | 65 | Patrice Nadeau | usermod -a -G nagios wwwrun |
| 49 | 37 | Patrice Nadeau | </code></pre> |
| 50 | |||
| 51 | Debian/Ubuntu : |
||
| 52 | <pre><code class="bash"> |
||
| 53 | sudo useradd nagios |
||
| 54 | sudo groupadd nagcmd |
||
| 55 | sudo /usr/sbin/groupadd nagios |
||
| 56 | sudo usermod -a -G nagcmd nagios |
||
| 57 | sudo usermod -a -G nagios nagios |
||
| 58 | # Permet de soumettre des check via l'interface web |
||
| 59 | 1 | Patrice Nadeau | sudo usermod -a -G nagcmd www-data |
| 60 | 65 | Patrice Nadeau | sudo usermod -a -G nagios www-data |
| 61 | 9 | Patrice Nadeau | </code></pre> |
| 62 | |||
| 63 | 17 | Patrice Nadeau | h2. Nagios Core |
| 64 | |||
| 65 | h3. Compilation |
||
| 66 | 1 | Patrice Nadeau | |
| 67 | 9 | Patrice Nadeau | <pre><code class="bash"> |
| 68 | 93 | Patrice Nadeau | tar xvf nagios-4.3.1.tar.gz |
| 69 | cd ~/tmp/nagios-4.3.1 |
||
| 70 | 9 | Patrice Nadeau | ./configure --with-command-group=nagcmd |
| 71 | make all |
||
| 72 | 39 | Patrice Nadeau | </code></pre> |
| 73 | |||
| 74 | 76 | Patrice Nadeau | h3. Installation |
| 75 | 39 | Patrice Nadeau | |
| 76 | <pre><code class="bash"> |
||
| 77 | sudo make install |
||
| 78 | sudo make install-init |
||
| 79 | sudo make install-commandmode |
||
| 80 | sudo make install-config |
||
| 81 | 77 | Patrice Nadeau | sudo make install-html |
| 82 | 97 | Patrice Nadeau | sudo make install-webconf |
| 83 | 3 | Patrice Nadeau | </code></pre> |
| 84 | 14 | Patrice Nadeau | |
| 85 | 19 | Patrice Nadeau | h3. Configuration de l'usager web |
| 86 | 14 | Patrice Nadeau | |
| 87 | 41 | Patrice Nadeau | openSUSE : |
| 88 | 14 | Patrice Nadeau | <pre><code class="bash"> |
| 89 | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
| 90 | 80 | Patrice Nadeau | systemctl restart apache2.service |
| 91 | 41 | Patrice Nadeau | </code></pre> |
| 92 | |||
| 93 | Ubuntu/Debian : |
||
| 94 | <pre><code class="bash"> |
||
| 95 | sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
| 96 | sudo systemctl restart apache2.service |
||
| 97 | 14 | Patrice Nadeau | </code></pre> |
| 98 | 16 | Patrice Nadeau | |
| 99 | 22 | Patrice Nadeau | h2. Nagios Plugins |
| 100 | |||
| 101 | h3. Compilation |
||
| 102 | |||
| 103 | <pre><code class="bash"> |
||
| 104 | 43 | Patrice Nadeau | cd ~/tmp |
| 105 | 94 | Patrice Nadeau | tar xvf nagios-plugins-2.1.4.tar.gz |
| 106 | cd nagios-plugins-2.1.4 |
||
| 107 | 1 | Patrice Nadeau | ./configure --with-nagios-user=nagios --with-nagios-group=nagios |
| 108 | 43 | Patrice Nadeau | make |
| 109 | sudo make install |
||
| 110 | 22 | Patrice Nadeau | </code></pre> |
| 111 | |||
| 112 | 26 | Patrice Nadeau | h2. Nagios Remote Plugin Executor |
| 113 | |||
| 114 | 83 | Patrice Nadeau | > https://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details |
| 115 | |||
| 116 | 29 | Patrice Nadeau | Ce « add-on » se divise en deux parties |
| 117 | 31 | Patrice Nadeau | * Le deamon _NRPE_ qui roule comme agent sur la machine sous surveillance |
| 118 | 33 | Patrice Nadeau | * Le « plugin » _nrpe_check_ qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes. |
| 119 | 1 | Patrice Nadeau | |
| 120 | 29 | Patrice Nadeau | h3. Téléchargement |
| 121 | |||
| 122 | 26 | Patrice Nadeau | <pre><code class="bash"> |
| 123 | 48 | Patrice Nadeau | mkdir ~/tmp |
| 124 | 1 | Patrice Nadeau | cd ~/tmp |
| 125 | 99 | Patrice Nadeau | wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.1.0.tar.gz |
| 126 | 50 | Patrice Nadeau | # Décompresse le fichier |
| 127 | 96 | Patrice Nadeau | tar xvf nrpe-3.1.0.tar.gz |
| 128 | 100 | Patrice Nadeau | cd nrpe-nrpe-3.1.0 |
| 129 | 26 | Patrice Nadeau | </code></pre> |
| 130 | 1 | Patrice Nadeau | |
| 131 | 29 | Patrice Nadeau | h3. Compilation |
| 132 | |||
| 133 | 50 | Patrice Nadeau | openSUSE : |
| 134 | 1 | Patrice Nadeau | <pre><code class="bash"> |
| 135 | ./configure |
||
| 136 | make all |
||
| 137 | </code></pre> |
||
| 138 | 50 | Patrice Nadeau | |
| 139 | 51 | Patrice Nadeau | Debian : |
| 140 | 50 | Patrice Nadeau | <pre><code class="bash"> |
| 141 | ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/arm-linux-gnueabihf |
||
| 142 | make all |
||
| 143 | </code></pre> |
||
| 144 | |||
| 145 | 31 | Patrice Nadeau | |
| 146 | h4. Installation |
||
| 147 | |||
| 148 | Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement. |
||
| 149 | |||
| 150 | 32 | Patrice Nadeau | h5. check_nrpe |
| 151 | |||
| 152 | 98 | Patrice Nadeau | > Seulement nécessaire sur le serveur Nagios |
| 153 | |||
| 154 | 52 | Patrice Nadeau | openSUSE: |
| 155 | 31 | Patrice Nadeau | <pre><code class="bash"> |
| 156 | 67 | Patrice Nadeau | mkdir -p /usr/local/nagios/libexec |
| 157 | 31 | Patrice Nadeau | cp src/check_nrpe /usr/local/nagios/libexec |
| 158 | 71 | Patrice Nadeau | cp sample-config/nrpe.cfg /etc |
| 159 | 52 | Patrice Nadeau | </code></pre> |
| 160 | |||
| 161 | Debian/Ubuntu : |
||
| 162 | <pre><code class="bash"> |
||
| 163 | sudo cp src/check_nrpe /usr/local/nagios/libexec |
||
| 164 | 71 | Patrice Nadeau | cp sample-config/nrpe.cfg /etc |
| 165 | 29 | Patrice Nadeau | </code></pre> |
| 166 | 32 | Patrice Nadeau | |
| 167 | h5. NRPE |
||
| 168 | |||
| 169 | 34 | Patrice Nadeau | Problème #31 |
| 170 | 26 | Patrice Nadeau | |
| 171 | 101 | Patrice Nadeau | <pre><code class="bash"> |
| 172 | mkdir ~/tmp |
||
| 173 | cd ~/tmp |
||
| 174 | wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.1.0.tar.gz |
||
| 175 | # Décompresse le fichier |
||
| 176 | tar xvf nrpe-3.1.0.tar.gz |
||
| 177 | cd nrpe-nrpe-3.1.0 |
||
| 178 | ./configure |
||
| 179 | make nrpe |
||
| 180 | make install-daemon |
||
| 181 | make install-config |
||
| 182 | make install-init |
||
| 183 | 102 | Patrice Nadeau | systemctl enable nrpe.service |
| 184 | systemctl start nrpe.service |
||
| 185 | 101 | Patrice Nadeau | </code></pre> |
| 186 | |||
| 187 | 55 | Patrice Nadeau | h2. Daemon |
| 188 | 1 | Patrice Nadeau | |
| 189 | 56 | Patrice Nadeau | openSUSE : |
| 190 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 191 | 86 | Patrice Nadeau | systemctl enable nagios.service |
| 192 | 1 | Patrice Nadeau | </code></pre> |
| 193 | |||
| 194 | 58 | Patrice Nadeau | Debian/Ubuntu : |
| 195 | 57 | Patrice Nadeau | > Ne semble pas nécessaire |
| 196 | |||
| 197 | 53 | Patrice Nadeau | h3. Vérification de la configurations |
| 198 | |||
| 199 | openSUSE: |
||
| 200 | 22 | Patrice Nadeau | <pre><code class="bash"> |
| 201 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
| 202 | 53 | Patrice Nadeau | </code></pre> |
| 203 | |||
| 204 | Debian/Ubuntu : |
||
| 205 | <pre><code class="bash"> |
||
| 206 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
| 207 | 22 | Patrice Nadeau | </code></pre> |
| 208 | 20 | Patrice Nadeau | |
| 209 | 55 | Patrice Nadeau | h3. Lancement du daemon |
| 210 | 54 | Patrice Nadeau | |
| 211 | openSUSE : |
||
| 212 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 213 | 86 | Patrice Nadeau | systemctl start nagios.service |
| 214 | 54 | Patrice Nadeau | </code></pre> |
| 215 | |||
| 216 | Debian/Ubuntu : |
||
| 217 | <pre><code class="bash"> |
||
| 218 | sudo systemctl start nagios3.service |
||
| 219 | 1 | Patrice Nadeau | </code></pre> |
| 220 | 28 | Patrice Nadeau | |
| 221 | La page est disponible à http://server.domain/nagios |