RRD Import or Re-Create

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

RRD Import or Re-Create

Post by sterpstra »

Hi,

I'm migrating from a 64-Bit system to a 32-bit system and I'm having some issues with the RRD's. Everything is transferred over to the new box and working correctly, however, when I move the .rrd files over and try to access, I get in the Apache error.log:

ERROR: This RRD was created on other architecture

Any ideas on this? If I can't use these RRD's, can I recreate them? I don't want to lose any data (all transferred over in MYSQL no problem)....

Thanks in advance...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Copy = not good
Please use rrdtool dump and restore instead
Reinhard
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

Thanks gandalf....

That helps a bunch but I can't find a way to do all files in batch type format :( I have over a thousand RRD's.. I'd hate to do them one by one....

-st
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

sterpstra wrote:Thanks gandalf....

That helps a bunch but I can't find a way to do all files in batch type format :( I have over a thousand RRD's.. I'd hate to do them one by one....

-st
Spoke too soon:

#!/bin/bash
for name in $(find -type f -print | grep .rrd)
do
if [ $name != "." ] ; then
echo "Dumping "$name" to $name.xml"
rrdtool dump "$name" > "$name.xml"
fi
done
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I already wondered. This was posted some time ago in virtually the same way you did it
Reinhard
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

gandalf wrote:I already wondered. This was posted some time ago in virtually the same way you did it
Reinhard
Yeah, after you told me about the RRDTool, I was able to search correctly and find what I needed. I wasn't getting anything before with the way I was searching. I did end up using a different shell script which worked out better:

#!/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
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests