0

I have an RRD DB which I have been writing power consumption data too, however I recently found it is 10 times too large.

Is there an easy way to rewrite all of the values in it?

Obviously I could export it as XML and modify but that is very tedious.

Darius
  • 194
  • 2
  • 11

1 Answers1

0

If by '10 times too large' you simply mean that the RRAs are too long, then you can use the command 'rrdtool resize rrdfile.rrd 1 shrink 100' to shrink RRA number 1 by 100 rows in the file rrdfile.rrd (take a backup first!). Note that you'll have to run this for each RRA that needs to be resized; use 'rrdtool info' to find out which RRAs are defined.

See the 'rrdtool help resize' for more details, or see the manual page.

If you want to add or remove DSs or add/remove RRAs entirely, then the only way to do it is to export to XML, modify the XML, and reimport. There is an 'rrdmerge' utility in the utils directory of v2.23beta of Routers2 that can help with other more drastic changes.

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39
  • Sorry, I mean the vales recorded in the DB are 10 times too large (i.e. it has 1000W instead of 100W) – Darius Jan 19 '14 at 10:40
  • If you want to globally change all the values stored in the database, then there is no way to automatically do this. You can export to XML and change it before reloading in. Alternatively, divide the values by 10 when generating a graph by using a CDEF. – Steve Shipway Jan 22 '14 at 23:22