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/home.cweiske.de
$ 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

Written by Christian Weiske.

Comments? Please send an e-mail. Or Reply or Like.