Here is a python script to repair rrd databases where some data had been in the future.
If your computer clock is for whatever reason badly setted to a future date, and you add some value to a rrd database, it would drop lot of values, and forbid to add values when you will have corrected the clock. Basically, to reset the lastupdate
timestamp to a good value, only genuine value shall be kept - which depends on the datasource parameters - and reinsert unknown value before. Of course, there will be a lot of loss…
So, this script need a python interpreter with the ElementTree
module. It takes a rrdtool xml dump on stdin and gives the repaired xml version on stdout. Basic workflow :
rrdtool dump yourdb.rrd > dump.xml
cat dump.xml | python rrd_repair.py > repaired.xml
rrdtool restore repaired.xml db.rrd
The chosen new lastupdate
will be set to the current date.