[rrd-users] rrdtool update

Simon Hobson linux at thehobsons.co.uk
Fri Jun 1 12:47:22 CEST 2012

>I need to update an rrd at a specific time 
>stamp. Whatever timestamp I give is rejected 
>ERROR: file.rrd: illegal attempt to update using 
>time 1338480000 when last update time is 
>1338546901 (minimum one second step)

[Digital^Dude] ® wrote:
>I want to update these two values:
>1338480000: -3.0293609367e+06
>1338480300: -2.0135146667e+04
>to ZERO.

Top posting fixed ...

Simple, you cannot do this.
You can **NEVER** go back in time with RRD. Once 
you apply an update at any time, then you can 
never submit an update for an earlier time.
When you do an update, several things happens :

1) RRD will to the necessary calculations to work 
out the rate from the previous update to this one.

2) If the new time is such that one or more steps 
or consolidated periods are now complete, then 
these will have data entered for them.

3) Any data (such as previous update values) not 
now needed to do the same calculations next time 
are discarded. The last update values are kept as 
they will (in most cases) be needed to do the 
same calculations at the next update.

There are only two ways to go back and submit new data :

1) Delete your database, create a new one, and 
re-enter all data. This means keeping all your 
data somewhere outside of RRD so you can change 
values and resubmit them - in chronological order.

2) You can dump the RRD to an XML file and edit 
the values before reading the XML into a new RRD 

In theory it would be possible to directly edit 
the RRD file, but there are no tools for that.
You could also just dump the data with "rrd 
fetch" - but then you'd need to do some work to 
select which data to use, potentially do some 
interpolation, and then stuff it back into a new 
RRD with a series of updates. Potentially a lot 
of work, and again, no tools for it.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list