Email of multiline service check output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Email of multiline service check output

Post 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?
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email of multiline service check output

Post by scottwilkerson »

Make the following changes in the host message change %hostoutput% to %longhostoutput%

In the service message change %serviceoutput% to %longserviceoutput%
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: Email of multiline service check output

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email of multiline service check output

Post by scottwilkerson »

What version of XI are you using? I didn't believe we were stripping HTML tags out of email templates...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: Email of multiline service check output

Post 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?!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email of multiline service check output

Post by scottwilkerson »

This must be your mail server stripping the emails because I can add HTML output to my messages without issue...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: Email of multiline service check output

Post 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?
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: Email of multiline service check output

Post 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)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email of multiline service check output

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mroter
Posts: 80
Joined: Sun Apr 29, 2012 12:43 pm

Re: Email of multiline service check output

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