This howto is based on a Debian Lenny system but with just a few modifications will be able to installed and configured successfully on any Linux Distribution like CentOS, OpenSuSE, Fedora etc.

Step 1
Download the required software packages.
Issue the following commands:




In case that a new version is out there please visit web site and download the latest release. Be aware that both, nagios core and nagios plugins are required.

Step 2
Uncompress both files.
Issue the following command:
tar xzvf nagios-3.2.1.tar.gz
tar xzvf nagios-plugins-1.4.14.tar.gz
and cd into nagios-3.2.1 directory

Step 3
Issue the following commands:
useradd nagios
passwd nagios
groupadd nagcmd
usermod -G nagcmd nagios
usermod -G nagcmd www-data

The last command user in our example is www-data which is the default configured on Apache under Webmin/Virtualmin installation on Debian. In your case might be Apache. Change that line in case that you've got an error that user does not exist.

Step 4
Start building nagios:
./configure --with-command-group=nagcmd
make all
make install
make install-config
make install-commandmode
make install-webconf

Then create an admin user:
htpasswd -c /usr/local/nagios/etc/htpasswd.users sysadmin
The above command will prompt you for a password, just type anyone you want.

Step 5
Start building nagios plugins.
cd ../nagios-plugins-1.4.14/
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make install

Step 6
Make sure everything works ok, issue the following command:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
You should got no errors or warnings at all, output should be like:

Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

If everything is ok login to the web interface with http://yourserverip/nagios/ and you're done!

Posted on: 26/10/2010

If you want to leave a comment please Login or Register