[Nagiosplug-help] RE: "UNKNOWN" problem, with a return code of 0 in solaris 9. (Patrick Walentiny)

Meg Denham Meg.Denham at alphawest.com.au
Thu Dec 11 20:57:00 CET 2003

I had this problem too, and this is the answer I posted to the list back
in July:

 I've been looking for a solution to this problem, and I think I have
it.  The problem is
not so much with check_by_ssh as with the ssh command itself.  If the
ssh command returns 0
from the remote machine, that's what check_by_ssh sees.  I had some
trouble using
check_by_ssh with another perl script called authprogs running the ssh
command on the remote
machine, which always returned a 0 exit status.  When I fixed authprogs
on the remote
machine to return the true plugin return code, then the check_by_ssh
return code was correct

Just rephrasing this, the return code of 0 means that ssh ran okay, but
it doesn't tell you anything about the output of the command that you
ran using ssh.  You will have to change the remote script to do this


> -----Original Message-----
> From: nagiosplug-help-request at lists.sourceforge.net
> [mailto:nagiosplug-help-request at lists.sourceforge.net]
> Sent: Friday, 12 December 2003 3:07 PM
> To: nagiosplug-help at lists.sourceforge.net
> Message: 1
> Date: Thu, 11 Dec 2003 10:48:07 -0600
> From: "Patrick Walentiny" <Patrick.Walentiny at stellent.com>
> To: <nagiosplug-help at lists.sourceforge.net>
> Subject: [Nagiosplug-help] "UNKNOWN" problem, with a return
> code of 0 in solaris 9.
> This is a multi-part message in MIME format.

>             We are using nagios to monitor multiple UNIX
> systems, including Solaris 2.6 8 & 9.  Our method for doing
> so is public keys saved in the "authorized_keys" file of each
> nagios client's home directory etc...  When our server runs
> the "check_by_ssh" against solaris 9 clients, the nagios
> server claims it is getting a status of "UNKNOWN".  I dug in
> to the documentation to find out that this is figured out via
> return codes, IE 0,1,2,3 etc...  So I ran check_by_ssh
> against the system in question to see for myself what the
> problem was. I am only able to get return codes of 0 "OK". 
> I'll show the syntax I used below.  I can get it to also give
> return codes of 1 and 2 if I intentionally invoke a warning
> or critical condition, but when it is run from the nagios
> process itself it shows up as "UNKNOWN", and occasionally
> flaps to okay for brief periods of time, even though the
> status output shows the disks are perfectly okay.
>             Here is my output from my tests....

Alphawest Disclaimer

If this communication is not intended for you and you are not an authorised
recipient of this email you are prohibited by law from dealing with or
relying on the email or any file attachments. This prohibition includes
reading, printing, copying, re-transmitting, disseminating, storing or in
any other way dealing or acting in reliance on the information.
If you have received this email in error, we request you contact Alphawest
immediately by returning the email to postmaster at alphawest.com.au and
destroy the original. This email is confidential and may contain privileged
client information. Alphawest  has taken reasonable steps to ensure the
accuracy and integrity of all its communications, including electronic
communications, but accepts no liability for materials transmitted.

More information about the Help mailing list