Network Monitoring with Nagios
Server - Nagios


Nagios is both a powerful and flexible network monitoring tool for checking devices and applications.  The power of Nagios is in the ability to monitor many different network devices at one time using various methods to monitor those devices.  The flexibility of Nagios provides an administrator the tools to monitor just about anything that is connected to a network.  In addition, Nagios allows the administrator to monitor both the external ports and internal application processes on those devices.  Monitoring would not be complete without multiple methods for contacting administrators which Nagios also provides.

Check out our live Nagios Classes.

Nagios Installation Options

1. Install From Source
This is the default method of building Nagios from source by compiling.  Fear of the compiling process drives many to consider the other two options.

2. Install From RPM Repository
A repository is like a warehouse that provides access to applications, like Nagios, that users can download and install using yum.

3. Install From Deb Repository
The example used for this option is usually Ubuntu using apt-get.

Each of these options has advantages and disadvantages.  The one point that is most important to understand is that each installation option places the files for Nagios in different locations.  Misunderstanding this principle has stopped progress in many Nagios installations.

So, let's make the installation easy. How about executing a script that installs Nagios, sets up the firewall, creates the password for nagiosadmin and provides you with web access to the interface.

Nagios Quick Install from RPM Repository in 63 Seconds
Only install this on a test system with no previous Nagios installation, this script is not designed for production systems.  The script will install a working Nagios server by using yum and is designed for a CentOS server.

Disable SELinux on the server.  Edit /etc/selinux/config and change from "enforcing" to "disabled".

SELINUX=disabled


Download the script nagios.sh  http://beginlinux.com/nagios.sh

Place the script on your server and then make it executable:

chmod 755 nagios.sh

Become root and execute the script:

sh nagios.sh

Be prepared to answer these questions as the script will configure Nagios so it is running with a firewall.
* IP Address for limiting access to the web interface with iptables.  Note this sets access via port 80 to your machine only to protect the web interface.   If you restart the server this iptables setting will be lost so you must permanently allow access via port 80.
* contact email for the nagiosadmin
* password for the nagiosadmin  

Once the script is complete, point your browser to the IP Address of the Nagios server.

http://your_nagios_server/nagios

The username to access the web interface is nagiosadmin and the password will be what you supplied when the script ran.

Once the you login you will see that you are monitoring several sites including GoogleMail and  Google.  Now you will have an example in order that you can add your sites and remove the Google examples.