From source » Historique » Version 127
Patrice Nadeau, 2018-08-18 08:09
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 | 125 | Patrice Nadeau | |
93 | ```bash |
||
94 | 1 | Patrice Nadeau | htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
95 | systemctl restart apache2.service |
||
96 | 125 | Patrice Nadeau | ``` |
97 | 1 | Patrice Nadeau | |
98 | Ubuntu/Debian : |
||
99 | 125 | Patrice Nadeau | ```bash |
100 | 1 | Patrice Nadeau | sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin |
101 | sudo systemctl restart apache2.service |
||
102 | 125 | Patrice Nadeau | ``` |
103 | 1 | Patrice Nadeau | |
104 | 121 | Patrice Nadeau | ## Nagios Plugins |
105 | 1 | Patrice Nadeau | |
106 | 120 | Patrice Nadeau | Pour les machine sous surveillance |
107 | |||
108 | 113 | Patrice Nadeau | > Les dernières versions sont disponibles au |
109 | * https://www.nagios.org/downloads/nagios-plugins/ |
||
110 | |||
111 | 121 | Patrice Nadeau | ### Enlever la version installée avec le système d'exploitation |
112 | 116 | Patrice Nadeau | |
113 | 126 | Patrice Nadeau | ```bash |
114 | 116 | Patrice Nadeau | zypper remove monitoring-plugins* |
115 | 126 | Patrice Nadeau | ``` |
116 | 116 | Patrice Nadeau | |
117 | 121 | Patrice Nadeau | ### Télécharger |
118 | 113 | Patrice Nadeau | |
119 | 127 | Patrice Nadeau | ```bash |
120 | 113 | Patrice Nadeau | mkdir ~/tmp |
121 | 117 | Patrice Nadeau | cd ~/tmp |
122 | 113 | Patrice Nadeau | wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz |
123 | 127 | Patrice Nadeau | ``` |
124 | 1 | Patrice Nadeau | |
125 | 121 | Patrice Nadeau | ### Compilation |
126 | 22 | Patrice Nadeau | |
127 | <pre><code class="bash"> |
||
128 | 43 | Patrice Nadeau | cd ~/tmp |
129 | 118 | Patrice Nadeau | tar xvf nagios-plugins-2.2.1.tar.gz |
130 | cd nagios-plugins-2.2.1 |
||
131 | 43 | Patrice Nadeau | ./configure --with-nagios-user=nagios --with-nagios-group=nagios |
132 | make |
||
133 | 22 | Patrice Nadeau | sudo make install |
134 | </code></pre> |
||
135 | 1 | Patrice Nadeau | |
136 | 121 | Patrice Nadeau | ## Daemon |
137 | 1 | Patrice Nadeau | |
138 | 56 | Patrice Nadeau | openSUSE : |
139 | 20 | Patrice Nadeau | <pre><code class="bash"> |
140 | 86 | Patrice Nadeau | systemctl enable nagios.service |
141 | 1 | Patrice Nadeau | </code></pre> |
142 | |||
143 | 58 | Patrice Nadeau | Debian/Ubuntu : |
144 | 57 | Patrice Nadeau | > Ne semble pas nécessaire |
145 | |||
146 | 121 | Patrice Nadeau | ### Vérification de la configurations |
147 | 53 | Patrice Nadeau | |
148 | openSUSE: |
||
149 | 22 | Patrice Nadeau | <pre><code class="bash"> |
150 | 1 | Patrice Nadeau | /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
151 | 53 | Patrice Nadeau | </code></pre> |
152 | |||
153 | Debian/Ubuntu : |
||
154 | <pre><code class="bash"> |
||
155 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
||
156 | 22 | Patrice Nadeau | </code></pre> |
157 | 20 | Patrice Nadeau | |
158 | 121 | Patrice Nadeau | ### Lancement du daemon |
159 | 54 | Patrice Nadeau | |
160 | openSUSE : |
||
161 | 20 | Patrice Nadeau | <pre><code class="bash"> |
162 | 86 | Patrice Nadeau | systemctl start nagios.service |
163 | 54 | Patrice Nadeau | </code></pre> |
164 | |||
165 | Debian/Ubuntu : |
||
166 | <pre><code class="bash"> |
||
167 | sudo systemctl start nagios3.service |
||
168 | 1 | Patrice Nadeau | </code></pre> |
169 | 28 | Patrice Nadeau | |
170 | La page est disponible à http://server.domain/nagios |