[rrd-users] Pulling data out of rrds
Munroe Sollog
mus3 at Lehigh.EDU
Tue Apr 8 05:08:10 CEST 2014
I have thousands of rrds that store network traffic data. My goal is to get the 'current bandwidth usage' from each. I'm taking the the last 2 entries from:
rrdtool fetch switch_hud/data/datab/172.16.23.250-g0-1.rrd MAX --resolution 30
I'm subtracting the values and multiplying by 8 because I'm collecting octets. My understanding is that because the rrds are collecting a counter from the switches subtracting the n-1 value from the nth value gets me the total # of bits over the given time. If I divide that by the time span I should get bits per second. However, my numbers are 2-3 orders of magnitude off when I compare it to the graph and I can't figure out why. My hope is that there is an easier way to do what I'm trying to do. The graph seems to be able to do this trivially. Included is the output from rrdtool info
$ rrdtool info switch_hud/data/datab/172.16.41.251-g1-0-1.rrd
filename = "switch_hud/data/datab/172.16.41.251-g1-0-1.rrd"
rrd_version = "0003"
step = 30
last_update = 1396925867
header_size = 2048
ds[inbps].index = 0
ds[inbps].type = "COUNTER"
ds[inbps].minimal_heartbeat = 120
ds[inbps].min = 0.0000000000e+00
ds[inbps].max = NaN
ds[inbps].last_ds = "8910377490"
ds[inbps].value = 5.3340333333e+03
ds[inbps].unknown_sec = 0
ds[outbps].index = 1
ds[outbps].type = "COUNTER"
ds[outbps].minimal_heartbeat = 120
ds[outbps].min = 0.0000000000e+00
ds[outbps].max = NaN
ds[outbps].last_ds = "35576830451"
ds[outbps].value = 1.2401500000e+04
ds[outbps].unknown_sec = 0
rra[0].cf = "MAX"
rra[0].rows = 5760
rra[0].cur_row = 1089
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 = "MAX"
rra[1].rows = 2880
rra[1].cur_row = 2
rra[1].pdp_per_row = 12
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 2.9445444444e+02
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[1].cdp_prep[1].value = 8.3342888889e+02
rra[1].cdp_prep[1].unknown_datapoints = 0
rra[2].cf = "MAX"
rra[2].rows = 1440
rra[2].cur_row = 217
rra[2].pdp_per_row = 48
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 3.2185555556e+02
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[2].cdp_prep[1].value = 1.1610480460e+03
rra[2].cdp_prep[1].unknown_datapoints = 0
rra[3].cf = "MAX"
rra[3].rows = 2920
rra[3].cur_row = 2147
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 3.8953555556e+02
rra[3].cdp_prep[0].unknown_datapoints = 0
rra[3].cdp_prep[1].value = 1.1610480460e+03
rra[3].cdp_prep[1].unknown_datapoints = 0
rra[4].cf = "MAX"
rra[4].rows = 1040
rra[4].cur_row = 207
rra[4].pdp_per_row = 2016
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = 5.4072455556e+03
rra[4].cdp_prep[0].unknown_datapoints = 0
rra[4].cdp_prep[1].value = 4.7447486667e+04
rra[4].cdp_prep[1].unknown_datapoints = 0
More information about the rrd-users
mailing list