[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] bbmrtg.pl help
- To: <hobbit (at) hswn.dk>
- Subject: Re: [hobbit] bbmrtg.pl help
- From: "McDonald, Dan" <Dan.McDonald (at) austinenergy.com>
- Date: Thu, 18 Jun 2009 08:06:44 -0500
- References: <4A393E7E.1080008 (at) 1stel.com>
- Thread-index: AcnwFaEmCRzk2KywQ3OvinE2Ow2Kvw==
- Thread-topic: [hobbit] bbmrtg.pl help
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