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?
Email of multiline service check output
Email of multiline service check 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
Make the following changes in the host message change %hostoutput% to %longhostoutput%
In the service message change %serviceoutput% to %longserviceoutput%
In the service message change %serviceoutput% to %longserviceoutput%
Re: Email of multiline service check output
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):
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
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
We are on the latest version
Should we install a special HTML mail plugin for this purpose?!Nagios XI 2012R1.2 Copyright © 2008-2012 Nagios Enterprises, LLC.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Email of multiline service check output
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
We are using sendmail (not our mail server via SMTP) on the Nagios server box.
Where can we tell it not to "strip" HTML?
Where can we tell it not to "strip" HTML?
Re: Email of multiline service check output
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)
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
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.
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
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.
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.