High CPU load on optimization of NDOUTILS Db

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
toper
Posts: 57
Joined: Tue Jul 31, 2012 7:04 am

Re: High CPU load on optimization of NDOUTILS Db

Post by toper »

Hi,

Lots of errors in messages after repair

Aug 5 21:15:56 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:56 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:56 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:56 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'

/Peter
Peter Calum
toper
Posts: 57
Joined: Tue Jul 31, 2012 7:04 am

Re: High CPU load on optimization of NDOUTILS Db

Post by toper »

Hi,

After repair i got a lot of faults in /var/log/messages

Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Aug 5 21:15:55 khk26dsg5 ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair

So i did
service nagios stop
echo 'TRUNCATE TABLE nagios_logentries;' |mysql -t -u root -pnagiosxi nagios
service mysqld stop
/usr/local/nagiosxi/scripts/repairmysql.sh nagios
Now Repair was OK
service nagios start

/Peter
Peter Calum
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: High CPU load on optimization of NDOUTILS Db

Post by tgriep »

I guess the truncate took a while and the database was still receiving new data.
Let us know if this works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
toper
Posts: 57
Joined: Tue Jul 31, 2012 7:04 am

Re: High CPU load on optimization of NDOUTILS Db

Post by toper »

Hi,

No problem since 2200 yesterday.

How do we avoid this problem coming up again ?
Are there some autocleanup running ?

Already a lot of new entries.
[root@khk26dsg5 ~]# ls -lR /var/lib/mysql/nagios/nagios_logentries*
-rw-rw---- 1 mysql mysql 8972 May 22 2014 /var/lib/mysql/nagios/nagios_logentries.frm
-rw-rw---- 1 mysql mysql 210626696 Aug 6 18:21 /var/lib/mysql/nagios/nagios_logentries.MYD
-rw-rw---- 1 mysql mysql 233720832 Aug 6 18:21 /var/lib/mysql/nagios/nagios_logentries.MYI

thanks,
Peter Calum
TDC
Denmark
Peter Calum
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: High CPU load on optimization of NDOUTILS Db

Post by tgriep »

There is not an automated way of to truncate the MYSQL tables, it is a manual process, so periodically you will have to truncate the tables and run the repair to shrink the tables.
Be sure to check out our Knowledgebase for helpful articles and solutions!
toper
Posts: 57
Joined: Tue Jul 31, 2012 7:04 am

Re: High CPU load on optimization of NDOUTILS Db

Post by toper »

Hi,

I think it should be considered to make som automatic cleanup, like the other Database settings under 'Performance settings'

Thanks,
Peter Calum
Peter Calum
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: High CPU load on optimization of NDOUTILS Db

Post by hsmith »

toper wrote:Hi,

I think it should be considered to make som automatic cleanup, like the other Database settings under 'Performance settings'

Thanks,
Peter Calum
Hi Toper,

I can put in a feature request for you. Is this topic safe to close?
Former Nagios Employee.
me.
toper
Posts: 57
Joined: Tue Jul 31, 2012 7:04 am

Re: High CPU load on optimization of NDOUTILS Db

Post by toper »

Hi,

Yes, we can close this ticket.

thanks,
Peter
Peter Calum
Locked