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