From source » Historique » Version 113
Patrice Nadeau, 2017-05-19 12:06
| 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 | 72 | Patrice Nadeau | |
| 26 | 1 | Patrice Nadeau | |
| 27 | 9 | Patrice Nadeau | h2. Création de l'usager et groupe |
| 28 | |||
| 29 | 37 | Patrice Nadeau | openSUSE : |
| 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 | 65 | Patrice Nadeau | usermod -a -G nagios wwwrun |
| 39 | 37 | Patrice Nadeau | </code></pre> |
| 40 | |||
| 41 | Debian/Ubuntu : |
||
| 42 | <pre><code class="bash"> |
||
| 43 | sudo useradd nagios |
||
| 44 | sudo groupadd nagcmd |
||
| 45 | 1 | Patrice Nadeau | sudo /usr/sbin/groupadd nagios |
| 46 | sudo usermod -a -G nagcmd nagios |
||
| 47 | sudo usermod -a -G nagios nagios |
||
| 48 | # Permet de soumettre des check via l'interface web |
||
| 49 | sudo usermod -a -G nagcmd www-data |
||
| 50 | sudo usermod -a -G nagios www-data |
||
| 51 | </code></pre> |
||
| 52 | |||
| 53 | h2. Nagios Core |
||
| 54 | |||
| 55 | 113 | Patrice Nadeau | > Les dernières versions sont disponibles au |
| 56 | * https://www.nagios.org/downloads/core-stay-informed/ |
||
| 57 | * https://www.nagios.org/downloads/nagios-plugins/ |
||
| 58 | |||
| 59 | h3. Télécharger |
||
| 60 | |||
| 61 | <pre><code class="bash"> |
||
| 62 | mkdir ~/tmp |
||
| 63 | cd ~/tmp |
||
| 64 | wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz |
||
| 65 | </code></pre> |
||
| 66 | |||
| 67 | 17 | Patrice Nadeau | h3. Compilation |
| 68 | 1 | Patrice Nadeau | |
| 69 | 9 | Patrice Nadeau | <pre><code class="bash"> |
| 70 | 112 | Patrice Nadeau | tar xvf nagios-4.3.2.tar.gz |
| 71 | cd ~/tmp/nagios-4.3.2 |
||
| 72 | 9 | Patrice Nadeau | ./configure --with-command-group=nagcmd |
| 73 | make all |
||
| 74 | 39 | Patrice Nadeau | </code></pre> |
| 75 | |||
| 76 | 76 | Patrice Nadeau | h3. Installation |
| 77 | 39 | Patrice Nadeau | |
| 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 | 77 | Patrice Nadeau | sudo make install-html |
| 84 | 97 | Patrice Nadeau | sudo make install-webconf |
| 85 | 3 | Patrice Nadeau | </code></pre> |
| 86 | 14 | Patrice Nadeau | |
| 87 | 19 | Patrice Nadeau | h3. Configuration de l'usager web |
| 88 | 14 | Patrice Nadeau | |
| 89 | 41 | Patrice Nadeau | openSUSE : |
| 90 | 14 | Patrice Nadeau | <pre><code class="bash"> |
| 91 | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
| 92 | 1 | Patrice Nadeau | systemctl restart apache2.service |
| 93 | </code></pre> |
||
| 94 | |||
| 95 | Ubuntu/Debian : |
||
| 96 | <pre><code class="bash"> |
||
| 97 | sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
| 98 | sudo systemctl restart apache2.service |
||
| 99 | </code></pre> |
||
| 100 | |||
| 101 | h2. Nagios Plugins |
||
| 102 | 113 | Patrice Nadeau | |
| 103 | > Les dernières versions sont disponibles au |
||
| 104 | * https://www.nagios.org/downloads/nagios-plugins/ |
||
| 105 | |||
| 106 | h3. Télécharger |
||
| 107 | |||
| 108 | <pre><code class="bash"> |
||
| 109 | mkdir ~/tmp |
||
| 110 | cd ~/tmp |
||
| 111 | wget https://nagios-plugins.org/download/nagios-plugins-2.1.4.tar.gz |
||
| 112 | </code></pre> |
||
| 113 | 22 | Patrice Nadeau | |
| 114 | h3. Compilation |
||
| 115 | |||
| 116 | <pre><code class="bash"> |
||
| 117 | 43 | Patrice Nadeau | cd ~/tmp |
| 118 | 94 | Patrice Nadeau | tar xvf nagios-plugins-2.1.4.tar.gz |
| 119 | cd nagios-plugins-2.1.4 |
||
| 120 | 1 | Patrice Nadeau | ./configure --with-nagios-user=nagios --with-nagios-group=nagios |
| 121 | 43 | Patrice Nadeau | make |
| 122 | sudo make install |
||
| 123 | 22 | Patrice Nadeau | </code></pre> |
| 124 | |||
| 125 | 55 | Patrice Nadeau | h2. Daemon |
| 126 | 1 | Patrice Nadeau | |
| 127 | 56 | Patrice Nadeau | openSUSE : |
| 128 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 129 | 86 | Patrice Nadeau | systemctl enable nagios.service |
| 130 | 1 | Patrice Nadeau | </code></pre> |
| 131 | |||
| 132 | 58 | Patrice Nadeau | Debian/Ubuntu : |
| 133 | 57 | Patrice Nadeau | > Ne semble pas nécessaire |
| 134 | |||
| 135 | 53 | Patrice Nadeau | h3. Vérification de la configurations |
| 136 | |||
| 137 | openSUSE: |
||
| 138 | 22 | Patrice Nadeau | <pre><code class="bash"> |
| 139 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
| 140 | 53 | Patrice Nadeau | </code></pre> |
| 141 | |||
| 142 | Debian/Ubuntu : |
||
| 143 | <pre><code class="bash"> |
||
| 144 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
| 145 | 22 | Patrice Nadeau | </code></pre> |
| 146 | 20 | Patrice Nadeau | |
| 147 | 55 | Patrice Nadeau | h3. Lancement du daemon |
| 148 | 54 | Patrice Nadeau | |
| 149 | openSUSE : |
||
| 150 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 151 | 86 | Patrice Nadeau | systemctl start nagios.service |
| 152 | 54 | Patrice Nadeau | </code></pre> |
| 153 | |||
| 154 | Debian/Ubuntu : |
||
| 155 | <pre><code class="bash"> |
||
| 156 | sudo systemctl start nagios3.service |
||
| 157 | 1 | Patrice Nadeau | </code></pre> |
| 158 | 28 | Patrice Nadeau | |
| 159 | La page est disponible à http://server.domain/nagios |