Nagios XI backup on one system and restore it to another

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Nagios XI backup on one system and restore it to another

Post by xlin125 »

We currently have a primary Nagios XI server and a standby Nagios XI server. Both are installed with Nagios XI 2014R2.7 and run on Redhat 6.5. We run backup_xi.sh to download Nagios XI from the primary Nagios XI server and restore it (restore_xi.sh) to the standby one. This works fine.

Now we want to take a backup from the primary Nagios XI server on Redhat 6.5 and restore it on another new built Nagios XI server on Redhat 6.7 with the same Nagios XI 2014.R2.7 installed. Do you see any issues of doing that? Note that the Apache web server, PostgreSQL database and MySQL database on the new built server are installed from the Redhat 6.7 RPM packages. Also the files in Nagios XI backup from the primary Nagios XI server were compiled/built on Redhat 6.5, but will be restored on the new built Nagios XI server which is on Redhat 6.7. Is there a compatibility problem for some codes/tools/databases? I like to hear from you before I go ahead to do it. Thanks!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios XI backup on one system and restore it to another

Post by hsmith »

xlin125 wrote:Do you see any issues of doing that?
Possible, but I can't think of a reason off the top of my head. If one is 32 bit and one is 64, then problems may arise.
xlin125 wrote:Is there a compatibility problem for some codes/tools/databases? I like to hear from you before I go ahead to do it. Thanks!
It's untested by us. I would recommend you take a VM snapshot, and then try. I believe it will work, but I don't know as it's untested.
Former Nagios Employee.
me.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: Nagios XI backup on one system and restore it to another

Post by xlin125 »

Thanks for the quick response!

All machines are 64-bit. The only thing that bothering me is the backup is taken from an Nagios XI server on Redhat 6.5 and restore it to another Nagios XI server on Redhat 6.7, even both Nagios XI servers are on Nagios XI 2014R2.7. Any other comments and/or suggestions besides giving it a try on a VM? Thanks in advance!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios XI backup on one system and restore it to another

Post by hsmith »

The backup script is in cleartext, and you can see exactly what it is doing.

Code: Select all

/usr/local/nagiosxi/scripts/backup_xi.sh
It is concerning that you already have these packages installed, there could be some issues getting the fullinstall script to even run. The script to install XI is assuming a clean system.

If XI installs correctly, I don't see why it would be a problem to import your data.
Former Nagios Employee.
me.
xlin125
Posts: 172
Joined: Mon Jan 19, 2015 6:01 pm

Re: Nagios XI backup on one system and restore it to another

Post by xlin125 »

The server on Redhat 6.5 with Nagios XI 2014R2.7 was built 6 months ago in the lab. We have added hosts, services, host groups, etc.. to this Nagios XI server. Now we just successfully installed Nagios XI 2014R2.7 on a new server on Redhat 6.7 in production. We wanted to take all we added (hosts, services, host groups, etc) and "move" them to this production server without adding these hosts, services, host groups and other templates by hands because this would add a lot of work and may have typo, or missing something. We do that between two Nagios XI servers that are installed with the same Linux release Redhat 6.5 and same Nagios XI 2014R2.7. What I worry about is that if we take the output of backup_xi.sh from the Nagios XI server on Redhat 6.5 with Nagios XI 2014R2.7, and restore it to the new built Nagios XI server on Redhat 6.7 with Nagios XI 2014R2.7 to get all the configurations, will there be any impact to the Nagios XI server with these restore files/db? I can see that some of the executable files in /usr/local/nagios/bin are different (in size) between the Nagios XI server on Redhat 6.5 and the Nagios XI server on Redhat 6.7 due to the installation environment (installed/complied on RHEL 6.5 vs installed/compiled on RHEL 6,7). I also mentioned before that the Apache web server packages, postgreSQL packages and MySQL packages are not the same on Redhat 6.5 and Redhat 6.7 (newer releases on Redhat 6.7).

Is there a way/scripts that can be used to just download the configuration (hosts, services, host groups, template groups, etc.) from a Nagios XI and upload to another Nagios XI without replacing the /usr/local/nagios, /usr/local/nagiosxi, /usr/local/nagios/nrdp, etc on the target Nagios XI server? Any suggestions and help will be appreciated.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios XI backup on one system and restore it to another

Post by tmcdonald »

Strictly speaking, if all you want is the configs you can grab them from /usr/local/nagios/etc and use the import functionality on the new system:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

However, this will not import the XI *users* which could mess up your notifications. Also will not import dashboards, NRDP settings, custom views, etc.
Former Nagios employee
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: Nagios XI backup on one system and restore it to another

Post by SteveBeauchemin »

I've had to do this a few times in the last couple months of last year. We had a storage failure and I HAD to do this.

I found that if I install Nagios XI on the new host first, then run the restore, it does a pretty good job. If you have many perl tests, you may have to add missing perl modules. I had more than 200 to add, what with JMX, ESX and other tests in place. I also had to install Oracle Client, and other DB stuff to get other tests working properly. There were so many little annoyances to fix. You forget all the little things you touch to make the system work the way you want.

I ended up running the restore script, debugging until everything worked again. Took a week or so. Then I ran backup on the original host again, and did the restore again. If it looked good, then I made the new server my real server and put the old one to sleep.

If you use NagVis you will have to either add that to the backup and restore scripts yourself, or just deal with it after.

You can read the backup and restore scripts, see what they do, and do it all manually. Unless you are in a hurry.

All the script does is make it easier, but you can do it all manually. It will teach you a lot of things.

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios XI backup on one system and restore it to another

Post by tgriep »

xlin125, is the link for importing the config files in to your new system what you are looking for?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked