Fixing rrdtool database files

After a Debian update, my usb-wde1-tools did not work anymore, because socat's default settings changed. While trying to fix the problem, I got some bad data in my data log file (e.g. temperatures of 7000°C) that got picked up by Munin, making the temperature and humidity charts unreadable.

The solution for me was to fix the data manually in the .rrd database files - converting them to XML, then back to the original format with rrdtool:

$ cd /var/lib/munin/
$ for i in haus-usb_wde1_*.rrd; do rrdtool dump $i > $i.xml; done
$ joe haus-usb_wde1_temperature-sensor1-g.rrd.xml
.. replace the e+02 and e+03 values with "NaN" ..
$ mkdir backup
$ mv haus-usb_wde1_temperature-sensor1-g.rrd backup/
$ rrdtool restore haus-usb_wde1_temperature-sensor1-g.rrd.xml haus-usb_wde1_temperature-sensor1-g.rrd

I'm looking for a new job. If you can recommend a company in Leipzig/Germany that's looking for a PHP developer, please drop me a mail.

Written by Christian Weiske.

Comments? Please send an e-mail.