Html tags not works correctly

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.
Locked
Tristan44
Posts: 2
Joined: Thu Jun 18, 2015 3:04 am

Html tags not works correctly

Post by Tristan44 »

Hi Everyone,

I just installed a new service based on check_multi command.
This command output is in html.

In cgi.cfg I have set escape_html_tags to 0.

Result of command:

Code: Select all

# ./check_multi -f myapp.cmd -r 2
OK - 4 plugins checked, 0 critical, 0 warning, 0 unknown, 4 ok [please don't run plugins as root!]
<script language='JavaScript'> function Toggle(node) { if (node.nextSibling.style.display == 'none') { if (node.childNodes.length > 0) { node.childNodes.item(0).replaceData(0,1,String.fromCharCode(8211)) } node.nextSibling.style.display = 'block' } else { if (node.childNodes.length > 0) { node.childNodes.item(0).replaceData(0,1,'+') } node.nextSibling.style.display = 'none' } } </script><a onclick='Toggle(this)' style='color:#4444FF;line-height:0.3em;font-size:1.5em;cursor:crosshair'>–</a><div style='display:block'><div><table style='border-left-width:1px; border-right-width:0px; border-left-style:dotted' id='multi_table'><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 1</td></tr></table></td><td></td><td></td><td>sys_ping</td><td>OK - localhost: rta 0,073ms, lost 0%</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 2</td></tr></table></td><td></td><td></td><td>sys_load</td><td>OK - Charge moyenne: 0.02, 0.04, 0.05</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 3</td></tr></table></td><td></td><td></td><td>sys_disk</td><td>DISK OK - free space: / 34516 MB (96% inode=99%); /var 15084 MB (98% inode=99%);</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 4</td></tr></table></td><td></td><td></td><td>web_apache</td><td>PROCS OK: 11 processus avec nom de la commande 'httpd' </td></tr></table></div></div>
Result in Nagios:

Code: Select all

<TR><TD CLASS='dataVar' VALIGN='top'>Status Information:</TD><TD CLASS='dataVal'>OK - 4 plugins checked, 0 critical, 0 warning, 0 unknown, 4 ok<BR><script language='JavaScript'> function Toggle(node) { if (node.nextSibling.style.display == 'none') { if (node.childNodes.length > 0) { node.childNodes.item(0).replaceData(0,1,String.fromCharCode(8211)) } node.nextSibling.style.display = 'block' } else { if (node.childNodes.length > 0) { node.childNodes.item(0).replaceData(0,1,'+') } node.nextSibling.style.display = 'none' } } </script><a onclick='Toggle(this)' style='color:#4444FF;line-height:0.3em;font-size:1.5em;cursor:crosshair'>&ndash;</a><div style='display:block'><div><table style='border-left-width:1px; border-right-width:0px; border-left-style:dotted' id='multi_table'><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 1</td></tr></table></td><td></td><td></td><td>sys_ping</td><td>OK - localhost: rta 0.049ms, lost 0%</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 2</td></tr></table></td><td></td><td></td><td>sys_load</td><td>OK - load average: 0.00, 0.01, 0.05</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 3</td></tr></table></td><td></td><td></td><td>sys_disk</td><td>DISK OK - free space: / 34516 MB (96% inode=99%); /var 15083 MB (98% inode=99%);</td></tr><tr style='font-size:8pt' title=''><td nowrap><table style='background-color:#33FF00'><tr style='vertical-align:middle'><td style='font-size:6pt' title=''> 4</td></tr></table></td><td></td><td></td><td>web_apache</td><td>PROCS OK: 11 processes with command name 'httpd' </td></tr></table></div></div></TD></TR>
Nagios changes the following characters:
- <td nowrap><table style='background-color:#33FF00'> => <td nowrap><table style='background-color:#33FF00'>
- if (node.childNodes.length > 0 ) => if (node.childNodes.length > 0)
- etc...

Please help me.

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Html tags not works correctly

Post by tmcdonald »

What version of Core are you running?
Former Nagios employee
Tristan44
Posts: 2
Joined: Thu Jun 18, 2015 3:04 am

Re: Html tags not works correctly

Post by Tristan44 »

Hi,

The nagios core version is: Nagios® Core™ 4.1.0rc1

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

Re: Html tags not works correctly

Post by abrist »

Is this bug reproducible on stable versions? Either way, the best thing to do would be to file a bug on github: https://github.com/NagiosEnterprises/nagioscore
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