Page 1 of 2

how to migrate configuration from one nagios server to other

Posted: Thu May 17, 2018 7:01 am
by pfsweb
Hi,

how to migrate configuration file from one nagios server to other nagios server. Please provide document.

We have one running nagios server, created new nagios one need to move the all configuration from old to new.

Re: how to migrate configuration from one nagios server to o

Posted: Thu May 17, 2018 11:56 am
by kyang
Which "Nagios" are you using?

Nagios XI or Nagios Core? Or a different product? Nagios Fusion, Nagios Log Server, Nagios Network Analyzer?

What version is the old and what version is the new?

Re: how to migrate configuration from one nagios server to o

Posted: Fri May 18, 2018 1:55 am
by pfsweb
Our old nagios server is Nagios XI 5.2.0 and the new server is Nagios XI 5.4.13

Re: how to migrate configuration from one nagios server to o

Posted: Fri May 18, 2018 1:28 pm
by scottwilkerson
You should be able to perform a backup and then restore just fine
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

However, one thing to point out is that I want to point out is that this restore will bring you back to 5.2.0, so you will then want to perform an upgrade.

Code: Select all

cd /tmp
rm -rf nagiosxi xi*
wget https://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
tar xzf xi*.tar.gz
cd /tmp/nagiosxi
./upgrade

Re: how to migrate configuration from one nagios server to o

Posted: Mon May 21, 2018 2:32 am
by pfsweb
If we have take the backup from Nagios XI 5.2.0 and can we restore the backup to new server Nagios XI 5.4.13

Re: how to migrate configuration from one nagios server to o

Posted: Mon May 21, 2018 10:07 am
by tmcdonald
Whatever version the software is when you back it up is the version it will be when you restore it. We do not advise restoring an older version over a newer one.

Re: how to migrate configuration from one nagios server to o

Posted: Tue May 22, 2018 2:18 am
by pfsweb
then except restore, is there any way to move configuration file from old nagios server Nagios XI 5.2.0 to nagios server Nagios XI 5.4.13?

Re: how to migrate configuration from one nagios server to o

Posted: Tue May 22, 2018 6:24 am
by pfsweb
i tried restore the backup but i got a warning saying resore a OS 6 backup on a OS 7 system

Compiled plugins and other binaries as welll as httpd configurations will not be restored

Re: how to migrate configuration from one nagios server to o

Posted: Tue May 22, 2018 6:46 am
by pfsweb
after restore getting the below error


Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh
Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh

Re: how to migrate configuration from one nagios server to o

Posted: Tue May 22, 2018 4:18 pm
by cdienger
Run the following on the new server:

cat /usr/local/nagiosxi/html/config.inc.php | sed -rn "/\"ndoutils\" => array\(*/,/\"dbmaint\"/p" | grep -o -P '(?<="dbserver" => ).*(?=,)' | tr -d \'

If the database is not hosted on localhost, then you'll need to update your datbase's config to allow the new machine to connect. https://assets.nagios.com/downloads/nag ... Server.pdf contains the commands to be run on the database server:

mysql -u root -p'mypassword'
create database nagios;
GRANT ALL ON nagios.* TO nagios@'<IP_OF_NAGIOS_XI_SERVER>' IDENTIFIED BY 'nagios';
create database nagiosql;
GRANT ALL ON nagiosql.* TO nagiosql@'<IP_OF_NAGIOS_XI_SERVER>' IDENTIFIED BY 'nagiosql';
create database nagiosxi;
GRANT ALL ON nagiosxi.* TO nagiosxi@'<IP_OF_NAGIOS_XI_SERVER>' IDENTIFIED BY 'nagiosxi';
quit;