Problem sending passive results using NSCA with multi-line output

Holger Weiß holger at cis.fu-berlin.de
Thu Feb 14 00:32:15 CET 2013


* Tech Support <support at voipbusiness.us> [2013-02-13 11:58]:
> foreach my $service ( @services ) {
> 
>     <Blah, Blah, Blah, do some stuff>
> 
>     $nsca_cmd .= "$nscahost\t$service\t$code\t$output";
> 
> };
> 
> my $retval = `$system /bin/echo -e "$nsca_cmd" | $nscaprog -H $nagioshost -c
> $nscacfg`;
> 
> Like I said, Nagios is choking when the output contains multi-line output.

This looks like you're using a send_nsca version < 2.9, where multiple
check results were seperated using newlines.  In that case, you'll have
to replace each newline character within multi-line output with the
literal string '\n'.

With NSCA >= 2.9, multiple check results are seperated using ASCII ETB
characters (octal value: 27) instead of newlines, and multi-line output
can be piped into send_nsca as-is.  (Actually, converting the newline
characters into '\n' will no longer work with NSCA >= 2.9.)

Holger

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
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