NRPE Problem


#1

I am having trouble getting active checks to work on a remote machine using the nrpe daemon. I am trying to get data about a remote hosts disk usage. Here are my configs on the nagios host:

#CHECK_COMMANDS.CFG

Command to check remote hosts (NRPE command)

define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

define service{
use generic-service ; Name of service template to use
host_name remote machine I want to check
service_description Home Partition
check_command check_nrpe!check_disk1!20%!10%!/home
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 5
retry_check_interval 1
contact_groups me,pager,admin
notification_interval 960
notification_period 24x7
notification_options w,u,c,r,f
}

NAGIOS.CFG

check_external_commands=1
command_check_interval=-1

#NAGIOS and REMOTE HOST NRPE.CFG
command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /home

Now here is the actual disk info when running command from the terminal on the remote host:

remote host# df -h

/dev/sdb3 131G 1.1G 122G 1% /home

However, the result I am getting back from Nagios for this is telling me ;

DISK_CRITICAL – Free Space
[/dev/hda1 not found]

So why is this trying to check /dev/hda1 and not the /home partition which is /dev/sdb3? I’m sure I just have something misconfigured but just can’t figure out what/where.

I’ve tried to change the nrpe.cfg file so that it reads…
command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/sdb3
But that doesn’t change the result. Anyway, if you could advise, it would be greatly appreciated. Thanks in advance !

ps I’ve also made sure that I restarted nagios service each time I made a change. And I’ve made sure that the plugins are loaded in /usr/local/nagios/libexec on the remote host (sometimes people miss the obvious). I’m sure I’m missing something, it’s just not that. :wink:


#2

You also have to restart NRPE as well as Nagios for the change in NRPE.cfg to take effect.

Just so you know, NRPE.cfg on the Nagios host has no bearing on the remote host you’re checking; only configuration on the remote host(s) will apply.

Additionally, you’ve got too many arguments in your service definition for your NRPE check. Since, on the remote host, the values for the -w, -c and -p are already defined in the disk check, you don’t need them in the service config on your Nagios box. Your check command on Nagios should look like this:

check_command check_nrpe!check_disk1


#3

Thanks a bunch SonofThunder, that did the trick. : )