Page 1 of 1

Nagios Event Log

Posted: Wed Aug 12, 2015 8:25 am
by lb2cons
Hello Experts!

Why my Event Log it's empty?
Screen Shot 2015-08-12 at 10.12.59.png
This seems to happened after a NagiosXI restart yesterday, but, after that no event log was recorded.

My first question is how Nagios recorded those logs and the second is how can I overcome this situation?

UPDATE: Even changing Period the result is 0 events

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 10:31 am
by lmiltchev
Do you see any logs if you click on the "Event Log" link under the "Legacy Reports"?

Do you have any errors/crashed tables in the mysqld.log?

Code: Select all

tail -50 /var/log/mysqld.log

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 1:01 pm
by lb2cons
Yes, the lagacy report it's working fine.

About the MySQL log, yes there are tables crashed:

150812 14:52:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:06 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:21 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:26 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:52:26 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed
150812 14:53:35 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed

The first entry about this crash was yesterday at 11:41:
150811 11:41:59 [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed


So, the restart crashed this table.

My first question is: Why this happen? Am I restarting NagiosXI correctly?

Restart procedure:
#stop
service gearmand stop
service mod_gearman_worker stop
service nagiosxi stop
service npcd stop
service ndo2db stop
service nagios stop
service postgresql stop
service mysqld stop
service httpd stop
#start
service httpd start
service mysqld start
service postgresql start
service gearmand start
service mod_gearman_worker start
service nagios start
service ndo2db start
service npcd start
service nagiosxi start


The second question is: How can I fix this table? It's possible to restore those records?

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:03 pm
by hsmith
My first question is: Why this happen? Am I restarting NagiosXI correctly?
Did you do it from inside of XI? Under the "Administration" tab, there is a "XI System Component Status" table, with gears you can click on to stop the services nicely.
The second question is: How can I fix this table? It's possible to restore those records?
Can you please try to run this script?

Code: Select all

/usr/local/nagiosxi/scripts/repairmysql.sh nagios
Let us know what happens.

Thank you.

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:06 pm
by tgriep
Lets see if repairing the database brings back the exent log. Try this procedure to repair the database.
https://assets.nagios.com/downloads/nag ... tabase.pdf

The Stop procedure looks good but you should start ndo2db before nagios like so.
#start

Code: Select all

service httpd start
service mysqld start
service postgresql start
service gearmand start
service mod_gearman_worker start
service ndo2db start
service nagios start
service npcd start
service nagiosxi start

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:18 pm
by lb2cons
Now my entire environment it's not working!!!!

Check the log please with urgency!!

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:20 pm
by lb2cons
SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired SQL: SQL Error [ndoutils] : Table './nagios/nagios_servicestatus' is marked as crashed and should be repaired

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:25 pm
by lb2cons
Ok now it's working fine. I've restarted the whole server two or three times. Don't know why this happened and why it's working now.

Even the event log report it's working.

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:28 pm
by hsmith
lb2cons wrote:Ok now it's working fine. I've restarted the whole server two or three times. Don't know why this happened and why it's working now.

Even the event log report it's working.
Did you follow the guide tgriep posted? His instructions there are better and more complete than the ones I posted.

Re: Nagios Event Log

Posted: Wed Aug 12, 2015 2:47 pm
by lb2cons
No I didn't. I've tried your procedure several times. When I saw tgriep post the Nagios XI was already working fine.

Thanks for your help.

tgriep thanks for your post and for the script mention, I've changed ndo2db start position.