tags:

views:

1673

answers:

3

I am getting the error (Return code of 255 is out of bounds) on the http://localhost/nagios

But whe I run the command from #bash.. It runs fine

any suggestions

Regards

+1  A: 

A Nagios check should return 0, 1, 2 or 3:

  • 0: OK
  • 1: Warning
  • 2: Critical
  • 3: Unknown

An exit status of 255 is perfectly valid when you run the command manually, so bash won't complain. You can check the exit status of the command in the variable $? after the command has run with:

echo $?
Anders Lindahl
when echo $? I got zero.But as I have mentioned I am seeing NRPE: Unable to read output on the nagios webpageRegards
bala
A: 

You mention that you are calling the check command via nrpe. If you are using a check command which returns multi-line output you must use a recent version of nrpe that also supports multi-line output otherwise the check_nrpe script will not be able to parse the output.

Dave Rawks
A: 

If you're using NRPE and receiving a 'NRPE: Unable to read output' error it is because the NRPE daemon is not returning text data. The Nagios core depends on NRPE daemons to return a string that summarizes the results of the checks. For instance, for a check result that is returning a healthy status, it may look like the former whereas an unhealthy status would be displayed the the latter.

OK - load average: 1.56, 1.37, 1.29 
CRITICAL - load average: 16.59, 19.41, 21.96 

If NRPE were to return something like this:

FOO: bar 

You're going to get a 'NRPE: Unable to read output' error because FOO is not one of Nagios's known result states. Run the remote NRPE command by running something like this (depending on your directories and checks):

libexec/check_nrpe -n -H localhost -c check_load

That should return OK, WARNING, CRITICAL, or UNKNOWN. Anything else will cause that error.

gnucom
You should probably run the check_nrpe command on the Nagios server and specify the external host running the service in question.
Borealid