Return Code 255 Out of Bounds from Nagios but not CMD line

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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by lmiltchev »

@brayshawuk

Can you run the command successfully from the CLI as nagios user?

Code: Select all

su - nagios -c '/usr/local/nagios/libexec/check_nrpe -H <remote_ip> -p 5666 -c check_xvda1'
Be sure to check out our Knowledgebase for helpful articles and solutions!
brayshawuk
Posts: 7
Joined: Fri Sep 05, 2014 6:39 am

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by brayshawuk »

brayshawuk wrote:Thanks for quick response, however:

nagios@server:/usr/local/nagios/libexec$ ./check_nrpe -H <remote_ip> -p 5666 -c check_xvda1
DISK OK - free space: / 27129 MB (36% inode=10%);| /=46359MB;68940;72770;0;76601

:?
yup

for info, I followed the same procedure to install nrpe on another remote system, added the same adv service using nconf - no issues :x

tomorrow I will turn up debugging and re-run the setup commands on this remote server
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by eloyd »

The specific command that @lmiltchev requested you test was:

Code: Select all

su - nagios -c '/usr/local/nagios/libexec/check_nrpe -H <remote_ip> -p 5666 -c check_xvda1'
Have you tested this specific command in its entirety, including the "su - nagios" part and the quotes?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by lmiltchev »

brayshawuk, can you also run the following command and show us the output?

Code: Select all

grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
brayshawuk
Posts: 7
Joined: Fri Sep 05, 2014 6:39 am

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by brayshawuk »

su - nagios -c '/usr/local/nagios/libexec/check_nrpe -H <remote_ip> -p 5666 -c check_xvda1'
DISK OK - free space: / 27176 MB (36% inode=10%);| /=46312MB;68940;72770;0;76601


Ok - so I've been able to resolve this issue :D

here's how, but not sure which part resolved it

re-installed nrpe on the remote system, and setup my command aliases
verified all settings against working server - nothing different
recreated the host in nconf - exactly the same information (screenshot vs web config) - nothing different, they are identical!
generated config files and scheduled next check
- and it worked

will see how I get on once it's checked a few times, thanks for all your help - much appreciated
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by eloyd »

I'm willing to bet that this solved it:
re-installed nrpe on the remote system
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by tmcdonald »

We'll keep this thread open for a few days in case you run into problems.
Former Nagios employee
daave
Posts: 1
Joined: Wed Feb 21, 2018 1:35 pm

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by daave »

In case this helps anyone else who lands here...

I was scratching my head on this one. I had a case similar to the OP, but a little different. Everything seemed to be in place, but I was getting the "Return Code 255 Out of Bounds" error in Nagios even though everything worked okay if I ran from command line.

My XML file looked something like this:

Code: Select all

<TopLevel>
  [Other stuff here]
  <Success>true</Success>
</topLevel>
I was testing for Success==true, and my command line looked like this:

Code: Select all

define command {
	command_name	web_diag_status
	command_line	$USER1$/check_http_xpath.pl -S -k -H $HOSTADDRESS$ -u /Path/To/Web/Status -c '/Status/Success==true'
}
...but no go.

What I eventually figured out was that I was wanting to test for the STRING true, not the BOOLEAN. I updated my command to add double quotes around "true" like so:

Code: Select all

define command {
	command_name	web_diag_status
	command_line	$USER1$/check_http_xpath.pl -S -k -H $HOSTADDRESS$ -u /Path/To/Web/Status -c '/Status/Success=="true"'
}
...and then it worked OK.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Return Code 255 Out of Bounds from Nagios but not CMD li

Post by tmcdonald »

Thanks for the post, but this topic is over 3 years old at this point so I will be locking it up.
Former Nagios employee
Locked