Page 1 of 1

Problem with repairing NagiosXI database

Posted: Thu Apr 24, 2014 3:09 am
by mon-team
Hi all,

I found that 2 tables in Nagios XI database are crashed , respectively nagios_externalcommands and nagios_notifications
I have tried the procedure founded at this link http://assets.nagios.com/downloads/nagi ... tabase.pdf
I have ran the following command
service nagios stop
service mysqld stop
cd /var/lib/mysql/nagios

myisamchk -r -f nagios_externalcommands.MYI
myisamchk -r -f nagios_notifications.MYI

service mysqld start
service nagios start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/local/nagiosxi/cron/dbmaint.php

After restarting mysql and nagios I saw that the problem is not resolved
Any suggestions?
Thanks

Re: Problem with repairing NagiosXI database

Posted: Thu Apr 24, 2014 9:26 am
by slansing
You don't need to touch any services to run the database repair scripts, the repair script should take care of this, what does the following output, please attach the text file output that should be in /tmp/:

Code: Select all

/usr/local/nagiosxi/scripts/repairmysql.sh nagiosql /tmp/nagiosqlrepair
/usr/local/nagiosxi/scripts/repairmysql.sh nagios > /tmp/nagiosrepair
Also, what does the following show:

Code: Select all

tail -30 /var/log/mysqld.log

Re: Problem with repairing NagiosXI database

Posted: Mon May 05, 2014 4:38 am
by mon-team
I have fixed it. The problem was that tmp directory was missing (maybe someone delete it for mistake) and the myisamchk command could not create a temporary file for restoring the table. I have created the /tmp dir and executed the 2 commands again:
myisamchk -r -f nagios_externalcommands.MYI
myisamchk -r -f nagios_notifications.MYI

Now MySQL log file are clean .Everything seems fine
Thank you

Re: Problem with repairing NagiosXI database

Posted: Mon May 05, 2014 9:03 am
by tmcdonald
Sounds good. I will be closing this thread now.