[mrtg] Re: Making scripts 64-bit counters

tony bourke tony at vegan.net
Mon Jul 8 01:51:36 MEST 2002


Hi Alex,

MRTG handles my > 32 bit numbers no problem, I'm was just concerned with 
it handling the rollover.

However, Just doing a quick calculation though, at 1 Gigabit per second
sustained traffic, it will take around 585 years (I think I did my math
right) for a 64 bit counter to rollover, so I guess it's something I
really don't need to worry about :)

Tony





On Mon, 8 Jul 2002, Alex van den Bogaerdt wrote:

> tony bourke wrote:
> > Does anyone know of a way to make a script treated like a 64-bit counter?
> > 
> > Target[tofu_64bit] `/usr/local/bin/64bit.pl`:::::2
> > 
> > does not seem to do the trick.  The counters are 64 bit, and I don't want 
> > it treated like a 32 bit counter.
> 
> Loose the :::::2
> 
> > Or does MRTG just not do wrap calculations if the number is above 2^32?
> 
> When I tried using a script of my own, the numbers I generated ended
> up in the log file.  This means they are read properly.
> 
> I did however also have problems when I repeatedly tried to enter
> the same number (and yes, I was using the gauge option :)
> 
> I probably do not use the most recent version of MRTG so this doesn't
> mean anything.
> 
> 
> The problem with 32-bit counters is *not* that the numbers become
> too large.  On the contrary, the numbers *cannot* become large and
> this is the problem.  The most recent number is lower than the one
> before, or only slightly larger (modulo 2**32 calculations).
> 
> My test script generates a repeating sequence of numbers:
> 0, 2**31, 2**33, 2**35.  When I call this script from MRTG (without
> the gauge option) the numbers are visible in the first line of the
> log and the rest of the log gets populated with data.
> 
> When I however *do* use the gauge option, numbers above 2**32 aren't
> visible.
> 
> A quick scan of rateup.c seems to show that it is capable of handling
> very large numbers (128 digits) as counter values but "only" 32-bit
> numbers for the rates.  This does seem to explain what I experienced.
> 
> So, it seems that as long as you're using regular counters, you can
> use an external script that returns values > 2**32.  The capability
> of handling such numbers has to do with the use of gauge (you shouldn't
> use that).
> 
> If someone knows for sure: please step in.
> 
> HTH
> 

-- 
-------------- -- ---- ---- --- - - - -  -  -- -  -  -  -   -     -
Tony Bourke				tony at vegan.net



--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list