Table error in DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fodorm
Posts: 18
Joined: Wed Aug 14, 2013 10:24 am

Table error in DB

Post by fodorm »

I am seeing this error repeated in the message logs:

Oct 2 03:26:05 horcrux2 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'

We had an incident over the weekend where Nagios was alerting numerous items down but spot checks showed the items up. Any ideas?

Thanks,

-Matt
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Table error in DB

Post by lmiltchev »

Run the DB repair script:

Code: Select all

cd /usr/local/nagiosxi/scripts
./repair_databases.sh
restart mysqld:

Code: Select all

service mysqld restart
and check the log for errors/crashed tables:

Code: Select all

tail -50 /var/log/mysqld.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
fodorm
Posts: 18
Joined: Wed Aug 14, 2013 10:24 am

Re: Table error in DB

Post by fodorm »

I ran the script and am seeing this when tailing the log:

161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:07 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_hoststatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired
161003 13:04:08 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_customvariablestatus' is marked as crashed and should be repaired
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Table error in DB

Post by lmiltchev »

How much space to you have on the hard drive?

Code: Select all

df -h
Try running:

Code: Select all

mysqlcheck -r -f -uroot -pnagiosxi --all-databases
restart mysqld:

Code: Select all

service mysqld restart
and check the log again:

Code: Select all

tail /var/log/mysqld.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
fodorm
Posts: 18
Joined: Wed Aug 14, 2013 10:24 am

Re: Table error in DB

Post by fodorm »

The issue now appears resolved. Thanks for your assistance.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Table error in DB

Post by avandemore »

Glad this resolved your issue fodorm. I'm closing this thread now. Please open a new one for any further issues.
Previous Nagios employee
Locked