strange behaviour when plugin output is containing the string "\n" in Nagios 3.0rc1
Ethan Galstad
nagios at nagios.org
Thu Jan 24 15:14:07 CET 2008
Marcus Hildenbrand wrote:
> Hi,
>
> if a plugin is containing the string "\n" in its output I found some strange
> output in status_file. For example if the output of the plugin looks like this:
>
> # some_plugin
> test\ntmon\test\abc
> # echo $?
> 0
> #
>
> the status_file for this service is containing lines like this:
>
> servicestatus {
> ...
> ...
> plugin_output=test\
> long_plugin_output=tmon\\\\test\\\\abc\n
> ...
> ...
> }
>
> Also the trailing \ in plugin_output line sometimes seems to confuse the CGI's
> in a way that they are dumping:
>
> # setenv REQUEST_METHOD POST
> # setenv CONTENT_LENGTH 4
> # echo all | ./tac.cgi
> Segmentation fault (core dumped)
>
> Is this a bug in Nagios or is it not allowed that the plugin output contains \n?
>
> Thanks and regards
> Marcus
>
Thanks for the report Marcus! There was a bug in the newline/backslash
escape logic. I'm posting a fix to CVS in a few moments...
Ethan Galstad
Nagios Developer
___
Email: nagios at nagios.org
Web: www.nagios.org
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
More information about the Developers
mailing list