Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bernhara
Posts: 3
Joined: Thu Jan 15, 2015 4:34 am

Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Post 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
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Post by tgriep »

Could you post your plugin and how the check command is defined so we can review it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
bernhara
Posts: 3
Joined: Thu Jan 15, 2015 4:34 am

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Post 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...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Post by abrist »

So it is working after all?
Are you using mod_gearman? (there was a newline bug with core4 and gearman)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
bernhara
Posts: 3
Joined: Thu Jan 15, 2015 4:34 am

Re: Changes in version 4.0.8 for LONGSERVICEOUTPUT?

Post 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.
Locked