Page 1 of 1

Nagvis check_iftraffic3

Posted: Tue Apr 10, 2012 3:21 am
by regulor2322
Hi everobody,

I currently work on integrations of cacti fonctionalities on Nagios XI. For do that, I use the plugin "check_iftraffic3.pl" for display a weathermap style under Nagvis.

All work very nice but I don't like a detail. The line type "--%+BW-><-%+BW--" dispaly an average (BW) and I want to view instant traffic.

I think I need to modified the code but how ?

Who can help me ?

Thanks & Regards

OS: Centos
Nagios: Nagios XI 2011R2.1

Re: Nagvis check_iftraffic3

Posted: Tue Apr 10, 2012 10:07 am
by scottwilkerson
I am certainly no expert on NagVis, and you would probably get the best answer on the NagVis site, http://www.nagvis.org/support

However, before I go further, bandwidth utilization is something that is usually measured at intervals, not at an instant.

That said, I found the doc for the weathermap styles
http://docs.nagvis.org/1.6/en_US/lines_ ... style.html

Re: Nagvis check_iftraffic3

Posted: Wed Apr 11, 2012 2:26 am
by regulor2322
Thanks for your reply,

I found this documentation too, and at the end she said "weathermap lines" need specific perfdata format. But I want to modify this perfdata :) .

In the file named "lines.js", I see this :

case '14':
// -%+BW-><-%+BW- lines
var xMid = middle(x1, x2, cut);
var yMid = middle(y1, y2, cut);
// perfdataA contains the percentage info
// perfdataB contains the bandwith info
if(isset(perfdata[0]) && isset(perfdata[0][1]) && isset(perfdata[0][2]))
perfdataA = perfdata[0][1] //+ perfdata[0][2];
if(isset(perfdata[2]) && isset(perfdata[2][1]) && isset(perfdata[2][2]))
perfdataB = perfdata[2][1] //+ perfdata[2][2];
drawArrow(objectId, x1, y1, xMid, yMid, z, width, colorFill, colorBorder);
drawLinkOrLabel(objectId, lineType, x1, y1, xMid, yMid, z, perfdataA, perfdataB, cutOut, bLinkArea, bLabelShow);

if(isset(perfdata[1]) && isset(perfdata[1][1]) && isset(perfdata[1][2]))
perfdataA = perfdata[1][1] //+ perfdata[1][2];
if(isset(perfdata[3]) && isset(perfdata[3][1]) && isset(perfdata[3][2]))
perfdataB = perfdata[3][1] //+ perfdata[3][2];
drawArrow(objectId, x2, y2, xMid, yMid, z, width, colorFill2, colorBorder);
drawLinkOrLabel(objectId, lineType, x2, y2, xMid, yMid, z, perfdataA, perfdataB, cutIn, bLinkArea, bLabelShow);
break;
default:

If I modify this file, for example I comments all the second section, no change occurs...

I have no skills in javascript, it need to restart services for changes take effect ?

Thanks & Regards.

Re: Nagvis check_iftraffic3

Posted: Wed Apr 11, 2012 8:48 am
by scottwilkerson
Again, you would probably get the best answer on the NagVis site, http://www.nagvis.org/support

I do know that you shouldn't need to restart anything for changes to a .js file to take effect, just reload the webpage