Return Code of 4

Weiner, Michael weinerm at ccf.org
Fri Apr 16 19:06:54 CEST 2010


-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 

On 04/15/2010 10:32 PM, Weiner, Michael wrote:
> 
> $USER1$/check_pool my-backup-server 100 20 Scratch ALL
> 
> The check_pool script simply users vmquery via sudo in order to
elevate
> the nagios users' rights to be that of root and run the appropriate
> command:
> 
> sudo -u nagios /usr/local/openv/volmgr/bin/vmquery -h my-backup-server
> -b -pn Scratch
> 
> Running this at the command line (even as user nagios) succeeds and
> gives me
> 
> Scratch OK : available tapes 121|Scratch=121;100;20
> 
> However once I add this as a service check to nagios I receive the
> following:
> 
> Warning: Return code of 4 for check of service 'Scratch_Pool_Check' on
> host 'my-backup-server' was out of bounds.
> 

Try this from your Nagios server:

true; echo $?
false; echo $?

Those are return codes. A numerical value the running program sets for
the master program to reap. The textual output has absolutely nothing
to do with that return code.

If you run the check exactly like Nagios does it and then, immediately
after having run the check, run the command

echo $?

you will get the return code of the check command. Note that you can
only inspect $? once, as it takes a new value for each command you run.

Thanks Andreas -

I did a little testing and it seems that if I fail to put in all the
arguments the script requires at the command line and then do an 'echo
$?' I receive a return code of 4. So, there must be something wrong with
my checkcommand that I have in nagios. I will dig and see what I can
come up with.

Thanks again
Michael

===================================

P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S.News & World Report (2009).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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





More information about the Users mailing list