Re: Error showing under Notifications Tab
Posted: Mon Feb 01, 2021 5:55 pm
You will need to repair the databases first:
It will not work if you have crashed database tables.
See here for more troubleshooting if the DB repair script doesn't fix it:
https://assets.nagios.com/downloads/nag ... tabase.pdf
If you run this command and it shows any output saying NULL that means you have crashed DB tables:
Then do this:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.shSee here for more troubleshooting if the DB repair script doesn't fix it:
https://assets.nagios.com/downloads/nag ... tabase.pdf
If you run this command and it shows any output saying NULL that means you have crashed DB tables:
Code: Select all
echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --table | grep NULLCode: Select all
mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as '' FROM information_schema.tables AS tb WHERE table_schema = 'nagios' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE' ORDER BY table_name DESC;" > ~/nagios_convert_myisam_to_innodb.sql
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosql -e "SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as '' FROM information_schema.tables AS tb WHERE table_schema = 'nagiosql' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE' ORDER BY table_name DESC;" > ~/nagiosql_convert_myisam_to_innodb.sql
mysql -h 127.0.0.1 -uroot -pnagiosxi -e "SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as '' FROM information_schema.tables AS tb WHERE table_schema = 'nagiosxi' AND ENGINE = 'MyISAM' AND TABLE_TYPE = 'BASE TABLE' ORDER BY table_name DESC;" > ~/nagiosxi_convert_myisam_to_innodb.sql
mysql -h 127.0.0.1 -uroot -pnagiosxi nagios < ~/nagios_convert_myisam_to_innodb.sql
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosql < ~/nagiosql_convert_myisam_to_innodb.sql
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi < ~/nagiosxi_convert_myisam_to_innodb.sql