views:

1190

answers:

1

I am using RRDtool for storing data for displaying graphs. I update the RRD by RRDs::update and this fails when trying to rewrite the information, means update data for a time in the past (e.g. someone moved the system timer back). The error I get is:

ERROR: Cannot update /opt/dashboard/rrd/Disk/192.168.120.168_disk_1.rrd with '1228032301:24:24' illegal attempt to update using time 1228032301 when last update time is 1228050001 (minimum one second step)

I want to always allow the rewrite, how can I do this?

+1  A: 

According to the RRD documentation, that timestamp number must increase with each update. Given your constraints, I'd modify your update routine so that if the update fails, you catch the exception and redo the update with the time field set to 'N'. That will make RRDtool use the current time as the update time.

Alternatively, if you don't want to deal with the catch-and-retry code, just modify your update code to always use 'N' as the time value -- then the update will always work.

It may be helpful to have a quick look at the documentation for the RRDtool update command.

genehack