I found teh fix for this...it was in Nagios documentation already
https://assets.nagios.com/downloads/nag ... tabase.pdf
on page 4 it says:
Code: Select all
If you receive an error, similar to this one:
Error : Incorrect file format 'nagios_systemcommands'
error : Corrupt
You will need to execute the following command to fix the table:
service mysqld start
echo 'repair table nagios_systemcommands use_frm;' | mysql -t -u root -pnagiosxi nagios
service mysqld restart
Then check the log file for errors
When I tried to start the service, i was told
Code: Select all
# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to start mysqld.service: Unit not found.
ran the command anyway:
Code: Select all
echo 'repair table nagios_systemcommands use_frm;' | mysql -t -u root -pnagiosxi nagios
The result:
Code: Select all
echo 'repair table nagios_systemcommands use_frm;' | mysql -t -u root -pnagiosxi nagios
+------------------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------------------------+--------+----------+----------+
| nagios.nagios_systemcommands | repair | status | OK |
+------------------------------+--------+----------+----------+
tried the restart
Code: Select all
service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
Failed to restart mysqld.service: Unit not found.
so I ran the original repair anyway
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.sh
and now:
Code: Select all
===============
REPAIR COMPLETE
===============
=======================
nagios database repair succeeded
nagiosql database repair succeeded
nagiosxi database repair succeeded