From source » Historique » Version 120
Patrice Nadeau, 2017-07-27 18:35
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 | 119 | Patrice Nadeau | Pour le serveur |
52 | |||
53 | 113 | Patrice Nadeau | > Les dernières versions sont disponibles au |
54 | * https://www.nagios.org/downloads/core-stay-informed/ |
||
55 | |||
56 | h3. Télécharger |
||
57 | |||
58 | <pre><code class="bash"> |
||
59 | mkdir ~/tmp |
||
60 | cd ~/tmp |
||
61 | wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz |
||
62 | </code></pre> |
||
63 | |||
64 | 17 | Patrice Nadeau | h3. Compilation |
65 | 1 | Patrice Nadeau | |
66 | 9 | Patrice Nadeau | <pre><code class="bash"> |
67 | 112 | Patrice Nadeau | tar xvf nagios-4.3.2.tar.gz |
68 | cd ~/tmp/nagios-4.3.2 |
||
69 | 9 | Patrice Nadeau | ./configure --with-command-group=nagcmd |
70 | make all |
||
71 | 39 | Patrice Nadeau | </code></pre> |
72 | |||
73 | 76 | Patrice Nadeau | h3. Installation |
74 | 39 | Patrice Nadeau | |
75 | <pre><code class="bash"> |
||
76 | sudo make install |
||
77 | sudo make install-init |
||
78 | sudo make install-commandmode |
||
79 | sudo make install-config |
||
80 | 77 | Patrice Nadeau | sudo make install-html |
81 | 97 | Patrice Nadeau | sudo make install-webconf |
82 | 3 | Patrice Nadeau | </code></pre> |
83 | 14 | Patrice Nadeau | |
84 | 19 | Patrice Nadeau | h3. Configuration de l'usager web |
85 | 14 | Patrice Nadeau | |
86 | 41 | Patrice Nadeau | openSUSE : |
87 | 14 | Patrice Nadeau | <pre><code class="bash"> |
88 | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
89 | 1 | Patrice Nadeau | systemctl restart apache2.service |
90 | </code></pre> |
||
91 | |||
92 | Ubuntu/Debian : |
||
93 | <pre><code class="bash"> |
||
94 | sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
||
95 | sudo systemctl restart apache2.service |
||
96 | </code></pre> |
||
97 | |||
98 | h2. Nagios Plugins |
||
99 | 113 | Patrice Nadeau | |
100 | 120 | Patrice Nadeau | Pour les machine sous surveillance |
101 | |||
102 | 113 | Patrice Nadeau | > Les dernières versions sont disponibles au |
103 | * https://www.nagios.org/downloads/nagios-plugins/ |
||
104 | |||
105 | 116 | Patrice Nadeau | h3. Enlever la version installée avec le système d'exploitation |
106 | |||
107 | <pre><code class="bash"> |
||
108 | zypper remove monitoring-plugins* |
||
109 | </code></pre> |
||
110 | |||
111 | 113 | Patrice Nadeau | h3. Télécharger |
112 | |||
113 | <pre><code class="bash"> |
||
114 | mkdir ~/tmp |
||
115 | cd ~/tmp |
||
116 | 117 | Patrice Nadeau | wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz |
117 | 113 | Patrice Nadeau | </code></pre> |
118 | 22 | Patrice Nadeau | |
119 | h3. Compilation |
||
120 | |||
121 | <pre><code class="bash"> |
||
122 | 43 | Patrice Nadeau | cd ~/tmp |
123 | 118 | Patrice Nadeau | tar xvf nagios-plugins-2.2.1.tar.gz |
124 | cd nagios-plugins-2.2.1 |
||
125 | 1 | Patrice Nadeau | ./configure --with-nagios-user=nagios --with-nagios-group=nagios |
126 | 43 | Patrice Nadeau | make |
127 | sudo make install |
||
128 | 22 | Patrice Nadeau | </code></pre> |
129 | |||
130 | 55 | Patrice Nadeau | h2. Daemon |
131 | 1 | Patrice Nadeau | |
132 | 56 | Patrice Nadeau | openSUSE : |
133 | 20 | Patrice Nadeau | <pre><code class="bash"> |
134 | 86 | Patrice Nadeau | systemctl enable nagios.service |
135 | 1 | Patrice Nadeau | </code></pre> |
136 | |||
137 | 58 | Patrice Nadeau | Debian/Ubuntu : |
138 | 57 | Patrice Nadeau | > Ne semble pas nécessaire |
139 | |||
140 | 53 | Patrice Nadeau | h3. Vérification de la configurations |
141 | |||
142 | openSUSE: |
||
143 | 22 | Patrice Nadeau | <pre><code class="bash"> |
144 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
145 | 53 | Patrice Nadeau | </code></pre> |
146 | |||
147 | Debian/Ubuntu : |
||
148 | <pre><code class="bash"> |
||
149 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
150 | 22 | Patrice Nadeau | </code></pre> |
151 | 20 | Patrice Nadeau | |
152 | 55 | Patrice Nadeau | h3. Lancement du daemon |
153 | 54 | Patrice Nadeau | |
154 | openSUSE : |
||
155 | 20 | Patrice Nadeau | <pre><code class="bash"> |
156 | 86 | Patrice Nadeau | systemctl start nagios.service |
157 | 54 | Patrice Nadeau | </code></pre> |
158 | |||
159 | Debian/Ubuntu : |
||
160 | <pre><code class="bash"> |
||
161 | sudo systemctl start nagios3.service |
||
162 | 1 | Patrice Nadeau | </code></pre> |
163 | 28 | Patrice Nadeau | |
164 | La page est disponible à http://server.domain/nagios |