Setup Nagios Client

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

vi /etc/nagios/nrpe.cfg

change line:

allowed_hosts=<ip of your nagios server>

/etc/init.d/nagios-nrpe-server restart

scp /usr/lib/nagios/plugins/

scp /usr/lib/nagios/plugins/

vi /etc/nagios/nrpe_local.cfg
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_mysql]=/usr/lib/nagios/plugins/check_mysql -u nrpe -p nrpe
command[check_raid]=/usr/bin/sudo /usr/bin/perl /usr/lib/nagios/plugins/ -d c0
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 10M -c 50M -p /dev/sda1
command[check_vz]=/usr/bin/sudo /usr/bin/python /usr/lib/nagios/plugins/


add line:

nagios  files2010=NOPASSWD: /usr/lib/nagios/plugins/, /usr/lib/nagios/plugins/check_vz_ubc

Test on Nagios Server with:

root@s2-nagios:/etc/nagios-plugins/config#  /usr/lib/nagios/plugins/check_nrpe -H
NRPE v2.12

root@s2-nagios:/# /usr/lib/nagios/plugins/check_nrpe -H -c check_vz

root@s2-nagios:/# /usr/lib/nagios/plugins/check_nrpe -H -c check_raid
Arrays OK on Controller c0.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.