check_openmanage and linebreaks
Trond Hasle Amundsen
t.h.amundsen at usit.uio.no
Fri Feb 11 18:38:38 CET 2011
"Bryan O'Shea" <bryanoshea3 at gmail.com> writes:
> check_openmanage and linebreaks not working in $SERVICEOUTPUT$ emails.
>
> When using the either of the following options the linebreaks seem to be broken:
> -e or --postmsg
>
> This is what i get in my service notification emails instead of the
> desired output of seperate lines.
>
> "Power Supply 1 [AC] needs attention: Presence detected, Failure
> detected, AC lostbr/NOTE: PowerEdge 2950 III 437RQH1 -
> 555-1212"
>
> It puts a br/ in instead of a "\n".
Hi Bryan,
The default behaviour of check_openmanage is to use HTML linebreaks when
run from Nagios, NRPE etc., and regular linebreaks in a console which
has a TTY. The reason for this is that the plugin monitors several
things, and in case of multiple alerts it's practical to display them
each on a different line.
However, since this behaviour doesn't fit everyone you can modify it
with the '--linebreak' switch. To switch to regular (\n) linebreaks:
check_openmanage --linebreak=REG
You can also specify any string as a custom linebreak:
check_openmanage --linebreak=' -- '
If you choose regular linebreaks, the first line will be put in the
SERVICEOUTPUT macro, while any subsequent lines will be put in the
LONGSERVICEOUTPUT macro. This is how Nagios 3.x handles multiline output
from plugins.
PS. In order for the default HTML linebreaks to work as indended in the
web frontend, you should set "escape_html_tags=0" in the Nagios config.
Cheers,
--
Trond H. Amundsen <t.h.amundsen at usit.uio.no>
Center for Information Technology Services, University of Oslo
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
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