Moving configurations from AWS to ESXi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Moving configurations from AWS to ESXi

Post by jacek »

We have an Nagios XI Enterprise in the AWS cloud with offloaded DB (DB server also in the AWS).
We have also an backup/testing VM on our local ESXi machine (but different setup).

How can I move (copy) all the configuration from AWS to the ESXi VM?
For obvious reasons I would like to test some things before they go live, and as long as I have an different (old) setup in the backup I can't.

How can I achieve that?
Should I backup the AWS VM and move it to the ESXi? but then I would delete the existing license on the local ESXi and need to re-activate it?

PS. I don't think the Subject I used is a good one, but Maybe somebody has a better idea? :-)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Moving configurations from AWS to ESXi

Post by Box293 »

Our backup and restore procedure is the simplest way to achieve this. This document that explains the backup and restore process:
https://support.nagios.com/kb/article.php?id=180

Your license entitles you to three instances of XI as per this definition:
https://support.nagios.com/kb/article.php?id=145

Once you've decommissioned the OLD XI server, email [email protected] with the IP address of the old server and they will de-activate it.

Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Moving configurations from AWS to ESXi

Post by jacek »

The procedure covered by the PDF doesn't cover my situation.
My production server has it's DB offloaded to an external server, and the backup/test server not.

So when I did the backup from production and tried to recover it on the backup/test one it yelled at me, that He can't find the external DB or the password is wrong.
It looks like I would need to edit some files in the backup package to make the recovery script recover the DB to the local Nagios DB server.

Anyone that knows how to do that?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Moving configurations from AWS to ESXi

Post by rkennedy »

Take a look at https://assets.nagios.com/downloads/nag ... Server.pdf - you may need to reverse the steps a bit, but this should give you an idea of what all is being changed when it is initially offloaded.
Former Nagios Employee
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Moving configurations from AWS to ESXi

Post by jacek »

Hi, approaching this issue once again.
I am planning to dump the TST/Backup VM and install a fresh one and I have a few questions:
  • can I backup the license from the current machine and import it to the new one? I will isntall the fresh machine under the same IP address. If yes, how?
  • after I fresh install the machine - can I create a backup in the PRD and import in into the TST/Backup? So if the TST/Backup machine will have access to the offloaded DB then everything should work fine?
  • should I disable the whole monitoring engine or only notifications to not violate the license terms?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Moving configurations from AWS to ESXi

Post by rkennedy »

slytheer wrote:Hi, approaching this issue once again.
I am planning to dump the TST/Backup VM and install a fresh one and I have a few questions:
  • can I backup the license from the current machine and import it to the new one? I will isntall the fresh machine under the same IP address. If yes, how?
  • after I fresh install the machine - can I create a backup in the PRD and import in into the TST/Backup? So if the TST/Backup machine will have access to the offloaded DB then everything should work fine?
  • should I disable the whole monitoring engine or only notifications to not violate the license terms?
1. I don't believe so, you'll need to enter the license once again on the new machine. If you run into issues, contact [email protected] as they handle all licensing, and we have no access to it here.
2. Yes, as long as the offloaded DB is still accessible to the ESXI machine. As long as you corrected the files with the correct offloaded information from the link I posted previously, then yes that should work. The reason being is the backup takes a copy of the files.
Nagios Core files (/usr/local/nagios)
Nagios XI files (/usr/local/nagiosxi)
3. After getting the new machine up and verify it's working, I would spin down the old system. One thing to make sure - ensure that the old Nagios machine is NOT talking to the offloaded DB at the same time as the new server.
Former Nagios Employee
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Moving configurations from AWS to ESXi

Post by jacek »

2. So I should not let both nagios machines work on the same DB, first create an copy for TST purposes, right?
3. You misunderstood me, I will dump my current TST, then build up an new one, and import all config from the PRD so I'm on the same page. So my intention will be leaving the new server running for TST/Backup purposes, but I would like to do it acc. to the license terms, so what do I need to disable? Whole monitoring engine or only notifications?

I will need to script the whole backup/restore + DB sync so I will have the TST fairly good mirrored with the PRD env.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Moving configurations from AWS to ESXi

Post by tgriep »

2. No, you should not have both Nagios servers share the same database as this will corrupt them and cause issues. Backup the original server, shut it down, restore to the new and start it up, that is how you should do it.
3. You could globally disable the Active / Passive checks and Notifications and that should work with the Licensing scheme.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Moving configurations from AWS to ESXi

Post by jacek »

OK, did it:
  • run the backup script (it grabs everything including offloaded DB's)
    /usr/local/nagiosxi/scripts/backup_xi.sh
  • pull the file to the TST server
  • within the backup archive edit all files with the DB's creds and addresses (ndo2db, config.inc.php, settings.php) -> Page 4 in https://assets.nagios.com/downloads/nag ... Server.pdf
  • update the archive with the modified files
  • restore the backup on the TST server
    /usr/local/nagiosxi/scripts/restore_xi.sh
  • that's all, worked fine with my XI (5.2.9).
Maybe worth thinking of creating an switch in the restore_xi.sh script to use the local servers DB creds and address instead of those sitting in the backup?
I think this is easy to do, and would give a cool function out of the box.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Moving configurations from AWS to ESXi

Post by tgriep »

Glad that you have it working now.
The idea to have the restore go to a different MYSQL server has already been brought up and a feature request has been put in for it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked