Saturday, April 25, 2009

Adding more services to the Nagios

Monitoring Host Configuration:

Define the remote host name in client.cfg
Edit /usr/local/nagios/etc/objects/remotehost.cfg and append the following lines:

define host{
use linux-box
host_name remote_host
address ipaddress of remote_host
check_command check-host-alive
contacts nagios admin,cliectcontact
}
Next define contact name and contact goup name inn same file

define contact{
contact_name clientcontact
host_name remote_host
use generic-contact
alias Nagios client
email remotehost@gmail.com
}
define contactgroup{
contactgroup_name groupname
host_name remote_host
alias Nagios group
members clientcontact,membersof remote_host
}

Next add more services to monitor remote host,for this:

define service{
use generic-service
host_name remote_host
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name remote_host
service_description HyperVM
check_command check_nrpe!check_http
}
define service{
use generic-service
host_name remote_host
service_description Procs
check_command check_nrpe!check_procs
}
define service{
use generic-service
host_name remote_host
service_description Zombie Processes
check_command check_nrpe!check_zombie_procs
}
define service{
use generic-service
host_name remote_host
service_description / Partition
check_command check_nrpe!check_disk1
}
define service{
use generic-service
host_name remote_host
service_description /storage partition
check_command check_nrpe!check_disk2
}
define service{
use generic-service
host_name remote_host
service_description Current Users
check_command check_nrpe!check_users
}

define service{
use generic-service
host_name remote_host_name
service_description controlpanel check
check_command check_tcp!-H $HOSTADDRESS$ -p 2082
}
define service{
use generic-service
host_name remote_host
service_description ssl
check_command check_nrpe!check_ssl
}

Restart nagios daemon

/etc/init.d/nagios restart

Remote Host Configuration:

Edit the nrpe configuration file and add the folowing lines:

vi /etc/nrpe.conf

command[check_pop]=/usr/local/nagios/libexec/check_pop -p 110 -4 -w 10 -c 20
command[check_imap]=/usr/local/nagios/libexec/check_imap -p 143 -4 -w 10 -c 20
command[check_smtp]=/usr/local/nagios/libexec/check_smtp -p 25 -4 -w 10 -c 20
command[check_http]=/usr/local/nagios/libexec/check_http -H 127.0.0.1 -w 5 -c 10
command[check_mysql]=/usr/local/nagios/libexec/check_tcp -p 3306 -w 10 -c 20
command[check_dns]=/usr/local/nagios/libexec/check_dns -H www.eglueweb.com
command[check_ftp]=/usr/local/nagios/libexec/check_ftp -w 10 -c 20
command[check_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_ping]=/usr/local/nagios/libexec/check_ping -H $ARG1$ -w $ARG2$ -c $ARG3$ -p 5
command[check_ssl]=/usr/local/nagios/libexec/check_tcp -H 67.228.194.218 -p 443
command[check_mailq]=/usr/local/nagios/libexec/check_exim -w 10 -c -20

restart the nrpe damon

/etc/init.d/nrpe restart

No comments:

Post a Comment