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