Jean Raby
2013-04-30 20:18:08 UTC
Hi,
I've been trying to understand why long plugin output wouldn't show up in nagios
when the plugin was called via MRPE. (for the record, I was testing with
check_logfiles --report=long)
For a little background, from the nagios/icinga docs, plugin output can have the
following format:
TEXT OUTPUT | OPTIONAL PERFDATA
LONG TEXT LINE 1
LONG TEXT LINE 2
...
LONG TEXT LINE N | PERFDATA LINE 2
PERFDATA LINE 3
...
PERFDATA LINE N
After looking at the code it was quite clear that check_mrpe() would only
consider the TEXT OUTPUT part of the first line, since it is splitting on the
pipe symbol and taking the first part as the text output. Anything after it is
considered performance data.
I've attached 2 patches to try to address this issue. It might not be the
cleanest way to handle this, in particular it doesn't support extra performance
data lines, but at least $LONGSERVICEOUTPUT$ gets correctly filled.
Hopefully this will be useful to someone.
Cheers!
I've been trying to understand why long plugin output wouldn't show up in nagios
when the plugin was called via MRPE. (for the record, I was testing with
check_logfiles --report=long)
For a little background, from the nagios/icinga docs, plugin output can have the
following format:
TEXT OUTPUT | OPTIONAL PERFDATA
LONG TEXT LINE 1
LONG TEXT LINE 2
...
LONG TEXT LINE N | PERFDATA LINE 2
PERFDATA LINE 3
...
PERFDATA LINE N
After looking at the code it was quite clear that check_mrpe() would only
consider the TEXT OUTPUT part of the first line, since it is splitting on the
pipe symbol and taking the first part as the text output. Anything after it is
considered performance data.
I've attached 2 patches to try to address this issue. It might not be the
cleanest way to handle this, in particular it doesn't support extra performance
data lines, but at least $LONGSERVICEOUTPUT$ gets correctly filled.
Hopefully this will be useful to someone.
Cheers!
--
Jean
Jean