bbmrtg.pl help
list Jared Hoskinson
Hello all I need to alarm on bandwidth thresholds so I have added bbmrtg.pl using this guide, http://www.pleiades.com/mrtgbb/. Everything is working expect when bbmrtg.pl runs it reports "In: bytes/sec (0.0%) Out: bytes/sec (0.0%)". When look at the graph produced by mrtg-rrd.cgi, it reports the correct usage which in case is "Current In: 68.8 Mb/s Current Out: 25Mb/s". It is as if bbmrgt.pl is not reading the rrd file. Here is what my mrtg.cfg file looks like. ### Global Config Options # for UNIX # WorkDir: /home/http/mrtg # for Debian WorkDir: /var/www/mrtg LogFormat: rrdtool LibAdd: /usr/lib/perl5/ IconDir: /mrtg # or for NT # WorkDir: c:\mrtgdata ### Global Defaults # to get bits instead of bytes and graphs growing to the right # Options[_]: growright, bits EnableIPv6: no Target[bb-hostname_Vl1]: #Vl1:public at host: # bb* = Big Brother info bb*host[bb-hostname_Vl1]: bb-hostname bb*svc[bb-hostname_Vl1]: int49-56 bb*althost[bb-hostname_Vl1]: Internet link. bb*altsvc[bb-hostname_Vl1]: traffic bb*yellow[bb-hostname_Vl1]: 9% bb*red[bb-hostname_Vl1]:10% bb*unit[bb-hostname_Vl1]: bits/sec bb*in[bb-hostname_Vl1]:In bb*out[bb-hostname_Vl1]: Out SetEnv[bb-hostname_Vl1]: MRTG_INT_IP="1.1.1.1" MRTG_INT_DESCR="Interface to internet link." Options[bb-hostname_Vl1]: growright, bits MaxBytes[bb-hostname_Vl1]: 125000000 Title[bb-hostname_Vl1]: Traffic Analysis for Vl1 -- bb-hostname.foo.com PageTop[bb-hostname_Vl1]: <h1>Traffic Analysis for Vl1 -- bb-hostname.foo.com</h1> <div id="sysdetails"> <table> <tr> <td>System:</td> <td>bb-hostname.foo.com in FOO</td> </tr> <tr> <td>Maintainer:</td> <td>user-3e5aabec1ad3@xymon.invalid</td> </tr> <tr> <td>Description:</td> <td>internet link </td> </tr> <tr> <td>ifType:</td> <td>propVirtual (53)</td> </tr> <tr> <td>ifName:</td> <td>Vl1</td> </tr> <tr> <td>Max Speed:</td> <td>125.0 MBytes/s</td> </tr> <tr> <td>Ip:</td> <td>1.1.1.1()</td> </tr> </table> </div> Here is the output when I bbmrtg.pl by hand localhost status internet.traffic green Wed Jun 17 13:59:04 2009 &green<A HREF="http://foo.com/cgi-bin/mrtg-rrd.cgi/br2-cci_vl1.html">Traffic Analysis for Vl1 -- bb-hostname.1stel.com:</A> *In: bits/sec (0.0%) Out: bits/sec (0.0%*) <CENTER><BR><A HREF="http://foo.com/cgi-bin/mrtg-rrd.cgi/bb-hostname_vl1.html"><IMG SRC="http://foo.com/cgi-bin/mrtg-rrd.cgi/bb-hostname_vl1-day.png" ALT="Last 24 Hours" BORDER=0></A><BR></CENTER> <TABLE BORDER=1 ALIGN=CENTER> <TR> <TH COLSPAN=6><B>Rules</B></TH> </TR> <TR> <TD><FONT COLOR=#00eb0c><B>In</B></FONT></TD> <TD BGCOLOR=red><FONT COLOR=black><B>< 0.0%</B></FONT></TD> <TD BGCOLOR=yellow><FONT COLOR=black><B>< 0.0%</B></FONT></TD> <TD BGCOLOR=green><FONT COLOR=black><B>0.0% - 9.0%</B></FONT></TD> <TD BGCOLOR=yellow><FONT COLOR=black><B>> 9.0%</B></FONT></TD> <TD BGCOLOR=red><FONT COLOR=black><B>> 10.0%</B></FONT></TD> </TR> <TR> <TD><FONT COLOR=#1000ff><B>Out</B></FONT></TD> <TD BGCOLOR=red><FONT COLOR=black><B>< 0.0%</B></FONT></TD> <TD BGCOLOR=yellow><FONT COLOR=black><B>< 0.0%</B></FONT></TD> <TD BGCOLOR=green><FONT COLOR=black><B>0.0% - 9.0%</B></FONT></TD> <TD BGCOLOR=yellow><FONT COLOR=black><B>> 9.0%</B></FONT></TD> <TD BGCOLOR=red><FONT COLOR=black><B>> 10.0%</B></FONT></TD> </TR> </TABLE> <BR> Thanks in advance -- Jared Hoskinson 1stel, Inc. Desk XXX.XXX.XXXX FAX XXX.XXX.XXXX
list Dan McDonald
▸
On Wed, 2009-06-17 at 14:05 -0500, Jared Hoskinson wrote:
Hello all I need to alarm on bandwidth thresholds so I have added bbmrtg.pl using this guide, http://www.pleiades.com/mrtgbb/. Everything is working expect when bbmrtg.pl runs it reports "In: bytes/sec (0.0%) Out: bytes/sec (0.0%)". When look at the graph produced by mrtg-rrd.cgi, it reports the correct usage which in case is "Current In: 68.8 Mb/s Current Out: 25Mb/s". It is as if bbmrgt.pl is not reading the rrd file.
It's a timing problem - the rrd is being written after bbmrtg reads it,
so it's returning NaN.
I had to add a call to RRDs::last to make it work right:
} elsif ($BACKEND eq 'RRD') {
$last = RRDs::last($targetLog);
my $first = $last - 300;
my ($start, $step, $names, $data)
= RRDs::fetch "-s $first","-e $last", $targetLog, 'AVERAGE';
foreach my $dat (@$data) {
if (defined($$dat[0])) {
$i_now=($factor * $$dat[0]);
}
if (defined($$dat[1])) {
$o_now=($factor * $$dat[1]);
}
}
warn "last: $last, i_now: $i_now, o_now: $o_now\n" if $tron;
Sorry, I don't have the original code to do a proper diff...
--
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
www.austinenergy.com
list Buchan Milne
▸
On Wednesday 17 June 2009 21:05:34 Jared Hoskinson wrote:
Hello all I need to alarm on bandwidth thresholds
Have you considered using devmon for this instead? Regards, Buchan
list Paul Root
Devmon works pretty well. We're having a bit of trouble with it concerning accurate estimation of load for some interfaces. I'm not the router guy, so I'm not sure of what's what. Can I put devmon in the hobbitlaunch.cfg?
▸
From: Buchan Milne [user-9b139aff4dec@xymon.invalid]
Sent: Friday, June 19, 2009 2:15 AM
To: user-ae9b8668bcde@xymon.invalid
Cc: Jared Hoskinson
Subject: Re: [hobbit] bbmrtg.pl help
On Wednesday 17 June 2009 21:05:34 Jared Hoskinson wrote:Hello all I need to alarm on bandwidth thresholds
Have you considered using devmon for this instead? Regards, Buchan
list Dan McDonald
▸
On Fri, 2009-06-19 at 09:15 +0200, Buchan Milne wrote:
On Wednesday 17 June 2009 21:05:34 Jared Hoskinson wrote:Hello all I need to alarm on bandwidth thresholdsHave you considered using devmon for this instead?
I've considered devmon in the past, but it doesn't meet my needs because: 1. template system isn't as flexible as mrtg's 2. no support for snmp v3 -- Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX www.austinenergy.com
list Buchan Milne
▸
On Friday 19 June 2009 15:40:50 McDonald, Dan wrote:
On Fri, 2009-06-19 at 09:15 +0200, Buchan Milne wrote:On Wednesday 17 June 2009 21:05:34 Jared Hoskinson wrote:Hello all I need to alarm on bandwidth thresholdsHave you considered using devmon for this instead?I've considered devmon in the past, but it doesn't meet my needs because: 1. template system isn't as flexible as mrtg's
I think there are a fair number of templates that show the opposite as well. Feel free to mention exactly what features are missing regarding templates.
2. no support for snmp v3
Since there is no support in SNMP_Session for SNMPv3 ... I am considering switching to net-snmp's SNMP module instead. Of course, patches are welcome. You neglected to note any advantages devmon has over mrtg though .... Regards, Buchan
list Dan McDonald
▸
On Fri, 2009-06-19 at 16:25 +0200, Buchan Milne wrote:
On Friday 19 June 2009 15:40:50 McDonald, Dan wrote:On Fri, 2009-06-19 at 09:15 +0200, Buchan Milne wrote:On Wednesday 17 June 2009 21:05:34 Jared Hoskinson wrote:Hello all I need to alarm on bandwidth thresholdsHave you considered using devmon for this instead?I've considered devmon in the past, but it doesn't meet my needs because: 1. template system isn't as flexible as mrtg'sI think there are a fair number of templates that show the opposite as well.
Well, that's the problem. You need a template for each type of gear in devmon. So, my Cat 3750-48PS-E would need a different template than a Cat 3750G-24PS-E, and every combination of stack would need yet another template. Instead, I can write a generic template in mrtg to cover pretty much anything that runs IOS - it's just perl, so I can query mibs and optionally include sections as I see fit. Ditto for UPS - I have 4 major flavors of UPS, just one template.
▸
Feel free to mention exactly what features are missing regarding templates.2. no support for snmp v3Since there is no support in SNMP_Session for SNMPv3 ... I am considering switching to net-snmp's SNMP module instead.
Yes, I spliced in net_SNMP_Session as a "drop-in" replacement for SNMP_Session in mrtg. Took a couple of months, but I made it work. I had to design new syntax, and messed with much of the guts of mrtg.
Of course, patches are welcome.
Of course. But that's a whole new program for me to wrap my head around and do deep-dive coding. Not enough spare grey cells or contiguous seconds to do that.
You neglected to note any advantages devmon has over mrtg though ....
I've not been able to use it, because of no support for SNMP v3. devmon was first released after I had fixed mrtg. But the main advantage is easier integration with xymon, although bbmrtg.pl works fine if you patch it. -- Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX www.austinenergy.com