Page 1 of 1

Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Posted: Thu Jan 15, 2015 5:52 am
by bernhara
I upgraded recently from 3.5 to 4.0.8.

In 3.5, I made some tests to check the behavior of LONGSERVICEOUTPUT: I formated the output of my plugin as explained in the documentation, and expected things happened.

Now, with 4.0.8 it seems to me that there is a new bug in the decoding of plugin output...

I wrote a very simple plugin which return exactly the output showed in the documentation: http://nagios.sourceforge.net/docs/nagi ... inapi.html ("DISK OK - free...").
And when I look at the GUI, the example of the documentation is not decoded as explained by the documentation.

It is decoded in the following way:

Status Information: DISK OK - free space: / 3326 MB (56%):
Performance Data: /=2643MB;5948;5958;0;5968 / 15272 MB (77%); /boot 68 MB (69%); /home 69357 MB (27%); /var/log 819 MB (84%); | /boot=68MB;88;93;0;98 /home=69357MB;253404;253409;0;253414 /var/log=818MB;970;975;0;980

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Posted: Thu Jan 15, 2015 3:50 pm
by tgriep
Could you post your plugin and how the check command is defined so we can review it?

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Posted: Mon Jan 26, 2015 4:43 am
by bernhara
To answer you, I tried to write a very simple plugin (simplier than my plugin having problems). And I associated this plugin to a brand new service.

Code: Select all

#! /bin/bash

echo 'DISK OK - free space: / 3326 MB (56%); | /=2643MB;5948;5958;0;5968
/ 15272 MB (77%);
/boot 68 MB (69%);
/home 69357 MB (27%);
/var/log 819 MB (84%); | /boot=68MB;88;93;0;98
/home=69357MB;253404;253409;0;253414
/var/log=818MB;970;975;0;980'

exit 0
And it works as expected and as the documentation says. :oops:

So the problem comes from elsewhere...

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Posted: Mon Jan 26, 2015 12:00 pm
by abrist
So it is working after all?
Are you using mod_gearman? (there was a newline bug with core4 and gearman)

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Posted: Wed Jan 28, 2015 9:21 am
by bernhara
My fault! :oops:

For convenience, I wrapped my own plugins with a shell script that makes various things related to my project.

And in that shell script, I wrote
echo $called_nagios_plugin_output
instead of
echo "$called_nagios_plugin_output"

Without the quotes, the shell script eats my end of lines.

Problem is now fixed and thanks for your interaction.