NRPE & Return code of 127 out of bounds error

nagios 2.x

define command{
command_name check_nrpe
command_line check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
}

define service{
use generic-service

name home-part-template
service_description /home usage
check_command check_nrpe!check_disk!65%!40%!/home

register 0
}

define service {
use home-part-template

hostgroup_name linux-servers
servicegroups diskusage
contact_groups linux-admins
}

doesn’t matter which service. Any using NRPE fail every time. However, if I expand it all and run it from the nagios system, as the nagios user:

$ /usr/lib/nagios/plugins/check_nrpe -H 10.1.1.8 -c check_disk -a 40% 30% /home
DISK OK [12220236 kB (78%) free on /dev/cciss/c0d0p3]

So why is it that nagios can’t call this? I’ve verified no stray characters, and other checks work fine. (check_smtp, local checks, check_dns, etc) Anyone know why nagios would choke in this way?

nagios.org/faqs/viewfaq.php? … desc=false

$ /usr/lib/nagios/plugins/check_nrpe -H 10.1.1.8 -c check_disk -a 40% 30% /home
DISK OK [12220236 kB (78%) free on /dev/cciss/c0d0p3]

Obviously, none of those FAQs apply here. The check works fine from the commandline. It’s something in the way nagios is calling it. And it’s not the path to check_nrpe, because it’s in the same place as all the other plugins, which work fine.

Well, no it’s not obvious that the FAQ is wrong. As a matter of fact, the FAQ is dead on Correct.

“define command{
command_name check_nrpe
command_line check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
}”

Your path to the command is wrong.
It should be
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$
}