restore script issue

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

restore script issue

Post by benhank »

I'm trying to do a restore XI.
We are running xi 20142.7 with mysql offloaded to a remote server and postgresql is running locally.
The backup was created on my primary server in Admin/scheduled backups/ssh, which pushes the file to my secondary machine.
I'm using the script :

Code: Select all

/usr/local/nagiosxi/scripts/restore_ix.sh
and get the following error:

Code: Select all

ERROR 2005 (HY000): Unknown MySQL server host '-u' (1)
Error restoring MySQL database 'nagios' - check the password in this script!
[root@lkendrwatsonp01 ~]#
We only have two possible passwords and I have tried both of them.
The backup tarball has both db's so that's not an issue. After the restore I can browse to the Secondary's webgui and see:
Capture.PNG
running the repair doesn't work:

Code: Select all

===============
REPAIR COMPLETE
===============
ndo2db was not running... could not stop
Starting ndo2db: done.
Running configuration check...
Stopping nagios:/etc/init.d/nagios: line 142: kill: (31028) - No such process
 done.
Starting nagios: done.
[root@lkendrwatsonp01 ~]#
in order to get the Secondary running I have to follow the instructions from a different post:

Code: Select all

https://support.nagios.com/forum/viewtopic.php?f=16&t=37722
Additionally, since the Primary is set up to offload the mysqldb, I have configured the following files to point to localhost on the Secondary and copy them back to thier original locations:

Code: Select all

cp /usr/local/nagios/etc/ndo2db.cfg
cp /usr/local/nagiosxi/html/config.inc.php 
cp  /var/www/html/nagiosql/config/settings.php

and the issue is fixed. Is there a way around this?
You do not have the required permissions to view the files attached to this post.
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: restore script issue

Post by scottwilkerson »

benhank wrote:Additionally, since the Primary is set up to offload the mysqldb, I have configured the following files to point to localhost on the Secondary and copy them back to thier original locations:

Code: Select all

    cp /usr/local/nagios/etc/ndo2db.cfg
    cp /usr/local/nagiosxi/html/config.inc.php
    cp  /var/www/html/nagiosql/config/settings.php

and the issue is fixed. Is there a way around this?
Ben can you set the host info to the IP address of the machine, and then add that IP to allow access to MySQL? The MySQL command would be something like:

Code: Select all

GRANT ALL ON nagios.* TO nagios@'<IP_OF_LOCAL_XI_SERVER>' IDENTIFIED BY 'nagios';
GRANT ALL ON nagiosql.* TO nagiosql@'<IP_OF_LOCAL_XI_SERVER>' IDENTIFIED BY 'nagiosql';
See page 3: https://assets.nagios.com/downloads/nag ... Server.pdf
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: restore script issue

Post by benhank »

im not familiar with mysql commands =(
which machine do I run that on? the remote or local?
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: restore script issue

Post by scottwilkerson »

The one running the offloaded mysql server. Did you offload the mysql server or did someone else?
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: restore script issue

Post by benhank »

someone else. ill run those commands and let you know how it went and 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
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: restore script issue

Post by bwallace »

Thanks benhank, keep us posted.....
Be sure to check out the Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: restore script issue

Post by benhank »

it didn't work. you guys can close this. I need to find a different way to do what I'm trying to do. 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
Locked