Problem with repairing NagiosXI database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Problem with repairing NagiosXI database

Post by mon-team »

Hi all,

I found that 2 tables in Nagios XI database are crashed , respectively nagios_externalcommands and nagios_notifications
I have tried the procedure founded at this link http://assets.nagios.com/downloads/nagi ... tabase.pdf
I have ran the following command
service nagios stop
service mysqld stop
cd /var/lib/mysql/nagios

myisamchk -r -f nagios_externalcommands.MYI
myisamchk -r -f nagios_notifications.MYI

service mysqld start
service nagios start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/local/nagiosxi/cron/dbmaint.php

After restarting mysql and nagios I saw that the problem is not resolved
Any suggestions?
Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Problem with repairing NagiosXI database

Post by slansing »

You don't need to touch any services to run the database repair scripts, the repair script should take care of this, what does the following output, please attach the text file output that should be in /tmp/:

Code: Select all

/usr/local/nagiosxi/scripts/repairmysql.sh nagiosql /tmp/nagiosqlrepair
/usr/local/nagiosxi/scripts/repairmysql.sh nagios > /tmp/nagiosrepair
Also, what does the following show:

Code: Select all

tail -30 /var/log/mysqld.log
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: Problem with repairing NagiosXI database

Post by mon-team »

I have fixed it. The problem was that tmp directory was missing (maybe someone delete it for mistake) and the myisamchk command could not create a temporary file for restoring the table. I have created the /tmp dir and executed the 2 commands again:
myisamchk -r -f nagios_externalcommands.MYI
myisamchk -r -f nagios_notifications.MYI

Now MySQL log file are clean .Everything seems fine
Thank you
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Problem with repairing NagiosXI database

Post by tmcdonald »

Sounds good. I will be closing this thread now.
Former Nagios employee
Locked