|
This can be done, but it is not simple. If your date error was about 1 day or less, you can probably just live with it. If it is more, however, you should most likely restore your most recent backup of the RRD files.
To understand the problem, you need to know how RRDTool stores the data. The RRD file holds the time of the last update, and it will not accept updates back into the past. It also expires summary (RRA) data based on this time, so if your incorrect time was too far into the future, you may well have lost all of the historical data anyway.
To correct the problem, you need to use rrdtool to dump the RRD file to XML, then edit the XML to set the last update time (which is in seconds since the epoch) to the time required, and remove the RRA data lines for all data after this time. This is probably too difficult to do by hand more than once, so you'd need to write a script to do it for you. Then, load the XML back into rrdtool to create an updated RRD file. The real problem is that you won't get back any expired historical data, so if you set the date to be (for example) two months into the future, then your daily, weekly and monthly graphs will be empty anyway, only the yearly having data (and the oldest two months will be empty too).
A better solution long-term to prevent this is to enable RRD Archiving using the Routers2 archiving script, which will give you an archived history for every day (or week, or month dpeneding on the frequency you choose). You do need to have a lot of spare disk space for the archives, though!
_________________ Steve Shipway UNIX Systems, ITSS, University of Auckland, NZ Woe unto them that rise up early in the morning... -- Isaiah 5:11
|