"UNKNOWN" problem, with a return code of 0 in solaris 9.

jpttdi jpttdi at yahoo.fr
Fri Dec 12 10:10:22 CET 2003


Hi,
 
I have exactly the same problem with a host running SCO SV 5.0.4.
(Nagios server version 1.1)
 
My checkcommand is:
 
$USER1$/check_by_ssh -H $HOSTADDRESS$ -C "/u/nagios/check_log.sh $ARG1$ $ARG2$ $ARG3$" -t 20 -l nagios
 
There is no ssh connection problem, and the check_log.sh plugin works fine (the plugin look for the pattern "WARNING" in /var/adm/messages).

The check_log.sh is my shell version of the check_log plugin, there is no "exit" with return code of 3 in it.
 
I have try to run this command from the command line on the nagios server, connected as user nagios, i never been able to return an unknown status.
 
The execution always return the right answer "OK - Log check Ok - No pattern match found" (or Critical if the pattern is found) but nearly everytime with an unknown status (9/10).
 
On the same host, another service have the same problem, but the UNKNOWN status comes only one or two times a day ...
 
Is it possible that this return code comes from the check_by_ssh plugin ? (there's no additionnal information even with the verbose output, i have try to look in the source code but i'm far from a "C guru" ...).
 
 
Thanks.
Jpt.

Patrick Walentiny <Patrick.Walentiny at stellent.com> wrote:
/************************************/

It's funny, no matter what the circumstance the remote plugin always
claims it is okay. The return code (either from the remote plugin, or
the local check_by_ssh plugin is returning a 3, but ONLY if nagios
itself runs it.


-----Original Message-----
From: Marc Powell [mailto:marc at ena.com] 
Sent: Thursday, December 11, 2003 12:16 PM
To: Patrick Walentiny; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] "UNKNOWN" problem, with a return code of 0
in solaris 9.



________________________________________
From: Patrick Walentiny [mailto:Patrick.Walentiny at stellent.com] 
Sent: Thursday, December 11, 2003 10:38 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] "UNKNOWN" problem, with a return code of 0 in
solaris 9.

I looked through a lot of the mail list archives and didn't see this
problem listed by anyone else. It's a bit long winded but I figure
being verbose is better than not being verbose enough. So here goes.
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....


[...]

$ /usr/lib/nagios/plugins/check_by_ssh -H 12.40.185.175 -C
'/opt/nagios/libexec/check_disk -c 10% -w 20%'
$ echo $?
0
$


It appears that the plugin isn't being executed on the remote host.
Check_by_ssh should return the output of the check_disk command to the
command line:

bash-2.05a$ ./check_by_ssh -H -C
'/usr/local/nagios/libexec/check_disk -c 10% -w 20%'
DISK OK - [3434680 kB (47%) free on /dev/ida/c0d0p3] [107450 kB (89%)
free on /dev/ida/c0d0p1] [257216 kB (100%) free on none]

Is the plugin (check_disk) executable by the user that you are ssh'ing
as and in the location specified? How about /bin/df (at least that's
what it uses under linux)? It needs to be executable by the nagios user
as well.

--
Marc 




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null



---------------------------------
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Testez le nouveau Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20031212/1ef7fb9d/attachment.html>


More information about the Users mailing list