Page 1 of 1

Mysql table crashed

Posted: Tue Sep 03, 2013 1:11 am
by anoop
Dear Team,


We have one NagiosXI system installed successfully in CentOS 6.3.
In other system we installed MySQL (CentOS) and offloaded db from NagiosXI.

We followed "Offloading_MySQL_to_Remote Server" this document for offloading database.

after offloading MySQL db we started mysqld service on both machine, and permanent on services on both nagiosxi and mysql system done.

now we facing issue in log messages ( file /var/log/message) like:

Sep 3 10:52:46 NagiosxiApp ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_systemcommands SET instance_id='1', start_time=FROM_UNIXTIME(1378185766), start_time_usec='243862', end_time=FROM_UNIXTIME(1378185766), end_time_usec='247657', command_line='/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/1378185766\.perfdata\.service', timeout='5', early_timeout='0', execution_time='0.003000', return_code='0', output='', long_output='' ON DUPLICATE KEY UPDATE instance_id='1', start_time=FROM_UNIXTIME(1378185766), start_time_usec='243862', end_time=FROM_UNIXTIME(1378185766), end_time_usec='247657', command_line='/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/1378185766\.perfdata\.service', timeout='5', early_timeout='0', execution_time='0.003000', return_code='0', output='', long_output='''
Sep 3 10:52:46 NagiosxiApp ndo2db: mysql_error: 'Table './nagios/nagios_systemcommands' is marked as crashed and should be repaired'

I am also attached log file which is contained last 1000 lines in from bottom side name "var-log-messages"

You can also find the screenshots which i attache in mail......

Please resolve this issue as soon as possible.

Re: Mysql table crashed

Posted: Tue Sep 03, 2013 10:30 am
by slansing
You should only be running these commands on the nagiosxi server:

Code: Select all

service ndo2db start
service nagios start
Only start mysql on the remote host. To repair the database use this document:

http://assets.nagios.com/downloads/nagi ... tabase.pdf

Re: Mysql table crashed : FIXED

Posted: Tue Sep 03, 2013 2:14 pm
by anoop
Dear Team,

Thank you very much for replying.
I fixed this error, with the reference of your reply.

I done following things.....
in mysql database table it was showing "" NagiosxiApp ndo2db: mysql_error: 'Table './nagios/nagios_systemcommands' is marked as crashed and should be repaired' ""

i checked in my nagiosxi server's nagios tables named nagios_systemcommands and repaired, and then checked messages but still i was getting errors.

then i logged in Mysql server (which was offloaded for Nagiosxi Application)
and forcefully repaired nagios_systemcommands table with following commands:

logged in mysql server

# service mysqld stop
# cd /var/lib/mysql/
# myisamchk -r -f nagios/nagios_systemcommands.MYI
# service mysqld restart
# exit

then i checked in nagiosxi application server's log messages which was from /var/log/messages

Error FIXED...i think...........

# tailf /var/log/messages ( i was getting in nagiosxi app server)

Sep 4 00:10:35 NagiosxiApp nagios: ndomod: Please check remote ndo2db log, database connection or SSL Parameters
Sep 4 00:10:53 NagiosxiApp nagios: ndomod: Successfully reconnected to data sink! 0 items lost, 17 queued items to flush.
Sep 4 00:10:53 NagiosxiApp nagios: ndomod: Successfully flushed 17 queued items to data sink.
Sep 4 00:28:37 NagiosxiApp nagios: HOST NOTIFICATION: nagiosadmin;Switch-;DOWN;xi_host_notification_handler;CRITICAL - XXX.XX.XX.XXX: rta nan, lost 100%
Sep 4 00:33:27 NagiosxiApp nagios: SERVICE NOTIFICATION: nagiosadmin;localhost;Total Processes;WARNING;xi_service_notification_handler;PROCS WARNING: 332 processes with STATE = RSZDT

Thank you very much.