Repair Database script does not work on Offloaded DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Repair Database script does not work on Offloaded DB

Post 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.

5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Repair Database script does not work on Offloaded DB

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: Repair Database script does not work on Offloaded DB

Post 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.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked