table nagios_notifications crashed (in every hour)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
eycklin
Posts: 30
Joined: Wed Apr 10, 2019 8:40 pm

Re: table nagios_notifications crashed (in every hour)

Post by eycklin »

Hi,

Below is from log:

191205 9:13:26 [Note] Found 126631 of 0 rows when repairing './nagios/nagios_notifications'



191206 9:11:32 [ERROR] mysqld: Table './nagios/nagios_notifications' is marked as crashed and last (automatic?) repair failed
191206 9:11:32 [ERROR] mysqld: Table './nagios/nagios_notifications' is marked as crashed and last (automatic?) repair failed
191206 9:11:35 [ERROR] mysqld: Table './nagios/nagios_notifications' is marked as crashed and last (automatic?) repair failed
191206 9:11:35 [ERROR] mysqld: Table './nagios/nagios_notifications' is marked as crashed and last (automatic?) repair failed

So, it obviously as expected, dbmaint cron job which runs once a day, cause db crashed, right?

Any suggestions/workaround to solve this issue?

Thanks,
Eyck Lin
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: table nagios_notifications crashed (in every hour)

Post by tgriep »

Yes, it was expected to only crash once a day when the Optimize ran.

Add these lines in the /etc/my.cnf file under the [mysqld] section.

Code: Select all

innodb_log_buffer_size = 32M
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
Save the change.

Run the following to restart the processes.

Code: Select all

systemctl stop nagios
systemctl stop ndo2db
systemctl stop crond
pkill -9 -u nagios
systemctl restart mariadb
systemctl start ndo2db
systemctl start nagios
systemctl start crond
Then run the following to convert the table to the INNODB engine

Code: Select all

echo 'ALTER TABLE nagios.nagios_notifications engine=INNODB;' | mysql -u root -pnagiosxi
An INNODB table is processed differently than an MYISAM table when optimized and we will see if that fixes the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
eycklin
Posts: 30
Joined: Wed Apr 10, 2019 8:40 pm

Re: table nagios_notifications crashed (in every hour)

Post by eycklin »

Hi,

We've done the modification.

and change database optimization interval back to 60 minutes.

From 10:00am till 18:00, it's ok, no DB crashed.

We'll still monitor this DB status for some days.

ps: Do you need any log file?

Many Thanks.
Eyck Lin
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: table nagios_notifications crashed (in every hour)

Post by tgriep »

That's good news that the crash hasn't happened so far.
For now, I do not need any log files unless the issue comes back.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked