From source » Historique » Version 112
Patrice Nadeau, 2017-05-19 10:12
| 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 | 111 | Patrice Nadeau | wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz |
| 34 | 91 | Patrice Nadeau | 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 | 112 | Patrice Nadeau | tar xvf nagios-4.3.2.tar.gz |
| 69 | cd ~/tmp/nagios-4.3.2 |
||
| 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 | 55 | Patrice Nadeau | h2. Daemon |
| 113 | 1 | Patrice Nadeau | |
| 114 | 56 | Patrice Nadeau | openSUSE : |
| 115 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 116 | 86 | Patrice Nadeau | systemctl enable nagios.service |
| 117 | 1 | Patrice Nadeau | </code></pre> |
| 118 | |||
| 119 | 58 | Patrice Nadeau | Debian/Ubuntu : |
| 120 | 57 | Patrice Nadeau | > Ne semble pas nécessaire |
| 121 | |||
| 122 | 53 | Patrice Nadeau | h3. Vérification de la configurations |
| 123 | |||
| 124 | openSUSE: |
||
| 125 | 22 | Patrice Nadeau | <pre><code class="bash"> |
| 126 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
| 127 | 53 | Patrice Nadeau | </code></pre> |
| 128 | |||
| 129 | Debian/Ubuntu : |
||
| 130 | <pre><code class="bash"> |
||
| 131 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
| 132 | 22 | Patrice Nadeau | </code></pre> |
| 133 | 20 | Patrice Nadeau | |
| 134 | 55 | Patrice Nadeau | h3. Lancement du daemon |
| 135 | 54 | Patrice Nadeau | |
| 136 | openSUSE : |
||
| 137 | 20 | Patrice Nadeau | <pre><code class="bash"> |
| 138 | 86 | Patrice Nadeau | systemctl start nagios.service |
| 139 | 54 | Patrice Nadeau | </code></pre> |
| 140 | |||
| 141 | Debian/Ubuntu : |
||
| 142 | <pre><code class="bash"> |
||
| 143 | sudo systemctl start nagios3.service |
||
| 144 | 1 | Patrice Nadeau | </code></pre> |
| 145 | 28 | Patrice Nadeau | |
| 146 | La page est disponible à http://server.domain/nagios |