Page 1 of 1

Return code of 127 for check of service...

Posted: Wed Mar 14, 2012 2:55 pm
by rhubarb
I am attempting to monitor a linux machine. I followed instructions as per http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
I compiled and installed nagios plugins and nrpe successfully. I then added a linux.cfg template and can see the server listed on my nagios server but I see this error: (Return code of 127 is out of bounds - plugin may be missing) I've attempted reinstalls of both and checked logs but haven't found anything helpful. Can anyone here help?

Thanks!

Re: Return code of 127 for check of service...

Posted: Wed Mar 14, 2012 3:26 pm
by scottwilkerson
Look in your nrpe.cfg (or sometimes in the included common.cfg) for the command you are calling.

Then make sure the plugin for the command is in the location specified in the .cfg file.

Re: Return code of 127 for check of service...

Posted: Thu Mar 15, 2012 9:05 am
by rhubarb
My nrpe file in /etc/xinetd.d on remote linux host

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 10.22.22.43 #IP of local host eth0
}

Documentation states:
Edit the /etc/xinetd.d/nrpe file and add the IP address of the monitoring server to the only_from directive.
only_from = 127.0.0.1 <nagios_ip_address>

This is being configured on the remote linux host to be monitored. So why does it say 127.0.0.1 as nagios ip address? I found this confusing. Regardless of what IP I put here it doesn't seem to work.

Commands in /usr/local/nagios/etc/nrpe.cfg on remote linux host.

# The following examples use hardcoded command arguments...

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200

Looking in this directory shows all the commands there.

This is command I have on Nagios server in commands.cfg

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

Re: Return code of 127 for check of service...

Posted: Thu Mar 15, 2012 10:46 am
by rhubarb
Okay so I checked the Nagios server and noticed that nrpe is not installed there.

when I ./configure the package it get the following error:

checking for SSL libraries... configure: error: Cannot find ssl libraries

I've read everywhere that you need libssl-dev needs to be install but checking:

libssl-dev is already the newest version.
libssl1.0.0 is already the newest version.
libssl0.9.8 is already the newest version.

So not sure what I'm missing here.

Re: Return code of 127 for check of service...

Posted: Thu Mar 15, 2012 2:19 pm
by rhubarb
Okay so I just installed the plugin without SSL as I could not get it to work.

Re: Return code of 127 for check of service...

Posted: Thu Mar 15, 2012 5:09 pm
by jsmurphy
If it's installed, but it can't find them that usually means that they are installed in a place it doesn't expect to find them... I believe there is a switch you can set that allows you to specify the path to search but I can't remember it off the top of my head... do ./configure --help and it should be one of the options.

Re: Return code of 127 for check of service...

Posted: Sat Aug 18, 2012 8:02 am
by florin
Hi there,

I have a similar problem except it gives this error on all the services that are started as default.

I have a CentOS6 installed on my server and I used yum to install nagios and now it dos not find any of the plugin's
My ideea is that it dose not have the path to the plugin's specified in the config files and I did not find how to do this eider

If there are any sugestions I woluld be greatful.

Re: Return code of 127 for check of service...

Posted: Mon Aug 20, 2012 10:17 am
by yancy
florin,

the patch to your plugins should be configured in

$Nagios/etc/resource.cfg
(your location of $Nagios will vary based on installation method)

$USER1$ is a macro that is substituted for the path when the check is run.

Regards,

-Yancy