[rrd-users] traffic summa for period

Andrew I Baznikin dikiy at scn.ru
Thu Jul 18 06:29:11 MEST 2002


Hello!

(sorry for my poor english)

I try to calculate summary traffic for some period. I write perl-script to parse `rrdtool fetch` output and to summ input and output deltas.

Amount of traffic between time1 and time3 is delta1+delta2, right?
time: diff:
-----+------
time1 n/a
time2 delta1
time3 delta2

cisco router statistic from 1026806310 (16 jul 2002 15:58) to 1026964250 (18 jul 2002 11:50:50) :

     16442213 packets input, 107525889 bytes
     16675031 packets output, 2315402820 bytes, 0 underruns

My script output:

su-2.05# ./rrdtr.pl 213.24.217.220_fa0_0 -s 1026806310 -e 1026964250     cmd: rrdtool fetch /usr/local/etc/mrtg/rrd/213.24.217.220_fa0_0.rrd AVERAGE -s 1026806310 -e 1026964250 <br>
 Input : 32267447 bytes
 Output: 8722539 bytes
su-2.05#

I try different resolutions (-r option), but proportions between my script output and routers counter differ:

2315402820 / 32267447 = 71.8
107525889 / 8722539 = 12.3

There are the mistake?

== cut from rrdtr.pl ==
print "cmd: $cmd <br>\n";
foreach (`$cmd`) {
        chomp;
        if (m/\d+:\s+([\de+-.]+)\s+([\de+-.]+)/) {
                my ($c_in, $c_out)=($1, $2);
                $in += $c_in; $out += $c_out;
        }
}
== end cut ==

== rrdtool info ==
filename = "/usr/local/etc/mrtg/rrd/213.24.217.220_fa0_0.rrd"
rrd_version = "0001"
step = 300
last_update = 1026966013
ds[ds0].type = "COUNTER"
ds[ds0].minimal_heartbeat = 600
ds[ds0].min = 0.0000000000e+00
ds[ds0].max = 1.2500000000e+07
ds[ds0].last_ds = "3789687167"
ds[ds0].value = 1.3328747826e+06
ds[ds0].unknown_sec = 0
ds[ds1].type = "COUNTER"
ds[ds1].minimal_heartbeat = 600
ds[ds1].min = 0.0000000000e+00
ds[ds1].max = 1.2500000000e+07
ds[ds1].last_ds = "2741856264"
ds[ds1].value = 5.4603765217e+05
ds[ds1].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 600
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 700
rra[1].pdp_per_row = 6
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 4.8696849288e+05
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[1].cdp_prep[1].value = 1.5430703974e+05
rra[1].cdp_prep[1].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 775
rra[2].pdp_per_row = 24
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 4.8696849288e+05
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[2].cdp_prep[1].value = 1.5430703974e+05
rra[2].cdp_prep[1].unknown_datapoints = 0
rra[3].cf = "AVERAGE"
rra[3].rows = 797
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 4.5963610024e+06
rra[3].cdp_prep[0].unknown_datapoints = 0
rra[3].cdp_prep[1].value = 1.1216618302e+06
rra[3].cdp_prep[1].unknown_datapoints = 0
rra[4].cf = "MAX"
rra[4].rows = 600
rra[4].pdp_per_row = 1
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = NaN
rra[4].cdp_prep[0].unknown_datapoints = 0
rra[4].cdp_prep[1].value = NaN
rra[4].cdp_prep[1].unknown_datapoints = 0
rra[5].cf = "MAX"
rra[5].rows = 700
rra[5].pdp_per_row = 6
rra[5].xff = 5.0000000000e-01
rra[5].cdp_prep[0].value = 1.4231393836e+05
rra[5].cdp_prep[0].unknown_datapoints = 0
rra[5].cdp_prep[1].value = 4.8811461904e+04
rra[5].cdp_prep[1].unknown_datapoints = 0
rra[6].cf = "MAX"
rra[6].rows = 775
rra[6].pdp_per_row = 24
rra[6].xff = 5.0000000000e-01
rra[6].cdp_prep[0].value = 1.4231393836e+05
rra[6].cdp_prep[0].unknown_datapoints = 0
rra[6].cdp_prep[1].value = 4.8811461904e+04
rra[6].cdp_prep[1].unknown_datapoints = 0
rra[7].cf = "MAX"
rra[7].rows = 797
rra[7].pdp_per_row = 288
rra[7].xff = 5.0000000000e-01
rra[7].cdp_prep[0].value = 1.6370073998e+05
rra[7].cdp_prep[0].unknown_datapoints = 0
rra[7].cdp_prep[1].value = 4.8811461904e+04
rra[7].cdp_prep[1].unknown_datapoints = 0
== end ==

-- 
Andrew I Baznikin
http://d.scn.ru

#      /\    ASCII ribbon
#      \/      campaign
#      /\      against
#     /  \    HTML email

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