Since the --rrd-dump option would only benefit 32 to 64 bit migrations performed after an upgrade to 2.3.2, I'm posting the scripts that I plan to use for our migration. You may need to modify some of the initial variables if your zenoss install is not the same as mine. They are fairly straight-forward scripts:

   * dump-zenoss-rrd - Dumps the rrd database files to .xml files in a
     directory named /tmp/rrddump. Tar up /tmp/rrddump and copy it to
     your 64-bit server.
   * restore-zenoss-rrd - After zenrestore has been run, this script
     restores data from the /tmp/rrddump directory into Zenoss
     installation.

I'll post updated copies after my migration if there are any adjustments made.


netdata wrote:
atrawog wrote:
One of the things I'm toying with is the idea to add an --rrd-dump option to 
zenbackup that backups RRD files in XML format instead of native integer 
format. But I don't know if its really worth the effort.


Would be a good thing, I you add that function I will create a trac request to 
commit that back to zenoss.

I follow the forums for a while and I notice this is a question which comes 
quite often...

--

James D. Roman
Sr. Network Administrator
Science Systems and Application, Inc.
Phone: 301-867-2101

#!/bin/bash

##################################################################
# Filename: restore-zenoss-rrd
# Author: james_roman at ssaihq dot com
# Create Date: 20080209
# Description: Restore Round Robin Database files from XML files
#              for cross platform moves. Assumes that it will be
#              executed by the zenoss user (So ZENHOME is set) and
#              that you have already run the zenrestore command.
##################################################################

if [ ! -z $ZENHOME ]
then
  ## Change this to an appropriate Value 
  ZENHOME=/opt/zenoss
  echo "ZENHOME not set. Using $ZENHOME."
fi

DEVICEPATH="$ZENHOME/perf/Devices"
if [ ! -d $DEVICEPATH ]
then 
  echo "DEVICEPATH $DEVICEPATH does not exist."
  echo "Set an appropriate ZENHOME variable or"
  echo "run the zenrestore command first."
  exit
fi

## Change this to an appropriate Value
IMPORTDIR=/tmp/rrddump
if [ ! -d $IMPORTDIR ]
then
  echo "IMPORTDIR $IMPORTDIR does not exist."
  echo "Set an appropriate IMPORTDIR variable to complete."
fi

EscImportDir=`echo $IMPORTDIR | sed 's/\//\\\//g'`

# Save Internal Field Separator
OrigIFS=$IFS
IFS=$'\n'

for xmlfile in `find $IMPORTDIR -name *.xml -print`
do 
  MyXMLPath=`dirname $xmlfile`
  MyRRDPath=`dirname $xmlfile | sed s/^$EscImportDir//`
  MyXMLFilename=`basename $xmlfile`
  MyRRDFilename=`basename $xmlfile | sed s/.rrd.xml$/.rrd/`

  if [ ! -d $MyRRDPath ]
  then
     echo "Creating directory $MyRRDPath"
     mkdir -p $MyRRDPath
  fi

  if [ -f $MyRRDPath/$MyRRDFilename ]
  then
     echo "Replacing $MyRRDPath/$MyRRDFilename"
     rrdtool restore $xmlfile $MyRRDPath/$MyRRDFilename -f
   else
     echo "Creating $MyRRDPath/$MyRRDFilename"
     rrdtool restore $xmlfile $MyRRDPath/$MyRRDFilename
     chmod 775 $MyRRDPath/$MyRRDFilename
  fi
done

# Restore Internal Field Separator
IFS=$OrigIFS

echo
echo "Restore completed. If you did not run the script as the"
echo "Zenoss user, you may need to set the proper ownership"
echo "on the *.rrd files in $DEVICEPATH."

exit 0
#!/bin/bash

##################################################################
# Filename: dump-zenoss-rrd
# Author: james_roman at ssaihq dot com
# Create Date: 20080209
# Description: Dumps Round Robin Database files to XML 
#              for cross platform moves. Assumes that it will be
#              executed by the zenoss user. (So ZENHOME is set)
##################################################################

if [ ! -z $ZENHOME ]
then
  ## Change this to an appropriate Value 
  ZENHOME=/opt/zenoss
  echo "ZENHOME not set. Using $ZENHOME."
fi

DEVICEPATH="$ZENHOME/perf/Devices"
if [ ! -d $DEVICEPATH ]
then 
  echo "DEVICEPATH $DEVICEPATH does not exist."
  echo "Set an appropriate ZENHOME variable to complete."  
  exit
fi

## Change this to an appropriate Value
EXPORTDIR=/tmp/rrddump
if [ ! -d $EXPORTDIR ]
then
  echo "EXPORTDIR $EXPORTDIR does not exist."
  echo "Creating $EXPORTDIR"
  mkdir -p $EXPORTDIR
fi

# Save Internal Field Separator
OrigIFS=$IFS
IFS=$'\n'

for rrdfile in `find $DEVICEPATH -name *.rrd -print`
do 
  MyRRDPath=`dirname $rrdfile`
  MyRRDFilename=`basename $rrdfile`
  if [ ! -d $EXPORTDIR$MyRRDPath ]
  then
     echo "Creating directory $EXPORTDIR$MyRRDPath."
     mkdir -p $EXPORTDIR$MyRRDPath
  fi
  echo "Exporting $rrdfile"
  rrdtool dump $rrdfile $EXPORTDIR$MyRRDPath/$MyRRDFilename".xml"
done

# Restore Internal Field Separator
IFS=$OrigIFS

exit 0
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to