CentOS 5
Sponsored Link

Install nrpe
2008/08/16
  Install nrpe on remote host and make Nagios to be able to watch services on remote host.

[1] Install nrpe on Nagios server and on remote server you'd like to watch.
[root@ns ~]#
yum --enablerepo=dag -y install nagios-nrpe nagios-plugins-nrpe
 
# install from DAG
[2] Configure remore host. Install xinetd first.
[root@lan ~]#
yum -y install xinetd


[root@lan ~]#
vi /etc/xinetd.d/nrpe


service nrpe
{
flags
= REUSE

type
= UNLISTED

port
= 5666

socket_type
= stream

wait
= no

user
= nagios

group
= nagios

server
= /usr/sbin/nrpe

server_args
= -c /etc/nagios/nrpe.cfg --inetd

log_on_failure
+= USERID

disable
=
no
# change

only_from
= 127.0.0.1
192.168.0.21
# nagios server's IP address


}

[root@lan ~]#
/etc/rc.d/init.d/xinetd start

Starting xinetd:
[  OK  ]

[root@lan ~]#
chkconfig xinetd on
[3] Configure Nagios server.
[root@ns ~]#
vi /etc/nagios/objects/commands.cfg


# add at the bottom

define command{
command_name
check_nrpe

command_line
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}


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

Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
[4] Set config on remote host.
[root@lan ~]#
vi /etc/nagios/nrpe.cfg


# add at the bottom

command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 5.0,4.0,3.0 -c 10.0,6.0,4..
command[check_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_procs]=/usr/lib64/nagios/plugins/check_procs -w 250 -c 400 -s RSZDT
[5] Back to Nagios again and set some config.
[root@ns ~]#
vi /etc/nagios/servers/lan.cfg


# add at the bottom

define service{
use
generic-service

host_name
lan

service_description
Current Users

check_command
check_nrpe!check_users

}

define service{
use
generic-service

host_name
lan

service_description
Current Load

check_command
check_nrpe!check_load

}

define service{
use
generic-service

host_name
lan

service_description
Root Partition

check_command
check_nrpe!check_disk

}

define service{
use
generic-service

host_name
lan

service_description
Total Processes

check_command
check_nrpe!check_procs

}


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

Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
[6] Access to Nagios control site and make sure services for remote host.
 
Matched Content
 
Tweet