Nagios XI - Migrate Performance Data


Overview

Historical performance data that is used to generate graphs are stored in Round Robin Database (RRD) files. RRD performance data files are compiled binaries, so for a simple file transfer a user would have to have the architecture match on both machines.

If you want to migrate files from a 32bit to 64bit machine, you'll have to convert the data to XML and import it into RRD's on the new machine. The following steps will allow you to migrate the data:

On the old 32bit server:

cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rrdtool dump $i > $i.xml; done
tar -cvzf perfdata.tar.gz */*.rrd.xml
for i in `find -name "*.rrd.xml"`; do rm -f $i; done
cd /var/lib/mrtg/
for i in `find -name "*.rrd"`; do rrdtool dump $i > $i.xml; done
tar -cvzf mrtgdata.tar.gz *.rrd.xml
for i in `find -name "*.rrd.xml"`; do rm -f $i; done

 

This will create the files:

 

On the new 64bit server:

cd /usr/local/nagios/share/perfdata/
for i in `find -name "*.rrd"`; do rm -f $i; done
tar -xvzf perfdata.tar.gz
for i in `find -name "*.rrd.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
for i in `find -name "*.rrd"`; do chown nagios:nagios $i; done
for i in `find -name "*.rrd.xml"`; do rm -f $i; done

cd /var/lib/mrtg/
for i in `find -name "*.rrd"`; do rm -f $i; done
tar -xvzf mrtgdata.tar.gz
for i in `find -name "*.rrd.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done
for i in `find -name "*.rrd"`; do chown nagios:nagios $i; done
for i in `find -name "*.rrd.xml"`; do rm -f $i; done

 

When this completes the historic performance data will be migrated from the old server.

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Article ID: 166
Created On: Tue, Jan 26, 2016 at 9:32 PM
Last Updated On: Tue, Sep 18, 2018 at 8:45 PM
Authored by: tlea

Online URL: https://support.nagios.com/kb/article/nagios-xi-migrate-performance-data-166.html