Page 1 of 1

Repair Database script does not work on Offloaded DB

Posted: Sun Mar 13, 2016 8:35 pm
by rajasegar
Repair database script does not work on Offloaded DB.
Please provide a scripts that works.

Thanks

Code: Select all

[nagios@nagiosprodxi1 scripts]$ sudo ./repair_databases.sh
mysqld is stopped
Starting mysqld:                                           [  OK  ]
mysqld (pid  7274) is running...
DATABASE: nagios
TABLE:
/usr/local/nagiosxi/scripts/repairmysql.sh: line 49: pushd: /var/lib/mysql/nagios: No such file or directory
ERROR: Could not change to dir: /var/lib/mysql/nagios
mysqld (pid  7274) is running...
DATABASE: nagiosql
TABLE:
/usr/local/nagiosxi/scripts/repairmysql.sh: line 49: pushd: /var/lib/mysql/nagiosql: No such file or directory
ERROR: Could not change to dir: /var/lib/mysql/nagiosql
Stopping ndo2db: done.
Starting ndo2db: done.
Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.


Re: Repair Database script does not work on Offloaded DB

Posted: Mon Mar 14, 2016 2:55 pm
by tgriep
You can use the following command below to repair the Mysql databases. Run it from the XI server.
Replace <user>, <password> and xxx.xxx.xxx.xxx with the correct information for your server.

Code: Select all

mysqlcheck -f -r -u <user> -p<password> --databases nagios nagiosql -h xxx.xxx.xxx.xxx

Re: Repair Database script does not work on Offloaded DB

Posted: Mon Mar 14, 2016 7:40 pm
by rajasegar
tgriep wrote:You can use the following command below to repair the Mysql databases. Run it from the XI server.
Replace <user>, <password> and xxx.xxx.xxx.xxx with the correct information for your server.

Code: Select all

mysqlcheck -f -r -u <user> -p<password> --databases nagios nagiosql -h xxx.xxx.xxx.xxx
Ok. Thanks.
Ideally the repair script should pick all this up automatically from the relevant xml files.

Anyway please close this case.