Scientific Linux 6
Sponsored Link

Nagios - Add monitoring Target#22011/06/12

 
This example shows to add monitoring target with installing nrpe agent and monitor services on targets.
[1] Install nrpe agent and plugins for monitoring on target host.
[root@node01 ~]#
yum --enablerepo=epel -y install nrpe nagios-plugins-all
 
# install from EPEL
[root@node01 ~]#
vi /etc/nagios/nrpe.cfg
# line 79: add Nagios server's IP address

allowed_hosts=127.0.0.1
,10.0.0.100
# line 200: change the line for disk check like follows

# replace to the one for your own environment

command[
check_lv_root
]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p
/dev/mapper/VolGroup-lv_root
[root@node01 ~]#
/etc/rc.d/init.d/nrpe start

Starting nrpe:
[ OK ]

[root@node01 ~]#
chkconfig nrpe on

[2] Install nrpe plugin on Nagios server.
[root@master ~]#
yum --enablerepo=epel -y install nagios-plugins-nrpe
 
# install from EPEL
[root@master ~]#
vi /etc/nagios/objects/commands.cfg
# add at the last line

define command{
    command_name            check_nrpe
    command_line            $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

[root@master ~]#
vi /etc/nagios/servers/node01.cfg
# add at the last line

# change the line of disk check line for your environment

define service{
    use                     generic-service
    host_name               node01
    service_description     Current Users
    check_command           check_nrpe!check_users
}
define service{
    use                     generic-service
    host_name               node01
    service_description     Current Load
    check_command           check_nrpe!check_load
}
define service{
    use                     generic-service
    host_name               node01
    service_description     Root Partition
    check_command           check_nrpe!check_lv_root
}
define service{
    use                     generic-service
    host_name               node01
    service_description     Zombie Processes
    check_command           check_nrpe!check_zombie_procs
}
define service{
    use                     generic-service
    host_name               node01
    service_description     Total Processes
    check_command           check_nrpe!check_total_procs
}

[root@master ~]#
/etc/rc.d/init.d/nagios restart

Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.
[3] Access to Nagios admin site and make sure services on target hosts would be added.
Matched Content