I want to make an average of 5 samples and calculate a single value:
Current output - I put resolution of 5 minutes but receive 5 samples:
$ rrdtool fetch file.rrd AVERAGE -r 300 --start 1200000000 --end 1200000300
1200000000: 1.3938888889e+00
1200000060: 4.9572222222e+00
1200000120: 7.1675000000e+00
1200000180: 1.0982500000e+01
1200000240: 7.6136111111e+00
1200000300: 7.2169444444e+00
Desired result:
$ rrdtool fetch file.rrd AVERAGE -r 300 --start 1200000000 --end 1200000300
1200000000: 1.3938888889e+00
1200000300: x.xxxxxxxxxxe+00 - average
I want calculate it with rrdtool or other language like perl, bash, etc...