Page 1 of 1

database corruption not fixed by the repair script

Posted: Mon Aug 19, 2019 10:09 am
by Chris Hardick
Hi

I am running Nagios XI 5.6.2 from VMWare on Windows 10 PC, currently only monitoring a single windows 10 PC as we finalise configurations.

The monitoring PC was subject to a power cycle and it now appears the Nagios DB is corrupt and the standard repair script fails.
error seen on Nagios is
SQL Error [ndoutils]: incorrect File format 'nagios_service_status'
dbrepair.log
the script does output 5 lines indicating a particular table is not a MyISAM-table, they are:
nagios_eventhandlers
nagios_logentries
nagios_notifications
nagios_servicestatus
nagios_systemcommands
full example:
myisamchk: error: 'nagios_eventhandlers' is not a MyISAM-table

NOTE that the warning text does not include .MYI as per nagios database repair guide which would have indicated they were of the wrong format and needed to be converted.

This instance of Nagios has been running for about 2 months, and was created using the 5.6.2 VM, it hasnt been updated except for a plugin.

Thanks for your help

Chris

Re: database corruption not fixed by the repair script

Posted: Mon Aug 19, 2019 10:35 am
by mbellerue
Hi Chris,

Can you give me the output of this command?

Code: Select all

ls -lh /var/lib/mysql/
The fact that 5 of the tables aren't reporting as MyISAM, and 2 critical databases are missing has me worried that there is actual lost data here.

Re: database corruption not fixed by the repair script

Posted: Tue Aug 20, 2019 5:30 am
by Chris Hardick
Hi

output is as follows
directory list.PNG
Thanks

Chris

Re: database corruption not fixed by the repair script

Posted: Tue Aug 20, 2019 10:17 am
by mbellerue
Okay, the directories for those databases are there. That's good. We should check to make sure that the database files exist as well.

Code: Select all

ls -lh /var/lib/mysql/nagiosql/
ls -lh /var/lib/mysql/nagiosxi/
Let's also check to make sure that they've been imported into MySQL.

Code: Select all

mysql -u root
show databases;