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