[rrd-developers] Update ex post?

Pablo Sanchez pablo at blueoakdb.com
Mon Aug 23 19:55:46 CEST 2010


[ Comments below, in line ]

On Monday 23 August 2010 at 1:40 pm, Till Dörges penned
about "[rrd-developers] Update ex post?"

> Hello everyone,
> 
> I know that RRDtool doesn't support updates ex post and that this is
> by design. I've looked around a bit and didn't manage to find a more
> a detailed reasoning as to why this is so. So I'd be very curious
> about pointers or hints.

Hi Till,

I've had sensors go crazy on me and I need to cleanup the RRD data.
I've read people using `rrddump' to create an .XML file.  The XML file
is `tweaked' and `rrdrestore' is used to re-create the updated RRD.  I
found on my extremely weak server that this task takes too long.

What I do now is the following:

o Create a mirror .RRD and specify a `--start' value with the lowest
  (minus one)   value I have recorded in my original .RRD (easy to
  determined using `rrdfetch').

o I transform the output of `rrdfetch' to create `rrdupdate'
  statements from the `--start' to before the bad data - I use `xargs'
  to send batches of rrdupdates.

o I do the same as above for the `bad' data period and use `sed' to
  make my changes in line.

o If there's any data remaining after the `bad' period until `now', as
  before, I update my new .RRD with `rrdupdate'

o Finally, I rename .RRD files (current => old, new => current),
  restart my logging and typically only lose one update.

The above is very very fast to perform.

If there's interest, I'll post snippets of my Unix filters.  I wrote a
cheat sheet for myself so I no longer have to think about it.

Cheers,
-- 
Pablo Sanchez - Blueoak Database Engineering, Inc
Ph:    819.459.1926      Fax:   760.860.5225 (US)



More information about the rrd-developers mailing list