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