Projet

Général

Profil

From source » Historique » Version 36

Patrice Nadeau, 2015-02-08 09:31

1 18 Patrice Nadeau
{{TOC}}
2
3 25 Patrice Nadeau
h1. Installation à partir des sources
4 1 Patrice Nadeau
5 7 Patrice Nadeau
L'installation à partir des sources permet 
6 6 Patrice Nadeau
* d'avoir la version la plus récente
7
* n'est pas relier à une plate-forme spécifique (i686 vs x86_64 vs ARM) 
8
9 10 Patrice Nadeau
Les test ont été fait à partir d'un BeagleBone Black sous openSUSE 13.2.
10 8 Patrice Nadeau
11 4 Patrice Nadeau
h2. Prérequis
12 1 Patrice Nadeau
13 6 Patrice Nadeau
Installer les utilitaires pour la compilation :
14 35 Patrice Nadeau
15
openSUSE :
16 5 Patrice Nadeau
<pre><code class="bash">
17
zypper install make gcc
18 35 Patrice Nadeau
</code></pre>
19
20 36 Patrice Nadeau
Ubuntu/Debian :
21 35 Patrice Nadeau
<pre><code class="bash">
22
sudo apt-get install make gcc
23 5 Patrice Nadeau
</code></pre>
24 4 Patrice Nadeau
25 9 Patrice Nadeau
h2. Fichiers
26
27 2 Patrice Nadeau
Télécharger
28 1 Patrice Nadeau
<pre><code class="bash">
29 21 Patrice Nadeau
mkdir ~/tmp
30
cd ~/tmp
31 1 Patrice Nadeau
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
32
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
33 3 Patrice Nadeau
</code></pre>
34 1 Patrice Nadeau
35 9 Patrice Nadeau
h2. Création de l'usager et groupe
36
37 3 Patrice Nadeau
<pre><code class="bash">
38
useradd nagios
39
groupadd nagcmd
40 11 Patrice Nadeau
/usr/sbin/groupadd nagios
41 1 Patrice Nadeau
usermod -a -G nagcmd nagios
42 11 Patrice Nadeau
usermod -a -G nagios nagios
43 24 Patrice Nadeau
# Permet de soumettre des check via l'interface web
44
usermod -a -G nagcmd wwwrun
45 9 Patrice Nadeau
</code></pre>
46
47 17 Patrice Nadeau
h2. Nagios Core
48
49
h3. Compilation
50 1 Patrice Nadeau
51 9 Patrice Nadeau
<pre><code class="bash">
52 21 Patrice Nadeau
cd ~/tmp/nagios-4.0.8
53 9 Patrice Nadeau
./configure --with-command-group=nagcmd
54
make all
55 12 Patrice Nadeau
make install
56
make install-init
57
make install-commandmode
58
make install-config
59 13 Patrice Nadeau
make install-webconf
60 3 Patrice Nadeau
</code></pre>
61 14 Patrice Nadeau
62 19 Patrice Nadeau
h3. Configuration de l'usager web
63 14 Patrice Nadeau
64
<pre><code class="bash">
65
htpasswd2 -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
66 15 Patrice Nadeau
systemctl restart apache2
67 14 Patrice Nadeau
</code></pre>
68 16 Patrice Nadeau
69 22 Patrice Nadeau
h2. Nagios Plugins
70
71
h3. Compilation
72
73
<pre><code class="bash">
74
cd ~/tmp/nagios-plugin
75
./configure --with-nagios-user=nagios --with-nagios-group=nagios
76
make
77
make install
78
</code></pre>
79
80 26 Patrice Nadeau
h2. Nagios Remote Plugin Executor
81
82 29 Patrice Nadeau
Ce « add-on » se divise en deux parties
83 31 Patrice Nadeau
* Le deamon _NRPE_ qui roule comme agent sur la machine sous surveillance
84 33 Patrice Nadeau
* Le « plugin » _nrpe_check_ qui roule sur le serveur Nagios pour exécuter les vérifications sur des machines distantes.
85 1 Patrice Nadeau
86 29 Patrice Nadeau
h3. Téléchargement
87
88 26 Patrice Nadeau
<pre><code class="bash">
89
http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
90
</code></pre>
91 1 Patrice Nadeau
92
h3. Compilation
93 29 Patrice Nadeau
94
<pre><code class="bash">
95
# Installe les librairies de développement SSL
96 30 Patrice Nadeau
zypper install libopenssl-devel
97 29 Patrice Nadeau
# Décompresse le fichier
98
tar xvf nrpe-2.15.tar.gz
99
cd nrpe-2.15
100 1 Patrice Nadeau
# lance la compilation
101
./configure
102
make all
103 31 Patrice Nadeau
</code></pre>
104
105
h4. Installation
106
107
Un fois compilés, les exécutables ne sont pas copiés au bons endroits. On doit donc le faire manuellement.
108
109 32 Patrice Nadeau
h5. check_nrpe
110
111 31 Patrice Nadeau
<pre><code class="bash">
112
cp src/check_nrpe /usr/local/nagios/libexec
113 29 Patrice Nadeau
</code></pre>
114 32 Patrice Nadeau
115
h5. NRPE
116
117 34 Patrice Nadeau
Problème #31
118 26 Patrice Nadeau
119 23 Patrice Nadeau
h2. Services
120 1 Patrice Nadeau
121 20 Patrice Nadeau
<pre><code class="bash">
122
systemctl enable nagios
123 1 Patrice Nadeau
</code></pre>
124
125 22 Patrice Nadeau
Vérifier si les fichiers de configurations sont bon
126
<pre><code class="bash">
127
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
128
</code></pre>
129 20 Patrice Nadeau
130 22 Patrice Nadeau
Lancer Nagios
131 20 Patrice Nadeau
<pre><code class="bash">
132 22 Patrice Nadeau
systemctl start nagios
133 1 Patrice Nadeau
</code></pre>
134 28 Patrice Nadeau
135
La page est disponible à http://server.domain/nagios