Modify restore script to support remote dbs

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Modify restore script to support remote dbs

Post by benhank »

Hey guys is it possible to modify the restore script so that it will restore db's hosted on a different server?
for instance my Prod server has an offloaded mysql db hosted on Remotedbsvr.

If I run the restore script, I would like to have the script restore the mysqldb to Remotedbsvr.
I already have ssh passwordless login enabled on both servers.
Thanks!
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Modify restore script to support remote dbs

Post by scottwilkerson »

are you talking about the restore_xi.sh script?

because it does do this, however you need to set the remote system up to allow connections from your IP for the root user, then at the top of the script you need to edit this line with the password for the remote server, replacing nagiosxi

Code: Select all

themysqlpass="nagiosxi"
This is really the only way to do it because the script needs access to the mysql servers root user to drop/restore the databases
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: Modify restore script to support remote dbs

Post by benhank »

ah ok. Thanks I didnt know that it did it already. you can lock it up.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked