[rrd-users] RRDTool lib fetch

Steve Shipway s.shipway at auckland.ac.nz
Tue Nov 3 22:01:21 CET 2015

This is expected behaviour.


‘Rrdtool fetch’ will return the raw data, using the RRA that most closely approximates the requested data resolution.  So, if you request a resolution of 3600, and only have a 300 RRA available, then this will be used.  However, if you have a 3600 RRA then this will be chosen.  In addition, RRDTool will ensure the time window is fully covered before selecting a resolution; so you need to be careful of fencepost errors where only the last sample is unavailable at your selected resolution and so it fails back to a lower granularity RRA.  The graph function, on the other hand, will perform on-the-fly aggregation and calculation to generate a data set  in the required resolution before graphing.


If you want to have the data pre-aggregated, then either ensure that a suitable RRA exists in the RRD, or else use ‘rrdtool xport’, which is like the graph function but returns the data instead (after calculation and aggregation if necessary)




Steve Shipway

T: +64 9 3737 599 ext 86487

E: s.shipway at auckland.ac.nz <mailto:s.shipway at auckland.ac.nz> 

(GNU Terry Pratchett)


From: rrd-users [mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On Behalf Of Olivier
Sent: Wednesday, 4 November 2015 5:29 a.m.
To: rrd-users at lists.oetiker.ch
Subject: [rrd-users] RRDTool lib fetch




I'm looking for documentation on rrdtool library. I'm actually using it through PHP and PECL project. I'm using function rrd_fetch() to grab data from a specific .rrd file.

I can see that 'resolution' parameter is not respected (as rrd_graph is doing) : RRD seems to find the most accurate resolution available, but returns the raw data. For example, if I have data with resolution =60 and I request resolution =3600, data is not aggregated, and I have one row every minute instead of one per hour.

First, I want to know if this is an expected behaviour. In that case, it means that rrd_graph is doing this aggregate itself. Is there a way to ask rrdtool to do the math for me ?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20151103/3a6ef807/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5334 bytes
Desc: not available
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20151103/3a6ef807/attachment-0001.bin>

More information about the rrd-users mailing list