Page 1 of 2

Email of multiline service check output

Posted: Wed Nov 28, 2012 9:52 am
by mroter
We have a plugin that returns multiple line output. If we use "\n" at the end of the first line then we get the first line only in the UI (which is great) and the rest we get in long output (multiline) which is also grate.
Please see the attached screenshot from check_mk multisite.

The problem is that the notification email, sent by nagiosxi, contain only the first line terminated by the "\n". What should we configure in the email template to get all the output?

Re: Email of multiline service check output

Posted: Wed Nov 28, 2012 10:11 am
by scottwilkerson
Make the following changes in the host message change %hostoutput% to %longhostoutput%

In the service message change %serviceoutput% to %longserviceoutput%

Re: Email of multiline service check output

Posted: Thu Nov 29, 2012 2:24 am
by mroter
Thanks!
One more issue remain though, the HTML formatting is not kept. The HTML tags are modified and the result is as follows (compare to the HTML in the screenshot):
Long Info:
tabletrthuserid/ththpermissionid/ththAttributeValue/th/trtrtd32/tdtd636/tdtd\\172.21.103.190\d\Mailbox - LMEData\CM Data\UniCredit\ReceiveLocation/td/trtrtd32/tdtd636/tdtd\\FS1-RVL-NY\MM\Files\Out\UnicreditExcel/td/trtrtd32/tdtd636/tdtd\\FS1-RVL-NY\MM\Files\SDIn\UnicreditExcel/td/trtrtd32/tdtd636/tdtd\\FS1-RVL-NY\MM\Files\SDOut\UnicreditExcel/td/trtrtd73/tdtd635/tdtdfalse/td/trtrtd73/tdtd630/tdtdSDDavidGershon/td/trtrtd73/tdtd633/tdtdSDDavidGershon/td/trtrtd73/tdtd634/tdtdSDDavidGershon/td/trtrtd73/tdtd635/tdtdSDDavidGershon/td/tr/table\n

Re: Email of multiline service check output

Posted: Thu Nov 29, 2012 8:07 am
by scottwilkerson
What version of XI are you using? I didn't believe we were stripping HTML tags out of email templates...

Re: Email of multiline service check output

Posted: Thu Nov 29, 2012 11:53 am
by mroter
We are on the latest version
Nagios XI 2012R1.2 Copyright © 2008-2012 Nagios Enterprises, LLC.
Should we install a special HTML mail plugin for this purpose?!

Re: Email of multiline service check output

Posted: Thu Nov 29, 2012 2:33 pm
by scottwilkerson
This must be your mail server stripping the emails because I can add HTML output to my messages without issue...

Re: Email of multiline service check output

Posted: Thu Dec 13, 2012 10:34 am
by mroter
We are using sendmail (not our mail server via SMTP) on the Nagios server box.
Where can we tell it not to "strip" HTML?

Re: Email of multiline service check output

Posted: Thu Dec 13, 2012 10:41 am
by mroter
To clarify:
The email we get is in HTML format
It looks like the data in the $SERVICEOUTPUT$ and $LONGSERVICEOUTPUT$ (nagios macros) is modified not to include the html tags ("<" and ">" are stripped)

Re: Email of multiline service check output

Posted: Thu Dec 13, 2012 2:35 pm
by scottwilkerson
Oh, now I see.

your plugin is returning the whole html... I thought it was just returning the values inside of that

There is a setting that specifies the illegal_macro_output_chars in the nagios.cfg that will strip then out.

Unfortunately as the macros are passed on the command line, these need to remain because <> will redirect output and have strange unexpected results.

Re: Email of multiline service check output

Posted: Fri Dec 14, 2012 8:02 am
by mroter
Ok.
You can see above that the Check_mk GUI is displaying the HTML correctly. I can even swear that it was displayed correctly in the Nagios XI gui on one of our servers. So the question is how we can go around it?
We return multiple lines from an sql plugins that we must format.
Can we escape it? If we use other char we shall have a problem with the GUI.