how to migrate configuration from one nagios server to other

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

how to migrate configuration from one nagios server to other

Post 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.
kyang

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

Post 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?
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

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

Post by pfsweb »

Our old nagios server is Nagios XI 5.2.0 and the new server is Nagios XI 5.4.13
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

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

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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.
Former Nagios employee
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

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

Post 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?
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

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

Post 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
pfsweb
Posts: 47
Joined: Fri Jun 27, 2014 9:01 am

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

Post 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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

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

Post 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;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked