How to get Second last modified data from rrd file using rrdtool? By command rrdtool lastupdate we can get only last modified data. I want to get second last modified data. Can any one tell me?
If you mean to get the actual data submitted, then you cannot do this. Remember that RRDTool stores normalised and consolidated data, not the raw data.
rrdtool lastupdate
with give you the point in time and raw data value(s) of the last actual update, before normalisation and consolidation. This is stored so that ongoing rates can be calculated. After the next update, this data is normalised and consolidated so is no longer available.
You can use rrdtool fetch
to obtain the last entries in any RRA (after normalisation and colsolidation). You can specify which RRA to use by giving the requested data resolution and consolidtion factor. Depending on the nature of your data (Gauge vs. Counter) and the time of submission (on the interval boundary or not) then this may or may not be the same.
So, in summary, if you have a 5-minute-interval RRD, with a 1cdp=1pdp AVG RRA, and you submit data at 11:59, 12:04 and 12:08, then lastupdate
will give you "12:08" plus the data value(s) submitted; fetch
will give you "12:00" (the start of the only completed 5-min time bucket) plus the normalised data for the 12:00-12:05 bucket.