×

Migrate Performance Data in Nagios - Step by Step Process ?


Migrate Performance Data in Nagios - Step by Step Process ?

Generally, the performance data we use to generate graphs are in Round Robin Database (RRD) files. The RRD performance data files are compiled binaries.

So, for a simple file transfer, a user should have the architecture match on both machines.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform several Nagios queries.

In this context, we shall look into steps to perform Database Migration.


Migrate Performance Data in Nagios

To migrate files from a 32 bit to 64-bit machine, we have to convert the data to XML and import it into RRD's on the new machine.

We suggest the following steps to migrate the data:


1. On the old 32 bit 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

Eventually, this will create the files:

i. /usr/local/nagios/share/perfdata/perfdata.tar.gz

We need to transfer this to the /usr/local/nagios/share/perfdata/ directory on the new server.

ii. /var/lib/mrtg/mrtgdata.tar.gz

On the other hand, we need to transfer to the /var/lib/mrtg/ directory on the new server.


2. Then on the new 64-bit 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

Once this completes, the historic performance data will migrate from the old server.


[Need help with the Data migration? We'd be happy to assist. ]

Who We Are ?

Most prominent, efficient, and well-performing IT companies and software solutions.

Related Posts