Status information unknown, but status OK and green

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
gsmith411
Posts: 3
Joined: Thu Jun 05, 2014 8:27 am

Status information unknown, but status OK and green

Post by gsmith411 »

I have Nagios checking a few services on a remote host. The Status information returns "Return code of 255 is out of bounds", and yet the Status is OK with a green bar. How do I change Nagios to show me when the status is unknown? I would like the status to be yellow, or orange or anything else, but obviously the service is not OK if the return code is 255.

Ill troubleshoot the return code of 255 separately, but now do I get nagios to let me know when something is not OK. A return code of 255 indicates something is wrong, and I just want an alert of some sort to let me know that.

Thank you for the help
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Status information unknown, but status OK and green

Post by eloyd »

Sounds like you need to fix your service check first.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
gsmith411
Posts: 3
Joined: Thu Jun 05, 2014 8:27 am

Re: Status information unknown, but status OK and green

Post by gsmith411 »

Like I said, I realize I need to check why I am getting the return code of 255 and thats a whole different subject. My concern is that the service check is in an unknown state, and yet Nagios is telling me the status is OK.

BTW, I am running Nagios Core 4.0.4 on a gentoo box. This particular check is running a check_proc on a remote box via check_by_ssh. The reason it isn't working is because I failed to install the nagios plugins on the remote box. The fix is relatively easy, but the problem is that Nagios is telling me the service check status is OK when obviously, it isn't
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Status information unknown, but status OK and green

Post by eloyd »

Is this a Nagios supplied plugin service check or one you made yourself? If it's one you made yourself, you should really make sure that it never returns anything other than proper Nagios exit values.

Be that as it may, the only way to know what's going on is to look at your nagios log file, /usr/local/nagios/var/nagios.log (assuming default path). Is Nagios actually performing the check and logging the results?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
gsmith411
Posts: 3
Joined: Thu Jun 05, 2014 8:27 am

Re: Status information unknown, but status OK and green

Post by gsmith411 »

Thanx for the quick reply. Its 2 nagios supplied checks. On the nagios server, I am running check_by_ssh. This check should log into the remote machine and run the nagios supplied script check_procs. Both are nagios supplied. I would assume they should return correct values.
The reason the Check_by_ssh script is failing is known. Its supposed to call the check_procs script on the remote host, but that check_procs script doesn't exist. Is it a problem with the check_by_ssh script that is return "OK" instead of "fail"?

Again, I can fix the problem that is causing the Return code 255. What I am trying to figure out is why Nagios says the check results are OK, when the results are unknown.

Thanx for the help
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Status information unknown, but status OK and green

Post by abrist »

Very interesting. I just tested check_by_ssh against a script on my gentoo box that does not exist:

Code: Select all

[root@localhost nagios-plugins]# ./plugins/check_by_ssh -H localhost -C '/usr/local/nagios/libexec/check_not_exist'
Remote command execution failed: bash: /usr/local/nagios/libexec/check_not: No such file or directory
[root@localhost nagios-plugins]# echo $?
3
And I get the expected return of '3' (Unknown).
Can you post the full definitions for the command and service check and host?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Status information unknown, but status OK and green

Post by eloyd »

I find that stock check_by_ssh was woefully inadequate for our needs and wrote our own SSH wrapper. Among other things, it deals nicely with missing endpoint scripts and only allows commands run from a select list. As a result, it's been a long time since I've played with stock check_by_ssh, but if yours is returning incorrect status, I'm thinking that you might have an old version.

Be that as it may, I still think you need to fix this before you can look at what's going on with Nagios itself.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Status information unknown, but status OK and green

Post by scottwilkerson »

eloyd wrote:I find that stock check_by_ssh was woefully inadequate for our needs and wrote our own SSH wrapper.
Any possibility of sharing this? :D
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Status information unknown, but status OK and green

Post by eloyd »

I maybe shouldn't have said "woefully." :-) I've PMed Andy about it, but no, I cannot share it. It was developed under NDA for a previous client of ours. In a nutshell, the deficiencies were related to the security measures in place at the client's site. We needed to be able to secure the commands executed so no arbitrary code could be put in place, and we needed to be able to use a man-in-the-middle approach to have Nagios -> SSH -> host -> SSH -> client and have the check actually run on client, not host.

Please forgive my hyperbole, and catch me at NW2014 and I'll be happy to talk in person.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked