[rrd-users] rrdfetch returning too many rows

Alex van den Bogaerdt alex at ergens.op.het.net
Mon Nov 12 13:07:18 CET 2007


On Mon, Nov 12, 2007 at 11:24:37AM +0000, Edward Quick wrote:

> I would like to fetch the hourly averages for a particular datasouce in an rrd file for the last 24 hours.
> The command I'm using is similar to the one on the man page for rrdfetch:
> 
> rrdtool fetch $rrdfile AVERAGE -r $rrdres -e @{[int($ctime/$rrdres)*$rrdres]} -s e-24h

What is in rrdres? This is quite relevant!

You probably have "3600" in there, but there isn't such an RRA available.  RRDtool will do the next best thing, which in your case is showing data in 30-minute rows.

Try setting rrdres to 7200, and I expect 14 lines returned. That would be 12 rows, plus two other lines.  Correct?

> However, this returns 50 rows, instead of 24. Also is there a way for me just to pull out one datasource, instead of all of them?

No, I don't think so. Use awk, or perl, or ...
 
> step = 60

> rra[0].cf = "AVERAGE"
> rra[0].rows = 26352
> rra[0].pdp_per_row = 5

Enough data for 24h at 5min

> rra[1].cf = "AVERAGE"
> rra[1].rows = 8784
> rra[1].pdp_per_row = 30

Enough data for 24h at 30min. This would be 48 rows, close to the 50 you mention: 1 row headers, one empty row for separation, 48 rows of data.

> rra[2].cf = "AVERAGE"
> rra[2].rows = 4392
> rra[2].pdp_per_row = 120

Enough data for 24h at 2h

> rra[3].cf = "AVERAGE"
> rra[3].rows = 1098
> rra[3].pdp_per_row = 1440

24h per row.


-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list