2

I'm trying to get the average value over last week week from a rra file.

/var/www/html/cacti/rra/traffic.rrd

What I am doing right now is using the following command to get all the data over the last week then compute the average using other programming languages.

rrdtool fetch /var/www/html/cacti/rra/traffic.rrd AVERAGE -s -7d

I wonder if there are any 'native way' to achieve the same results.

1 Answers1

2

there is

rrdtool graph dummy --start=end-7d --end=now \
  DEF:x=/var/www/html/cacti/rra/traffic.rrd:in:AVERAGE \
  VDEF:xa=x,AVERAGE PRINT:xa:%lf

this will print out the average value of the DS 'in' over the last 7 days.

Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23