Page 2 of 4

Re: Most Recent Alerts Report Issue

Posted: Mon Jul 08, 2013 4:11 pm
by EchoKev
lmiltchev wrote:We tested the same scenario on many different machines, but we were not able to recreate the issue. Let's try the following - generate the same report (as on screenshot), right-click on it, select "This Frame->Save Frame As...", and save the report (it will be saved as "Nagios Event Summary.htm"). PM me the report, so that we can review it and possibly debug the issue.
PM sent.

Re: Most Recent Alerts Report Issue

Posted: Mon Jul 08, 2013 4:35 pm
by slansing
Thank you, we will get back to you once we have reviewed the information and tried to reproduce the problem.

Re: Most Recent Alerts Report Issue

Posted: Tue Jul 09, 2013 9:32 am
by scottwilkerson
It appears that the listing on 06-10-2013 07:07:45 is somehow injecting a <title> tag before the output. Is this check returning HTML?

Re: Most Recent Alerts Report Issue

Posted: Tue Jul 09, 2013 12:08 pm
by EchoKev
I believe the check is looking for a line on a webpage with the text starting with <title> to verify that correct branding/title text is being displayed.

Am I right in assuming that you are stating that nagios is trying to display the html code from the return information for the check, instead of just treating it as string text to display? If so, is it possible to get nagios to assume that all return information is just string text and to not try to render it?

Thanks.

Re: Most Recent Alerts Report Issue

Posted: Tue Jul 09, 2013 3:20 pm
by scottwilkerson
The nagios.cfg has a field illegal_macro_output_chars that by default should contain

Code: Select all

illegal_macro_output_chars=`~$&|'"<>
Which would strip these out.

Have you modified this?

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 8:45 am
by EchoKev
Nope,

This line is still in the file, unmodified:

Code: Select all

# ILLEGAL MACRO OUTPUT CHARACTERS
# This option allows you to specify illegal characters that are
# stripped from macros before being used in notifications, event
# handlers, etc.  This DOES NOT affect macros used in service or
# host check commands.
# The following macros are stripped of the characters you specify:
#       $HOSTOUTPUT$
#       $HOSTPERFDATA$
#       $HOSTACKAUTHOR$
#       $HOSTACKCOMMENT$
#       $SERVICEOUTPUT$
#       $SERVICEPERFDATA$
#       $SERVICEACKAUTHOR$
#       $SERVICEACKCOMMENT$

illegal_macro_output_chars=`~$&|'"<>


Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 3:49 pm
by abrist
Check to make sure yo have enabled escaping of html tags in your cgi.cfg:

Code: Select all

grep escape_html /usr/local/nagios/etc/cgi.cfg
If it does not exist, or if it is set to '0', enable it by changing its value to '1' or if missing, by adding the line:

Code: Select all

escape_html_tags=1
to the file /usr/local/nagios/etc/cgi.cfg

Don't forget to restart the nagios service after this change!

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 3:52 pm
by EchoKev
It is already set:

Code: Select all

root@monitor:/usr/local/nagios/etc# grep escape_html /usr/local/nagios/etc/cgi.cfg
escape_html_tags=1

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 4:07 pm
by abrist
This is very interesting as I could reproduce your problem with that directive set to '0'. I will see if I can get Scott to forward your pm to me so I can take a look as well . . .

Re: Most Recent Alerts Report Issue

Posted: Wed Jul 10, 2013 4:35 pm
by abrist
Run the check from the cli and post the output. The html output in pm may be truncated.