Archive for December, 2008
munin: migration from a 32bit to a 64bit host
Posted by Lionel Porcheron in Uncategorized on December 26, 2008
When you migration your munin from a 32bits to a 64bits installation, you have to dump restore all your rrd files. Saying that looks like a pain, but in fact, it is easy to do
. We migrate some months ago our munin/nagios server at work from an old 32bits server to a brand new rack server using a 64bit Ubuntu 8.04.1, we performed the following scripts and kept our historic.
Here are the two scripts (you need some disk space to perform the dump / restore) . I assume you have copied the content of you “old” server on the new server. On Ubuntu/Debian servers, rrd files usually lives in /var/lib/munin.
First dump script :
#!/bin/bash
for f in `find /var/lib/munin -name '*.rrd' -print` ; do
xml_file=`dirname $f`/`basename $f .rrd`.xml
rrdtool dump "$f" > "${xml_file}"
chown root:root "${xml_file}"
done
Import script :
#!/bin/bash
for f in `find /var/lib/munin -name '*.xml' -print` ; do
rrd_file=`dirname $f`/`basename $f .xml`.rrd
mv -f "${rrd_file}" "${rrd_file}.bak"
chown root:root "${rrd_file}.bak"
rrdtool restore "$f" "${rrd_file}"
chown munin:munin "${rrd_file}"
done