Monitoring with Nagios

With the growing number of servers, monitoring often becomes harder day by day. There are various solutions for this. Two very popular I have seen around are Zenoss and Nagios.

Well, here comes the very common question. Which one to use? The best answer would be, the one with less learning and more features 😉 Most often the combination isn’t so easy to achieve.

There are so many comparisons around monitoring tools. I have found these two relevant to this post, one from Linux.com and another from Zenoss.org Help yourself with the links, I am not going to make any comparison between these two.

At Eucalyptus, we have customers who run a lot of servers and monitoring tool is not another fancy product for them, rather it’s a necessity.

But deploying a quick Nagios monitoring system on CentOS is only few steps away. It should not be any different on other distros as well.

Install Nagios packages,

yum install -y nagios nagios-plugins nagios-plugins-nrpe nagios-plugins-all

Set password for Nagios admin,

htpasswd /etc/nagios/passwd nagiosadmin

Start the services and update runlevel for each of them,

chkconfig nagios on
chkconfig httpd on
service nagios start
service httpd start

Define host and services

vim /etc/nagios/objects/host1.cfg
# Define a host

define host{
        use                     linux-server
        host_name               host1
        address                 10.104.3.128
        }

# Define a service

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

Add the following line to nagios.cfg,

cfg_file=/etc/nagios/objects/host1.cfg

Reload Nagios service,

service nagios reload

Check Nagios admin panel at http://<ip_address>/nagios

Tada!!

And of course, it is released under the GPL license.

Advertisements

2 thoughts on “Monitoring with Nagios

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s