Page 1 of 1

nagios_logentries

Posted: Fri Jul 05, 2013 8:56 am
by twigg0
Hi all,
a week ago we have a serious problem with Nagios XI (Nagios XI 2012R1.6). For a network problem Nagios was isolated for 3 hours. After that when we returned online, it's completely blocked. We have seen many files in /tmp called checkxxxx. We have stopped nagios e moving files in other directory and then restarted nagios.
Everything goes well except event log. I can't see nothing in Event Log...

What can I do? I have this error on Nagios machine typing cat /var/log/messages. Do I need to repair database? How?

Jul 5 14:21:35 localhost ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Jul 5 14:21:41 localhost nagios: SERVICE ALERT: xxxx;Hardware;OK;SOFT;2;OK - System: '', S/N: '', ROM: '', hardware working fine
Jul 5 14:21:41 localhost ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_logentries SET instance_id='1', logentry_time=FROM_UNIXTIME(1373026901), entry_time=FROM_UNIXTIME(1373026901), entry_time_usec='245593', logentry_type='8192', logentry_data='SERVICE ALERT: sdbportalgntrm1;Hardware;OK;SOFT;2;OK - System: \'\', S/N: \'\', ROM: \'\', hardware working fine', realtime_data='1', inferred_data_extracted='1''
Jul 5 14:21:41 localhost ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'
Jul 5 14:22:11 localhost nagios: SERVICE ALERT: xxxx;Hardware;OK;SOFT;2;OK - System: '', S/N: '', ROM: '', hardware working fine
Jul 5 14:22:11 localhost ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_logentries SET instance_id='1', logentry_time=FROM_UNIXTIME(1373026931), entry_time=FROM_UNIXTIME(1373026931), entry_time_usec='198510', logentry_type='8192', logentry_data='SERVICE ALERT: sdbsecrm01;Hardware;OK;SOFT;2;OK - System: \'\', S/N: \'\', ROM: \'\', hardware working fine', realtime_data='1', inferred_data_extracted='1''
Jul 5 14:22:11 localhost ndo2db: mysql_error: 'Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed'

Thanks in advance

Re: nagios_logentries

Posted: Sun Jul 07, 2013 7:37 pm
by slansing
Lets run through a gamut of checks/fixes here as you probably sustained database corruption amongst other things. Lets start with this:

Code: Select all

service nagios restart

service postgresql restart

service ndo2db restart
Next, please run through the following guidelines to resolve the MySql corruption:

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

After you have done this, please re-check the interface. If it is still displaying issues please post the following log files:

Code: Select all

tail -50 /usr/local/nagios/var/nagios.log

tail -50 /var/log/mysql.log

Re: nagios_logentries

Posted: Mon Jul 15, 2013 9:05 am
by twigg0
I have an error restarting ndo2db, no problem restarting nagios and postgres...
What can I do?

[root@snagxi01 ~]# service ndo2db restart
Stopping ndo2db: head: cannot open `/usr/local/nagios/var/ndo2db.lock' for reading: No such file or directory
done.
Starting ndo2db: done.

Re: nagios_logentries

Posted: Mon Jul 15, 2013 9:21 am
by slansing
Was ndo running when you ran this command? It does not look like there was a .lock file. How does the messages log look now?

Re: nagios_logentries

Posted: Tue Jul 16, 2013 4:21 am
by twigg0
Hi,
after applyng nagios KB to repair Mysql corruption everything seems ok....

Re: nagios_logentries

Posted: Tue Jul 16, 2013 10:20 am
by abrist
Great. Enjoy the week.