Monday, November 03, 2008

Cacti 32bit to 64bit - Updated 11/06/08

Update: It turns out that the problem is the version of rrdtool that is being used. I downgraded to version 1.2.23 and the graphs started showing up properly. Good news as I was able to migrate from 32 bit Centos 4.4 to 64bit Centos 5.2 and retain everything.

Matthew


I attempted to upgrade cacti across platforms, Centos 4.4 32bit to Centos 5.2 64bit. I went round and round and ended up having to export the rrd files on the old platform and then import them on the new. The data came across but the graphs are messed up with no legend or graph description. I have done some digging and have come to the conclusion that if I want to make this jump that I will just start over. Below is the shell script I found that can export and import rrd files. I wish I could remember where I found it to give the author credit as it worked well. In the end I have had suspicions that my cacti install has gotten corrupted and every once in awhile I like building from scratch. A lot has changed over two years and I fortunately don't have a pressing need for historical data.

#!/bin/sh

ECHO="echo -e"

rrdump ()
{
for rrd in `find . -type f -name "*.rrd"`
do
xml=`echo $rrd | sed 's/.rrd//g'`
rrdtool dump $rrd > $xml.xml
rm $rrd
done
}

xmlimport ()
{
for xml in `find . -type f -name "*.xml"`
do
rrd=`echo $xml | sed 's/.xml//g'`
rrdtool restore $xml $rrd.rrd
#rm $xml
done
}


case "$1" in
dump)
rrdump
;;
import)
xmlimport
;;
*)
$ECHO "$0 takes one of two arguments\n"
$ECHO "$0 dump -- dumps contents to xml\n"
$ECHO "$0 import -- imports xml files to rrd\n"
;;
esac

No comments: