[rrd-users] Find first non-NaN value in RRD?

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Oct 13 01:08:41 CEST 2007

On Fri, Oct 12, 2007 at 01:01:10PM -0700, David Carmean wrote:

> I need to programmatically choose between dozens, if not a hundred, 
> pairs of RRD files to determine which have the "best" or the "most" 
> data.  One of the things I'm doing is an rrddump and fgrep to count 
> the number of non-NaN samples.  But I also need to find the first 
> and last non-NaN values in the the RRD.  There's only one ds per 
> RRD (Zenoss).  rrdfirst is not behaving as I'd expect.  It gives 
> me the first/oldest slot, no matter whether it has a valid sample or 
> not.
> Somebody has to have solved this problem?  

Doesn't rrdtool 1.2 VDEF FIRST do what you want?

See man rrdgraph_rpn

Then print the time using PRINT (not GPRINT) and use it in whatever
script you are building.

See man rrdgraph_graph

Alex van den Bogaerdt

More information about the rrd-users mailing list