Home | Mirror | Search

6. nrpe

	
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
yum install nrpe -y
yum install -y nagios-plugins-disk nagios-plugins-load nagios-plugins-ping nagios-plugins-procs nagios-plugins-swap nagios-plugins-users

chkconfig nrpe on

vim /etc/nagios/nrpe.cfg <<VIM > /dev/null 2>&1
:79,79s/allowed_hosts=127.0.0.1/allowed_hosts=172.16.1.2/
:wq
VIM

cat >> /etc/nagios/nrpe.cfg <<EOF

#command[check_http]=/usr/lib64/nagios/plugins/check_http -I 127.0.0.1 -p 80 -u http://www.example.com/index.html
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w 20% -c 10%
command[check_all_disks]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -e
EOF

service nrpe start
    
	

NAGIOS3 Template

define host{

        use             generic-host

        host_name       www.example.com

        alias           www.example.com

        address         172.16.1.5

        hostgroups      mysql-servers

        }
define service{

        use                     generic-service ; Inherit values from a template

        host_name               www.example.com ; The name of the host the service is associated with

        service_description     PING            ; The service description

        check_command           check_ping!200.0,20%!600.0,60%  ; The command used to monitor the service

        normal_check_interval   5       ; Check the service every 5 minutes under normal conditions

        retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined

        }

define service{

        use             generic-service

        host_name               www.example.com

        service_description     MySQL

        check_command   check_mysql_database!monitor!xmNhjDCjfYHjcSG!test

        }


# NRPE disk check.
define service {
        use                             generic-service
        host_name                       www.example.com
        service_description             nrpe-disk
        check_command                   check_nrpe_1arg!check_all_disks
}
define service {
        use                             generic-service
        host_name                       www.example.com
        service_description             nrpe-users
        check_command                   check_nrpe_1arg!check_users
}
define service {
        use                             generic-service
        host_name                       www.example.com
        service_description             nrpe-swap
        check_command                   check_nrpe_1arg!check_swap
}
;define service {
;        use                             generic-service
;        host_name                       www.example.com
;        service_description             nrpe-procs
;        check_command                   check_nrpe_1arg!check_total_procs
;}
define service {
        use                             generic-service
        host_name                       www.example.com
        service_description             nrpe-load
        check_command                   check_nrpe_1arg!check_load
}
define service {
        use                             generic-service
        host_name                       www.example.com
        service_description             nrpe-zombie_procs
        check_command                   check_nrpe_1arg!check_zombie_procs
}

	
comments powered by Disqus