Page 1 of 1

Nagios db reoccuring corruption

Posted: Mon Dec 02, 2019 2:47 pm
by benhank
I had an issue with the nagioslogentires db and the solution was supplied to me in this post:

Code: Select all

https://support.nagios.com/forum/viewtopic.php?f=16&t=56543
However, less than a week later the issue has happened again. I reapplied the fix with once gain has resolved the issue and I performed the additional steps as per the instructions supplied in the original post.
I am concerned that this issue is happening again so soon. Is there a way to prevent the corruption for happening?

Re: Nagios db reoccuring corruption

Posted: Mon Dec 02, 2019 4:06 pm
by ssax
This could be a number of things.

Please send me a copy of your profile, you can download it from Admin > System Profile > Download Profile.

Additionally, please send the output of these commands (as root):
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password

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
Then run this command:

Code: Select all

grep mysql /usr/local/nagiosxi/html/config.inc.php | wc -l
If it outputs the number 2, run the command below as well and include the output, if it outputs anything other than 2 - don't run the command. (some XI systems use both mysql and postgresql if they were install prior to XI 5.0 and then upgraded from there).

Code: Select all

echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxi
Send a screenshot of Admin > Performance Settings > Databases page as well.