2013
06.30

1 useradd -m -s /bin/bash nagios
2 passwd nagios
3 groupadd nagcmd
4 usermod -a -G nagcmd nagios
5 usermod -a -G nagcmd www-data
6 wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.0.tar.gz
7 wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
8 tar -xvzf nagios-3.5.0.tar.gz
9 cd nagios/
10 ./configure --with-command-group=nagcmd
11 make all
12 make install
13 make install-init
14 make install-config
15 make install-commandmode
16 nano /usr/local/nagios/etc/objects/contacts.cfg
17 make install-webconf
18 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
19 /etc/init.d/apache2 reload
20 cd ..
21 tar -xvzf nagios-plugins-1.4.16.tar.gz
22 cd nagios-plugins-1.4.16/
23 apt-get install libssl-dev
24 ./configure --with-nagios-user=nagios --with-nagios-group=nagios
25 make
26 make install
27 ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
28 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
29 /etc/init.d/nagios start

Verify Nagios config before re/starting Nagios services:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

There is essentially a 4-step process for adding new nagios nrpe plugins, 2 steps will need to be carried on the client and then a further 2 steps will need to be carried out on the server as follows:
*Directory structure below assumes you’ve compiled from source without changing the default install path.

1.   On the client, copy the new nagios nrpe plugin to the following directory:
/usr/local/nagios/libexec/
2. On the client, add the command check for the new plugin here:
/usr/local/nagios/etc/nrpe.cfg
3. On the server, define the new command check here:
/usr/local/nagios/etc/objects/commands.cfg
4. On the server, add the new command you’d like to be checked on the client here:
/usr/local/nagios/etc/objects/linux-servers.cfg

Finally, as always you must remember to restart the nagios/nrpe services on both the server and the client when ever any changes are made to your config files.

Screenshot of Homecomputerlab servers monitored by nagios :)

No Comment.

Add Your Comment