I want to extract some hourly data from rrdtool
databases in order to create some graphs within a dashboard system.
These databases don't have an hourly datasource, the closest is a 30-min datasource (they are generated by munin)
Now, I can use rrdfetch
, but that doesn't do the nice averaging that rrdgraph
would do, so something like this
rrdtool fetch xxx-apache_accesses-accesses80-d.rrd AVERAGE \
--resolution 3600 -s 1328458200 -e 1328544600
Might give me 30 min data points like this
2012-Feb-05 16:30:00 3.5376357135e+00
2012-Feb-05 17:00:00 3.4655067194e+00
2012-Feb-05 17:30:00 4.0483210375e+00
2012-Feb-05 18:00:00 4.3210061422e+00
....
I could average those, but it seems that rrdgraph
can output parsable text, but I can't figure out the correct incantation. Here's what I've tried
rrdtool graph dummy.png -s 1328523300 -e 1328609700 \
DEF:access=xxx-apache_accesses-accesses80-d.rrd:42:AVERAGE \
"PRINT:access:AVERAGE: %5.1lf %S"
outputs
0x0
4.7
Now I think that's simply the average for the period given, but is there any way to get rrdtool
to spit out an average for particular chunks or step sizes? I tried --step
but this did not change the output.
I could call rrdtool graph
for each data point I need, but that seems rather wasteful.