Page 1 of 1

windows done - onto linux, 127 out of bound error

Posted: Thu Jul 26, 2012 11:09 pm
by lraymond
ok, I did just google the whole ((Return code of 127 is out of bounds - plugin may be missing) and most responses talk of net-snmp, or re-compiling. They also look old. I am setup running a U10.04LTS with ALL binary installs and currently monitoring our 3 windows box's via nsclient++. I have my graphing (pnp4nagios) and now want to move to my linux servers.

I have a LB issue which I back-burnered so I can understand a bit more on NRPE, so I am testing against a single public IP with ALL ports open to the nagios server. The client has the nagios-nrpe-server binary installed, but NOT the nagios-nrpe-plugins. When I looked at installing that via apt-get, the dependencies were HUGE, including apache, nagios3, mailx, etc. (it seems that installs the whole nagios server).

From the server I can issue;
/usr/lib/nagios/plugins/check_nrpe -H <host-ip>
NRPE v2.12

on the client I see;
Jul 26 23:33:23 notices nrpe[3484]: Connection from <server-ip> port 24478
Jul 26 23:33:23 notices nrpe[3484]: Host address is in allowed_hosts
Jul 26 23:33:23 notices nrpe[3484]: Handling the connection...
Jul 26 23:33:23 notices nrpe[3484]: Host is asking for command '_NRPE_CHECK' to be run...
Jul 26 23:33:23 notices nrpe[3484]: Response: NRPE v2.12
Jul 26 23:33:23 notices nrpe[3484]: Return Code: 0, Output: NRPE v2.12

If I try to issue a cli check, I get command line arg's are not allowed (which I can see is an option when compiling, but also insecure). So I don't really need it, just need to see why I get that error. I currently have the linux box running one service test;

I have the following;

define service{
use generic-service
host_name server-name
service_description CPU Load
check_command check_nrpe!check_load
}

and I see on the client when I restated the server;
Jul 26 23:29:45 notices nrpe[3420]: Added command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

Lastly, on the client machine, if I switch user to nagios and run the command locally I get;
./check_load -w 15,10,5 -c 30,25,20
OK - load average: 0.07, 0.03, 0.01|load1=0.070;15.000;30.000;0; load5=0.030;10.000;25.000;0; load15=0.010;5.000;20.000;0;

the client nrpe is running as nagios user, and he owns the /usr/lib/nagios folder. I am not sure if it's permissions, something not installed, but I am learning a lot through this journey :)

Thanks for any help on this one or let me know if I am not providing something else!

Re: windows done - onto linux, 127 out of bound error

Posted: Sun Jul 29, 2012 8:06 pm
by jsmurphy
Return code 127 98% of the time means either a. It can't find the file you are telling it to execute or b. execution of the file is failing in a spectacular fashion.

Can you run the following on the nagios server cli and post the results?
/usr/lib/nagios/plugins/check_nrpe -H <host-ip> -c check_load

I also saw that you mentioned that the /usr/lib/nagios folder has the correct permissions... what about the folder /usr/lib/nagios/plugins? Does that folder exist?

Re: windows done - onto linux, 127 out of bound error

Posted: Mon Jul 30, 2012 10:09 pm
by lraymond
That was it, a path issue.

There seems to be 2 path's of different check's.
/usr/local/nagios/libexec has some and
/usr/local/nagios/libexec/ has others.

There was a check_nrpe in the 2nd, so I stuck a symlink to the other folder and it came alive and worked like a charm! Still a few more things to go over, but this hurdle has been cleared :)

Thanks!

Re: windows done - onto linux, 127 out of bound error

Posted: Tue Jul 31, 2012 6:36 pm
by jsmurphy
No worries! Glad I could help!