[rrd-users] Re: Using rrd for traffic counting.
Tobias Oetiker
oetiker at ee.ethz.ch
Fri Jul 28 02:56:22 MEST 2000
Jul 20 you sent me mail regarding [rrd-users] Using rrd for traffic counting.:
*>
*> G'day,
*>
*> I'm thinking of using rrd for recording traffic for billing purposes. For
*> this we ultimately want total bytes received each month, not average
*> bytes/sec. I know that this can be calculated by multiplying the average
*> bytes/sec by the seconds in the time period, but I'm worried about loss of
*> accuracy, and wondering about the best way to get this info out of rrd.
data is stored at double precission floating point ... this shold
suffice for all real world problems ...
*> In particular, I'm worried about the affects of data re-sampling and
*> Unknowns. In our case, I'd want unknowns to be treated as zero when
*> consolidating data (we don't want to over-bill). We also don't want to miss
*> any traffic we know was there just because we couldn't get one sample.
*> Because byte counters just count bytes, it should be possible to interpolate
*> the missing sample from the samples before and after. Does rrd do this?
it can do this using the xff parameter in rra setup ....
*> We want to get total bytes transferred, not the average byte rate. The man
*> page tauntingly hints at a 'total' CF, but the rest of the documentation and
*> a brief glance at the code suggests it doesn't exist. I'm concerned that the
*> 'average' CF will introduce inaccuracies because of the way it accumulates
*> rates that have been re-sampled and handles Unknowns. I know that you can
*> tune the 'xff' setting for Unknowns, but it only allows you mark the whole
*> accumulated value as unknown (set xff=0.0, or calculates an average
*> excluding the unknown samples. This means I'd either exclude the known
*> traffic when consolidating with an unknown (under account), or assume that
*> the unknown was at the average rate of the other known samples for that
*> consolidation period (possibly over account).
*>
*> I'm thinking that I might need to use 'average' as my CF, and then use a
*> fancy front end that massages the SNMP to account for unknowns and
*> re-sampling to ensure I get what I want. I'd rather not implement something
*> like this if rrd's existing re-sampling and unknown handling can be
*> convinced to do what I want.
what you do is:
a) decide the resolution you will be working at (for unknown and such)
b) create an RRD with that resolution as --step
c) create an RRA which stores AVERAGE at this resolution for the
whole month or maybe 2 tobe on the sure side.
d) write a little perl script which uses RRDs::fetch to get the
data out again
e) drop the unknown samples ( it is your problem if you messes up
the traffic meetering so you can't ask the ustomers to pay for it)
f) sum the rest of the samples up, multiply by interval time and
number of samples ... this willget you the octet count for the
period you are looking at ...
*> Now, assuming I can get the data in and accumulating in a way that works,
*> what is the best way to get out the monthly total bytes transferred? It
*> looks like using 'graph' with 'print' and some fancy CDEF would be the best
*> way, but I'm interested in hints as to the best method.
it may be possible to use CDEF but I guess perl and fetch is more
straight forward ...
cheers
tobi
PS http://ee-staff.ethz.ch/~oetiker/wish
*>
*> Thanks,
*>
*> ABO
*>
*> --
*> 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
*>
*>
--
______ __ _
/_ __/_ / / (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
/ // _ \/ _ \/ / TEL: +41(0)1-6325286 FAX:...1517 ICQ: 10419518
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker
--
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