[mrtg] Re: Making scripts 64-bit counters

Alex van den Bogaerdt alex at ergens.op.HET.NET
Mon Jul 8 01:38:59 MEST 2002


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
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
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