Page 1 of 1
HTML in command and truncated links.
Posted: Wed Oct 29, 2014 1:39 pm
by rseiwert
In XI one plugin I use alot is check_openmanage. One feature is that it gives my a hyperlink straight to the warrenty and documentation for this system. I turned this off when I moved to XI. Now that we can enable HTML in check I went to turn this feature back on but found it caused XI to display improperly. When I started to debug the check_openmange I found the HTML that it generated was clean and good but something in XI makes it invalid. It does display fine in Core but in XI it trucates the Output and never closes the <a> tag. If I enable this feature I can never see the full check output in XI.
The output from the check looks like
Code: Select all
OK - System: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/us/en/19/Product/poweredge-r520#ui-tabs-4">PowerEdge R520</a>', SN: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/Index?t=warranty&servicetag=DHJ57W1">DHJ57W1</a>', 16 GB ram (4 dimms), 1 logical drives, 8 physical drives
----- BIOS='1.6.7 08/30/2013', iDRAC7='1.23.23 (Build 1)'
In Core it looks OK

Re: HTML in command and truncated links.
Posted: Wed Oct 29, 2014 1:40 pm
by slansing
Looks like the images you added are broken, any chance you can edit and re-attach them?
Re: HTML in command and truncated links.
Posted: Thu Oct 30, 2014 11:38 am
by rseiwert
Sorry, had an internal domain listed. My bad, should be visible now.
Re: HTML in command and truncated links.
Posted: Thu Oct 30, 2014 5:10 pm
by slansing
Hmm, what is strange as it links PowerEdge correctly, but cuts off at the 'D' in the serial number. I'm going to try to reproduce this to some extent and see what I come up with.
Edit: So far unable to reproduce, going to have to find a plugin to modify with html link tags in it's status output.
Re: HTML in command and truncated links.
Posted: Wed Nov 05, 2014 11:39 am
by rseiwert
Curious if anyone knows why my checks are getting truncated in XI. Seem to work OK in Core. I have a few simple hyperlinks in my check results which I believe is supported now in XI which are causing the problem. If no a solution maybe a nudge towards the php script which is chopping up the check results so I can debug XI.
Code: Select all
COMMAND: /usr/local/nagios/libexec/check_openmanage -H citrix2.xxx.com -p -e -o 1 -I -check power=0,voltage=0
OUTPUT: OK - System: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/us/en/19/Product/poweredge-2950#ui-tabs-4">PowerEdge 2950 II</a>', SN: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/Index?t=warranty&servicetag=50H5XD1">50H5XD1</a>', 14 GB ram (8 dimms), 1 logical drives, 2 physical drives<br/>----- BIOS='2.7.0 10/30/2010', BMC='2.37.00'|T0_System_Board_Ambient=19C;42;47 F0_System_Board_FAN_1=7350rpm;0;0 F1_System_Board_FAN_2=7275rpm;0;0 F2_System_Board_FAN_3=7350rpm;0;0 F3_System_Board_FAN_4=7350rpm;0;0
generates the following in XI. You can see where the check is truncated.
Code: Select all
<!--state summary-->
<div class="service_state_summary" id="service_state_summary_rirl7c">
<div class="servicestatusdetailinfo">
<div class="servicestatusdetailinfoimg">
<img src='http://xxx.xxx.com/nagiosxi/images/nagios_ok_large.png' alt='Ok' title='Ok' width='24'>
</div>
<div class="servicestatusdetailinfotext">
OK - System: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/us/en/19/Product/poweredge-2950#ui-tabs-4">PowerEdge 2950 II</a>', SN: '<a target="_blank" href="http://www.dell.com/support/troubleshooting/Index?t=warranty&servicetag=50H
</div>
<div class="servicestatusdetailinfotextlong"></div>
</div><br clear="all">
</div> <!--service_state_summary-->
Re: HTML in command and truncated links.
Posted: Wed Nov 05, 2014 5:39 pm
by tmcdonald
Are all your HTML-output checks breaking at the same spot? 255 characters in or so? If this is the case it might be a database table's column size that needs to be increase.
Re: HTML in command and truncated links.
Posted: Fri Nov 07, 2014 3:30 pm
by rseiwert
Yes, my checks are truncated at 255 chars. Is this normal?
If it was a database column width (which database were you thinking about) would it still look OK in Nagios Core but be truncated in XI?
Is this something that can be tweaked easily?
Re: HTML in command and truncated links.
Posted: Fri Nov 07, 2014 6:51 pm
by rseiwert
To answer my own questions
XI truncating the output at 255 chars is normal for XI. I understand you don't want huge results on the first line but if you have long hyperlinks embedded in your check results, or a long check result it will be truncated. I did know it was short, just amazed by how short. Back in the day when everything had to fit into an SMS message I guess this made sense. I do understand you don't want a huge status but a status that displays a concise info with hyperlinks to say a runbook or in my case the service contract status, service history, and system manuals is very helpful when there is an issue. Truncating the check in mid-HTML tag also created an unterminated HTML <a> tag and a new issue where the alert immediately after the Open Manage alert was swallowed up by the truncated alert and did not show on the NOC or Service Status Pages.
Core seems to be able to handle more the 255 chars no problem.
This can be easily tweaked using the mysql command "alter table nagios_servicestatus modify output varchar(1024) not null;". After doing this my XI Noc and Service Status displays stopped being all screwed up.
Thanks for everyone's time and consideration in matter. You can close issue.