Quick DR question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Quick DR question

Post by BanditBBS »

Ok,

So I have two datacenters. In City1 my production nagios and production offloaded DB/NDO2DB server reside. In City2 I have a DR XI server just sitting there doing nothing. I have a folder being rsynced between the two that contains the daily backups from City1. I use rsync instead of the ssh or ftp so I can limit the bw utilization and so only one backup is being compressed up.

My question here is...if I have a failure of City1 datacenter and we make the decision to bring up the XI server in City2, what kind of issue is that going to bring up since the configs are set to go to a remote DB server and for NDO2DB not to be running locally?

Will I have to modify the backup file and undo the offloading steps before I run the restore_xi.sh script so it attaches to the local DB in City2?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Quick DR question

Post by ssax »

From reading the restore_xi.sh script and from my testing, I have validate that these things are true:

1. The restore_xi.sh script will use your current city2 DB configuration (localhost) and restore the DB to the localhost.
2. During the restore it will revert these files that will re-setup your offloaded configuration:

Code: Select all

/usr/local/nagios/etc/ndo2db.cfg
/usr/local/nagiosxi/html/config.inc.php
/var/www/html/nagiosql/config/settings.php
3. It will revert the rest of your config files (nagios.cfg, etc)
4. It will even revert your restore_xi.sh script and undo any changes that you might want to make to overcome these issues.
5. At the end of the script it will restart the services and will try to connect to the offloaded DB.

So knowing this, here is what you would need to do:

Create a directory that you will copy in any of your configuration files that you want to keep and copy those files in there:

Code: Select all

mkdir /mylocalhostconfigs
cp /usr/local/nagios/etc/ndo2db.cfg /usr/local/nagiosxi/html/config.inc.php /var/www/html/nagiosql/config/settings.php /mylocalhostconfigs
Run the restore.

Stop the services:

Code: Select all

/etc/init.d/httpd stop
/etc/init.d/npcd stop
/etc/init.d/ndo2db stop
/etc/init.d/nagiosxi stop
/etc/init.d/nagios stop
Copy the files back:

Code: Select all

cp /mylocalhostconfigs/ndo2db.cfg /usr/local/nagios/etc/ndo2db.cfg
cp /mylocalhostconfigs/config.inc.php /usr/local/nagiosxi/html/config.inc.php
cp /mylocalhostconfigs/settings.php /var/www/html/nagiosql/config/settings.php
Start the services:

Code: Select all

/etc/init.d/httpd start
/etc/init.d/npcd start
/etc/init.d/ndo2db start
/etc/init.d/nagiosxi start
/etc/init.d/nagios start
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Quick DR question

Post by BanditBBS »

ssax,

That's perfect! Now I don't have to document it :) Close this up and thanks!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked