Page 1 of 1

restore script issue

Posted: Tue Apr 12, 2016 12:39 pm
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?

Re: restore script issue

Posted: Tue Apr 12, 2016 1:54 pm
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

Re: restore script issue

Posted: Tue Apr 12, 2016 3:16 pm
by benhank
im not familiar with mysql commands =(
which machine do I run that on? the remote or local?

Re: restore script issue

Posted: Tue Apr 12, 2016 3:37 pm
by scottwilkerson
The one running the offloaded mysql server. Did you offload the mysql server or did someone else?

Re: restore script issue

Posted: Tue Apr 12, 2016 4:01 pm
by benhank
someone else. ill run those commands and let you know how it went and thanks!

Re: restore script issue

Posted: Tue Apr 12, 2016 4:23 pm
by bwallace
Thanks benhank, keep us posted.....

Re: restore script issue

Posted: Fri Apr 22, 2016 11:00 am
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!