Return code of 127 for check of service...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rhubarb
Posts: 8
Joined: Mon Mar 12, 2012 12:30 pm

Return code of 127 for check of service...

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rhubarb
Posts: 8
Joined: Mon Mar 12, 2012 12:30 pm

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

Post 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$
}
rhubarb
Posts: 8
Joined: Mon Mar 12, 2012 12:30 pm

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

Post 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.
rhubarb
Posts: 8
Joined: Mon Mar 12, 2012 12:30 pm

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

Post by rhubarb »

Okay so I just installed the plugin without SSL as I could not get it to work.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

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

Post 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.
florin
Posts: 1
Joined: Sat Aug 18, 2012 7:24 am

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

Post 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.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

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

Post 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
Locked