Page 2 of 2

Re: Error showing under Notifications Tab

Posted: Mon Feb 01, 2021 5:55 pm
by ssax
You will need to repair the databases first:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
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:

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 NULL
Then do this:

Code: 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

Re: Error showing under Notifications Tab

Posted: Wed Feb 03, 2021 12:00 pm
by pratikmehta003
i have repaired the DB... ran the next command to check crashed tables but no output stating NULL was found..

Let me see for a day and then i will run other commands...

Re: Error showing under Notifications Tab

Posted: Thu Feb 04, 2021 11:58 am
by benjaminsmith
Hi,
Let me see for a day and then i will run other commands...
Sounds good. Just update us then.

Re: Error showing under Notifications Tab

Posted: Wed Feb 10, 2021 7:15 am
by pratikmehta003
i dont see any issues coming up at the moment.. so do i still need to run those commands for inode?

but for some reason m seeing no perf data collection for memory parameter.. not sure from when.. have raised seaprate query on that

Re: Error showing under Notifications Tab

Posted: Wed Feb 10, 2021 4:33 pm
by benjaminsmith
Hi pratikmehta003,

If the issue is resolved, then there's no need to run those other commands. Let us know if it's ok to close out this thread.

Best Regards,
Benjamin

Re: Error showing under Notifications Tab

Posted: Wed Feb 10, 2021 8:57 pm
by pratikmehta003
you can close it.. Thanks Benjamin

Re: Error showing under Notifications Tab

Posted: Thu Feb 11, 2021 4:00 pm
by benjaminsmith
you can close it.. Thanks Benjamin
Great! Closing.