[rrd-users] Re: conversion

Serge Maandag serge.maandag at staff.zeelandnet.nl
Wed Sep 25 14:22:39 MEST 2002


You would do: ( (new value - old value) * 8 /1024 / 1024 )
To get the total No of MBytes that passed by during the day.

And ( (new value - old value) * 8 /1000 / 1000 )/ 24 * 3600
To get the No of Mbit/s that flew through the interface on average that
day.

Be sure your counters don't wrap though. It goes up to 2^32 or
4294967295. If it has counted more than that it starts over at 0.

If you set up an rrdtool database, you poll the counters and store them
in the database, you can let rrdtool do the math for you. It even
recognises counter wraps. You can Add a RRA with daily averages, convert
those values to "total bytes in per day" by making in a cdef that
multiplies the values with the timespan (24 * 3600).

Serge.

-----Original Message-----
From: Joe Rozzi [mailto:joe at tormented.org] 
Sent: Wednesday, September 25, 2002 1:55 PM
To: rrd-users at list.ee.ethz.ch
Subject: [rrd-users] Re: conversion



I am subtracting it from another value. I have cron running once a day,
keeping the value for the beginning of the day, and the value for the
end of the day. Then I'm doing (new value - old value) / 8 / 1024 / 1024
to get how many megabytes has passed through in that given amount of
time.I was converting the base from 8 to 10, because I thought the value
is in octets, but that was wrong I see. So to get MB do I (new value -
old value) / 8 / 1024 / 1024, or do I just (new value - old value) /
1024 /1024? I'm confused on which it is? Thanks for your inputs, and in
advance, again.

Joe Rozzi

-----Original Message-----
From: rrd-users-bounce at list.ee.ethz.ch
[mailto:rrd-users-bounce at list.ee.ethz.ch] On Behalf Of Serge Maandag
Sent: Wednesday, September 25, 2002 2:47 AM
To: Joe Rozzi; rrd-users at list.ee.ethz.ch
Subject: [rrd-users] Re: conversion


It is in bytes. It's the number of bytes that have passed through the
interface since it started counting or since the counters wrapped.

So the number itself is probably meaningless. It's the change in value
in a known interval that makes it interesting. Therefore, store it as a
counter value. Rrdtool will compute (new value - old value) / timespan
and store it in the database.

serge Maandag.

-----Original Message-----
From: Joe Rozzi [mailto:joe at tormented.org] 
Sent: Wednesday, September 25, 2002 6:42 AM
To: rrd-users at list.ee.ethz.ch
Subject: [rrd-users] conversion


Hi, I'm using snmpwalk on a switch to get bandwidth data. Say I have a
line like the following:
IF-MIB::ifInOctets.14 = Counter32: 2049398269
 
How would I mathematically go about converting that number into bytes
(decimal). Is it already in decimal? Or what? Thanks in advance.
 
Joe Rozzi


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi




--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list