return code lost during sending check result

Marc Powell marc at ena.com
Wed Sep 21 18:47:16 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Jakub Safar
> Sent: Wednesday, September 21, 2005 10:09 AM
> To: nagios-users
> Subject: [Nagios-users] return code lost during sending check result
> 
> Hello,
> 
> exit return codes of check_ping is lost by Nagios while sending
results
> through NSCA to other Nagios server.
> 
> Command "submit_check_result" is defined like this:
> submit_check_result_via_nsca $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATE$
> '$OUTPUT$'
> 
> submit_check_result_via_nsca includes:
> cmdline="$1;$2;$3;$4"
> $echocmd "$1\t$2\t$3\t$4\n" | $NscaBin $NagiosHost -p $NagiosHostPort
-c
> $NscaCfg
> 

If $3 == $SERVICESTATE$ you need to do some additional processing as
nsca/nagios on the far side are expecting a numerical value. You'll need
to translate $SERVICESTATE$ into the proper exit code before passing it
on to NSCA. See the example submit_check_result code at
http://nagios.sourceforge.net/docs/1_0/distributed.html and verify that
your script performs that translation. 

Additionally, verify that the SERVICESTATE variable is being passed to
submit_check_result properly. It's very likely that it is but to be on
the safe side, try echoing the cmdline to a tmp file somewhere and make
sure that $3 == CRITICAL or OK or whatever the state is before the
translation.

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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