I want to extract hourly data from rrdtool
databases to create some graphs in the panel system.
There is no hourly data source in these databases, the closest is a 30-minute data source (they are generated by munin)
Now I can use rrdfetch
, but that doesnβt do the nice averaging that rrdgraph
will do, so something like this
rrdtool fetch xxx-apache_accesses-accesses80-d.rrd AVERAGE \ --resolution 3600 -s 1328458200 -e 1328544600
Can you give me 30 minute data 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 them, but it seems that rrdgraph
can output the analyzed text, but I cannot understand the correct spell. Here is what I 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"
exits
0x0 4.7
Now I think it's just the average value for a given period, but is there a way to get rrdtool
to spit out the average value for certain pieces or step sizes? I tried --step
, but that didn't change the way out.
I could call rrdtool graph
for every information I need, but that seems pretty wasteful.
source share