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