Page 1 of 1
HTML Tags in Service History
Posted: Fri Dec 03, 2021 6:11 am
by optionstechnology
Hey Guys,
I use HTML tags to format my outputs with the "Allow HTML Tags in Host/Service Status" button ticked
However when I view service state history it does not format the HTML tags
Can you make it so that when the settings box is ticked it also formats the history correctly?
Thanks
Re: HTML Tags in Service History
Posted: Fri Dec 03, 2021 5:55 pm
by pbroste
Hello
@optionstechnology
Thanks for reaching out, understand that you want to pass HTML and want to find out more specifics. Are you trying to pass a particular plugin, check results with HTML, or want to send along via email? Example:
We will want to determine if the service check can render an HTML character set on output. If not requires editing to the script.
Thanks,
Perry
Re: HTML Tags in Service History
Posted: Mon Dec 06, 2021 6:10 am
by optionstechnology
Hi,
I am trying to get the service history in nagios to properly treat html tags as html
The html works fine in the output of the check itself - shows up exactly as expected
However when I look at the history it does not format the html as html tags, I can see all of the correct characters there, it has no issue showing them, it simply does not treat them as html
Re: HTML Tags in Service History
Posted: Mon Dec 06, 2021 2:22 pm
by pbroste
Hello
@optionstechnology
Thanks for the update, could you please share a screenshot of the service check output and the service history.
Please PM your updated system profile so we can see how things look from the backend.
To send us your system profile.
- Login to the Nagios XI GUI using a web browser.
- Click the "Admin" > "System Profile" Menu
- Click the "Download Profile" button
- Save the profile.zip file and send via Private Message
Thanks,
Perry
Re: HTML Tags in Service History
Posted: Mon Dec 13, 2021 11:41 am
by optionstechnology
This is how the service looks in the front end-
htmlcodes.PNG
But if I view the history it looks like this-
htmlcodes2.PNG
Re: HTML Tags in Service History
Posted: Tue Dec 14, 2021 12:12 pm
by pbroste
Hello
@optionstechnology
Thanks for following up, went ahead and set up a test service check today on my VM to verify that HTML output functions. Want to have you run through a similar test to verify as well.
In my test I setup
/usr/local/nagios/libexec/check_cpu_stats.sh with HTML output results.
Here is the example output that I am using:
echo "<br><u><font size=4><b>$label user=${CPU_USER}%<font color="green"> system=${CPU_SYSTEM}%</font> iowait=${CPU_IOWAIT}% idle=${CPU_IDLE}% | user=${CPU_USER2}% system=${CPU_SYSTEM2}% </font> iowait=${CPU_IOWAIT2}%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD idle=${CPU_IDLE2}%</b></u></h></br>"
exit $result
Here is the screenshot on the results.
cpustatshtml.png
Please verify that you have HTML tags enabled under Admin > System Settings > Allow HTML Rendering.
Please let me know how things are looking,
Perry
Re: HTML Tags in Service History
Posted: Tue Dec 14, 2021 2:29 pm
by optionstechnology
Can you show me a screenshot of the service history for that check?
Re: HTML Tags in Service History
Posted: Tue Dec 14, 2021 3:06 pm
by pbroste
Hello
@optionstechnology
Thanks for following up, and here is the example screenshot:
serviceresults.png
Thanks,
Perry
Re: HTML Tags in Service History
Posted: Wed Dec 15, 2021 5:56 am
by optionstechnology
SERVICE HISTORY
Not what its current showing, that works - but I want to see the
history of what the service was showing
Click on that service, then click on this button-
servicehistory.png
Re: HTML Tags in Service History
Posted: Wed Dec 15, 2021 10:47 am
by pbroste
Hello
@optionstechnology
Thanks for directing me to the correct page so we are on the same "page". You are correct that the 'service history' page that is referenced does not render 'html'. See the example that I ran through this morning:
servicehistory.png
I will run this past our engineers and then write up a feature request on this.
Thanks,
Perry