Goto Nagios server

cd /usr/local/nagios/libexec

wget http://www.mycutelife.net/sanju/newtickethelp/nagiosfullsteps/check_swp 

 

chmod +x check_swp

You need to do this for each server in nagios server

 

vi /usr/local/nagios/etc/services.cfg

add

define service{

host_name barracuda.dnsvelocity.com

service_description SWAP_USAGE

is_volatile 0

check_period 24×7

max_check_attempts 3

normal_check_interval 5

retry_check_interval 1

contact_groups voxtreme-admins

notification_interval 120

notification_period 24×7

notification_options w,u,c,r

check_command check_nrpe!check_swp

}

 

/etc/init.d/nagios restart

 

Goto remote server

cd /usr/local/nagios/libexec

wget http://www.mycutelife.net/sanju/newtickethelp/nagiosfullsteps/check_swp 

chmod +x check_swp

 

echo “command[check_swp]=/usr/local/nagios/libexec/check_swp -w 80 -c 70” >> /etc/nrpe.conf

 

/etc/init.d/xinetd restart

 

touch /home/nagios/swapcalc

chown nagios:nagios /home/nagios/swapcalc

touch /home/nagios/swappercent

chown nagios:nagios /home/nagios/swappercent

chmod +x /usr/bin/free

 

Check in nagios server

./check_nrpe -H <server ip> -c check_swp