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