Page 1 of 3

NagiosXI Server Migration Problem

Posted: Wed Feb 29, 2012 7:20 am
by srrhd
Hi,

We need to migrate our NagiosXI 2011R2.1 on a more powerful server.

The originate server is a i386 CentOS 5, and the new one a x_64 CentOS 6.

After the NagiosXI installation on the new server, we have followed the Backing_Up_And_Restoring_XI.pdf to implement the configuration on the new installation.

The problem is that after the backup restoration on the new server, the System show that Performance Garpher and the Database Backend are not running. When trying to start both from the Administration Page:
  • * Performance Grapher: it prompt a message saying "An error occured processing your request."
    * Database Backend: nothing is prompted.
We tryied to investigate the logs into "/usr/local/nagios/var", "/usr/local/nagiosxi/var" and "/var/log/messages" but found any informations that give a clue on the problem.

So here i am, asking for any ideas that could help.

Aurelien.

Re: NagiosXI Server Migration Problem

Posted: Wed Feb 29, 2012 10:33 am
by scottwilkerson
My guess is we have a permissions problem, but not 100% sure. Can I have you run the following procedure
http://library.nagios.com/library/produ ... -nagios-xi

Then lets do the following:

Code: Select all

service nagios stop
service ndo2db stop
service npcd stop
service mysqld stop
service postgresql stop
service nagiosxi stop

service npcd start
service ndo2db start
service mysqld start
service postgresql start
service nagios start
service nagiosxi start

Re: NagiosXI Server Migration Problem

Posted: Wed Feb 29, 2012 1:00 pm
by scottwilkerson
I see the problem...

When switching version or architectures this can be a problem because the backup is overwriting the compiled binaries.

Here is a solution.

If you still have the /tmp/nagiosxi install directory do the following:

Code: Select all

cd /tmp/nagiosxi
rm -f installed.subcomponents
./A-subcomponents
If you have already deleted the /tmp/nagiosxi install directory do the following:

Code: Select all

cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/xi-2011-latest.tar.gz
tar xzf xi-2011-latest.tar.gz
cd /tmp/nagiosxi
touch installed.mrtg
./A-subcomponents

Re: NagiosXI Server Migration Problem

Posted: Thu Mar 01, 2012 12:04 am
by srrhd
Thanks ! Your second idea was the good one !

In case this thread would interest someone else, after following this solution restart the Performance Grapher and the Database Backend works and we nhad to restart the Monitoring Engine to have the whole system working properly.

We will test the server today and will provide feedback if anything got a wrong behaviour.

Re: NagiosXI Server Migration Problem

Posted: Thu Mar 01, 2012 2:19 am
by srrhd
We have no more performance graphs, any.

Following the FAQ and executing

Code: Select all

./check_rrdtraf -f '/var/lib/mrtg/192.168.6.1_1.rrd' -w 1 -c 2
It appears thats the RRD files are also compiled depending on the architecture:

Code: Select all

[root@perfdata]# /usr/local/nagios/libexec/check_rrdtraf -f '/var/lib/mrtg/192.168.1.1_1.rrd' -w 1 -c 2
ERROR: This RRD was created on another architecture
OK - Current BW in: 0bps Out: 0bps|in=0b/s;1;2 out=0b/s;1;2
Google seems to know a method to convert the rrd files. I'll let you know if it works.

Re: NagiosXI Server Migration Problem

Posted: Thu Mar 01, 2012 5:41 am
by srrhd
OK so that was the trick, we had to convert all the RRD files.

To do so:
On the old i386 server:

Code: Select all

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
Then transfert the archive to the new server in the same directory.
On the new x_64 server:

Code: Select all

service nagiosxi stop
service npcd stop
service ndo2db stop
service nagios stop
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
service nagios start
service ndo2db start
service npcd start
service nagiosxi start
Now our graphs are back with just the loose of time for the commands to execute, depending on the number of hosts and services.

Re: NagiosXI Server Migration Problem

Posted: Thu Mar 01, 2012 8:31 am
by scottwilkerson
We really appreciate you documenting this so others can benefit.

Thank you.

Re: NagiosXI Server Migration Problem

Posted: Mon Mar 05, 2012 6:55 am
by srrhd
Hi,

We are trying to get the new x_64 server as the production one. For this we simply swapped the IPs between the i386 and the x_64.

After the swap, we had no more perf data. After following the Repairing_the_Nagios_XI_Database, the graphs went back. Now evrything looks good, except for all our bandwidth services that use the check_xi_service_mrtgtraf ("Network Switch / Router Wizard"). It looks like the results are divided by 100000 and so appears in ub/s instead of Mb/s.

This problem seems to be similar to this thread (http://support.nagios.com/forum/viewtop ... t=mrtgtraf) but yum do not provides any 2.17 mrtg version.
Here are what we got:
  • [root@NagiosXI lib]# rpm -qa | grep mrtg
    nagios-plugins-mrtg-1.4.15-2.el6.x86_64
    mrtg-libs-2.16.2-5.el6.x86_64
    mrtg-2.16.2-5.el6.x86_64
    nagios-plugins-mrtgtraf-1.4.15-2.el6.x86_64
We tryied to delete the bandwith services for one hosts and recreate them through the wizard but the problem persists.

Re: NagiosXI Server Migration Problem

Posted: Mon Mar 05, 2012 10:40 am
by mguthrie
I know we've come across this before, I'll have the developer who found the solution chime in once he gets in.

Also, I wanted to thank you for posting your RRD migration commands, I posted them to our wiki:
http://support.nagios.com/wiki/index.ph ... Install.3F
That's something we hadn't tried before, great solution!

Re: NagiosXI Server Migration Problem

Posted: Tue Mar 06, 2012 12:16 am
by srrhd
Your welcome, having a well detailed forum is better for all of us, and with all works you are doing on XI, this is the minimum that we can do.

Concerning the problem of unit using mrtgtraf, i don't know if the developper will have a straight solution or if he will need to do some devel. In the last case, we also use the check_snmp_int.pl, one great thing with this plugins is that it provides the perf data and monitore the status of the interface all in the same service. I guess this may lighten the server as it devide by 2 the number of services. I will ask for this in the Nagios Ideas Forum.

Cheers,
Aurelien.