Server monitoring with Nagios on Ubuntu 14.04 Trusty Tahr and Debian Wheezy

Server monitoring with Nagios on Ubuntu 14.04 Trusty Tahr and Debian Wheezy

Version 1.0
Author: Srijan Kishore <s [dot] kishore [at] ispconfig [dot] org>
Follow howtoforge on Twitter
Last edited 20/Oct/2014

This document describes how to install and configure Nagios in Ubuntu 14.04 Server.  Nagios is a powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes.

Designed with scalability and flexibility in mind, Nagios gives you the peace of mind that comes from knowing your organization’s business processes won’t be affected by unknown outages.

Nagios is a powerful tool that provides you with instant awareness of your organization’s mission-critical IT infrastructure. Nagios allows you to detect and repair problems and mitigate future issues before they affect end-users and customers. This tutorial is also tested over Debian Wheezy server and everything is working fine.eval(ez_write_tag([[580,400],’howtoforge_com-medrectangle-3′,’ezslot_2′,121,’0′,’0′]));

1 Preliminary Note

This tutorial is based on Ubuntu 14.04 server, so you should set up a basic Ubuntu 14.04 server installation before you continue with this tutorial. The system should have a static IP address. I use as my IP address in this tutorial and as the hostname. Additionally you must have a LAMP server configured before following the steps ahead. I will use Nagios to monitor other Ubuntu 14.04 server, so I have another server as as the IP address and as the hostname.

Note: You can also use Debian wheezy as the base for Nagios monitoring server.

2 Installation and configuration of Nagios

We will install the Nagios in Ubuntu 14.04 server I will install it as follows:

apt-get install nagios3 nagios-nrpe-plugin
General type of mail configuration:  <--Internet Site  
System mail name:  <
Nagios web administration password: <--nagiospassword
Nagios web administration password: <--nagiospassword  

I gave the password as per my choice, please give the values as per your server environment.

Next we need to configure the Nagios at Server, as follows:

usermod -a -G nagios www-data
chmod -R +x /var/lib/nagios3/

Next change the values for check_external_commands to 1 to enable settings as follows:

nano /etc/nagios3/nagios.cfg



Now we need to make the changes effective by restarting the Nagios service by using the command:

service nagios3 restart

Accessing the web-interface at or as follows:

Username will be nagiosadmin and password as created above nagiospassword

Next click on Host Groups:

It will show the present Ubuntu server as localhost. Just click over the localhost.

4 Adding clients in Nagios

Now we need to add client(nodes) to get the monitoring service for the clients. I will add one more node as Ubuntu Server at We need to install these packages as follows:

apt-get install nagios-nrpe-server nagios-plugins

Further at define the main Nagios monitoring server entries in Nagios configuration file as :

nano /etc/nagios/nrpe.cfg

Where is the main Nagios monitor server IP. Next start nrpe service as shown below

service nagios-nrpe-server start

Similarly we can add more nodes to which we want monitoring. 

We also need to define the Nagios client entries at server end. Create a file monitor1.cfg in directory /etc/nagios3/conf.d/ and define the values at In the object configuration files, you can define hosts, host groups, contacts, contact groups, services, etc. You can split your object definitions across several config files if you wish, or keep them all in a single config file.

nano /etc/nagios3/conf.d/monitor1.cfg

Default directory is /etc/nagios3/conf.d/ , you can use any name such as I used monitor1.cfg Entries must be like this:

define host {
        use                     generic-host
        alias                   srijan

define service {
        use                             generic-service
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%

define service {
        use                             generic-service
        service_description             SSH
        check_command                   check_ssh
        notifications_enabled           0

define service { use generic-service host_name service_description DISK check_command check_disk notifications_enabled 0 }

In above file define host contains the information about the added client, next we can use Nagios to check different services. I used to check PING SSH and DISK services. For more details of services used in Nagios check directory /etc/nagios-plugins/config.

Next to make the changes effective restart the nagios3 service.

service nagios3 restart

Now we can check the client details at the Nagios web-interface at Host Groups as follows:

Next on and check the values there.

In the same way we can add more clients(nodes) and monitor them as per our needs. Congratulations! Now we have successfully configured Nagios monitoring tool in Ubuntu 14.04 🙂

  • Ubuntu :
  • Debian  :
  • Nagios  :
About the Author

Leave a Reply