Hi,
I came into work this morning to find this error message:
SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and last (automatic?) repair failed SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and last (automatic?) repair failed
Any idea how to recover from this?
Broken database
Broken database
Last edited by crafael01 on Wed Aug 06, 2014 10:21 am, edited 1 time in total.
Re: Broken database
Run the following:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.shFormer Nagios employee
Re: Broken database
Thank you! It's working now, but I actually had to run ./repairmysql.sh nagios.
Re: Broken database
The command I posted runs that as part of the script:
Code: Select all
#!/bin/sh
PATH=$PATH:/sbin:/usr/sbin
BASEDIR=$(dirname $0)
if [ ! -f "$BASEDIR/repair_databases.lock" ];then
touch "$BASEDIR/repair_databases.lock"
/sbin/service mysqld status
mysqlstatus=$?
if [ ! $mysqlstatus -eq 0 ];then
rm -f /var/lib/mysql/mysql.sock
/sbin/service mysqld start
fi
$BASEDIR/repairmysql.sh nagios
$BASEDIR/repairmysql.sh nagiosql
/sbin/service ndo2db restart
/sbin/service nagios restart
rm -f "$BASEDIR/repair_databases.lock"
fi
Former Nagios employee