Most Recent Alerts Report Issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Most Recent Alerts Report Issue

Post by slansing »

Thank you, we will get back to you once we have reviewed the information and tried to reproduce the problem.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Most Recent Alerts Report Issue

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

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

Re: Most Recent Alerts Report Issue

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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=`~$&|'"<>

abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post 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!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
EchoKev
Posts: 40
Joined: Tue Jul 02, 2013 11:35 am

Re: Most Recent Alerts Report Issue

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post 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 . . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Most Recent Alerts Report Issue

Post by abrist »

Run the check from the cli and post the output. The html output in pm may be truncated.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked