[rrd-users] How to find first valid dp in rrd - repost - where arethe experts?

Karl Fischer rrd-users at ficos.de
Fri Nov 21 02:02:34 CET 2008


Simon Hobson wrote:
> Just tossing an idea up in the air - it either flies or gets shot 
> down ! Bear with me, I'm off with flu at the moment so not thinking 
> 100%
> 
> Could you do a cdef along the lines of :
> 
> t=if (prev(t) is unknown AND d is not unknown) then t=time(d) else t=unknown.
> 
> This should, if I'm switched on enough, work through the data, and 
> set t to the timestamp of the first sample where the data is unknown. 
> For the initial data both prev(t) and d will be unknown and so t will 
> stay as unknown. Once the data is known, then prev(t) will cease to 
> be unknown and no further updates will happen.

Thanks Simon,

but that doesn't do the job because of different resolutions in different RRAs.
If you specify a big enough time range for the query, eg. --start N - 5 years,
you will end up querying only the RRA with the highest step size ...

Looks like you got to work yor way through with multiple passes to narrow down.

Isn't any cheaper than

rrdtool fetch $file $CF \
| pcregrep -v "^\d+:( nan)+\s*$" \
| sed -n "/^[0-9]\+:/{s/:.*//p;q}"


- Karl



More information about the rrd-users mailing list