[rrd-users] Finding Max values with rrdtool fetch
Meece, Clifford T (MVC)
MeeceCT at bp.com
Fri May 3 21:06:36 MEST 2002
Hello,
I have an rrd with the following structure:
filename = "/usr/local/bb/bbvar/rrd/pcdbwls00.la.rrd"
rrd_version = "0001"
step = 300
last_update = 1020451817
ds[la].type = "GAUGE"
ds[la].minimal_heartbeat = 600
ds[la].min = 0.0000000000e+00
ds[la].max = NaN
ds[la].last_ds = "UNKN"
ds[la].value = 5.4400000000e+02
ds[la].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 576
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[1].cf = "AVERAGE"
rra[1].rows = 576
rra[1].pdp_per_row = 6
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 1.1039666667e+02
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 576
rra[2].pdp_per_row = 24
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 3.2357666667e+02
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[3].cf = "AVERAGE"
rra[3].rows = 576
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 4.9749000000e+03
rra[3].cdp_prep[0].unknown_datapoints =
It's pretty easy to get these values for any given time like:
root:pcadm00> rrdtool fetch ~bb/bbvar/rrd/pcdbwls00.la.rrd AVERAGE -s 04 PM
-e 04:30 PM
la
1020416400: 1.6406666667e+01
1020416700: 1.7003333333e+01
1020417000: 1.6980000000e+01
1020417300: 1.5803333333e+01
1020417600: 1.6000000000e+01
1020417900: 1.6000000000e+01
1020418200: 1.7200000000e+01
But, how do I get the average over that same time frame, or the Max over
that time frame. I tried the following:
root:pcadm00> rrdtool fetch ~bb/bbvar/rrd/pcdbwls00.la.rrd MAX -s 04 PM -e
04:30 PM
And I get:
ERROR: the RRD does not contain an RRA matching the chosen CF
I'd rather not write more code to grab all these values and do the
max/average calculation by myself, since I know it is very easy to do this
with rrdtool graph, like (from some perl code):
qq{GPRINT:la:LAST:Current \\: %5.1lf\\n},
qq{GPRINT:la:MIN:Min \\: %5.1lf\\n},
qq{GPRINT:la:AVERAGE:Average \\: %5.1lf\\n},
qq{GPRINT:la:MAX:Max \\: %5.1lf\\n},
Thanks in advance,
Cliff
Cliff Meece
BP NextGen
Chicago Cantera 1
* Mobile: +1 (630) 640-4373
* Office: +1 (630) 836-5058
* E-Mail: meecect at bp.com
--
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