Don’t know how to Migrate Performance Data in Nagios? We can help you.
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.
As part of our Server Management Services, we assist our customers with several Nagios queries.
Today, let us discuss how to perform the 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.
Our Support Techs suggest the following steps to migrate the data:
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:
- /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.
- /var/lib/mrtg/mrtgdata.tar.gz
On the other hand, we need to transfer to the /var/lib/mrtg/ directory on the new server.
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 migration? We’d be happy to assist]
Conclusion
In short, to migrate, we have to convert the data to XML and import it into RRD’s on the new machine. Today, we saw an effective method our Support Techs employ in order to perform this task.
0 Comments