Page 1 of 2
nagios db crashed tables =(
Posted: Tue Jul 19, 2016 1:20 pm
by benhank
hey guys
imm getting this error on my production server:
Code: Select all
] /usr/libexec/mysqld: Table './nagios/nagios_statehistory' is marked as crashed and last (automatic?) repair failed
because its production im hesitant to do any repairs.
one thing I did do was a manual restore from the daily backups, but i think the daily was messed up as well. can we log a ticket and have someone look at it pls?
I normally would not come out the gate with this request but its production.
thanks
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 1:39 pm
by ssax
You will need to repair the DB, please run these commands:
Code: Select all
service nagios stop
service ndo2db stop
service mysqld restart
cd /usr/local/nagiosxi/scripts
./repair_databases.sh
This will automatically start the services back up so go ahead and test after that.
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 1:39 pm
by ssax
If your DB is offloaded you will need to run the repair on the mysql server.
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 2:40 pm
by benhank
rgr rgr
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 2:48 pm
by rkennedy
@benhank - report back after repairing. Over. Kssssht.
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 2:50 pm
by lmiltchev
You can also try running the following command on the remote (offloaded) box:
Code: Select all
mysqlcheck -r -f -u root -pnagiosxi --databases nagios nagiosql nagiosxi
Let us know if this fixed your issue.
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 3:06 pm
by benhank
before I run said commands, any chance that my production machine will go down? I don't have a good backup because of this issue.
I forgot to mention, this issue is on a 2014 version of xi.
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 3:16 pm
by ssax
I've never seen an issue caused from running a repair. That being said, it will go down when you stop the nagios/ndo2db/mysqld services.
Is it a VM, can you take a snapshot?
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 3:22 pm
by benhank
i should not have doubted the team...
That did it running the repair script fied the problem. Thanks team!
Re: nagios db crashed tables =(
Posted: Tue Jul 19, 2016 3:35 pm
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?