Install Nagios 4.0.8 on Ubuntu 15.04 (Vivid Vervet) Server
Some of the many features of Nagios Core include:
Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.)
Monitoring of host resources (processor load, disk usage, etc.)
Simple plugin design that allows users to easily develop their own service checks
Parallelized service checks
Ability to define network host hierarchy using "parent" hosts, allowing detection of and distinction between hosts that are down and those that are unreachable
Contact notifications when service or host problems occur and get resolved (via email, pager, or user-defined method)
Ability to define event handlers to be run during service or host events for proactive problem resolution
Automatic log file rotation
Support for implementing redundant monitoring hosts
Optional web interface for viewing current network status, notification and problem history, log file, etc.
Preparing your system
First You need to make sure you have install Ubuntu 15.04 LAMP Server and once you have that follow the next steps.
Switch to root user and run the all the commands
sudo su --
Install the following packages
apt-get install build-essential php5-gd wget libgd2-xpm-dev libapache2-mod-php5 apache2-utils daemon
You need to create nagios user,nagcmd group and add the nagios,apache user to the part of nagcmd group
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data
Download Nagios core DIY Source from here
tar -zxvf /tmp/nagios-4.0.8.tar.gz
Compile and install Nagios Using the following commands
./configure –with-nagios-group=nagios –with-command-group=nagcmd
Configure Nagios web Interface
Create nagiosadmin account using the following command
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Enable CGI module and restart the apache2 server
service apache2 restart
Install Nagios Plugins
Download and install nagios plugins using the following commands
tar -zxvf /tmp/nagios-plugins-2.0.3.tar.gz
Compile and install nagios plugins using the following commands
./configure --with-nagios-user=nagios --with-nagios-group=nagios
Verify the sample nagios configuration files using the following command
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
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 you are not seeing any errors the start nagios using the following
When i try to start the nagios i got the following error and found out there is an issue with nagios init script
[....] Starting nagios (via systemctl): nagios.serviceFailed to start nagios.service: Unit nagios.service failed to load: No such file or directory. failed!
Solution to nagios init script
Copy /etc/init.d/skeleton to /etc/init.d/nagios using the following command
cp /etc/init.d/skeleton /etc/init.d/nagios
Now edit the nagios file
add the following lines
Save and exit the file
Finally you need to change the permissions of the file
chmod +x /etc/init.d/nagios
You can start the nagios using the following command
* Starting Nagios [ OK ]