Nagios Event Log

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Nagios Event Log

Post 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
You do not have the required permissions to view the files attached to this post.
Last edited by lb2cons on Wed Aug 12, 2015 2:47 pm, edited 1 time in total.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Event Log

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: Nagios Event Log

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios Event Log

Post 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.
Former Nagios Employee.
me.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Event Log

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: Nagios Event Log

Post by lb2cons »

Now my entire environment it's not working!!!!

Check the log please with urgency!!
You do not have the required permissions to view the files attached to this post.
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: Nagios Event Log

Post 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
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: Nagios Event Log

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios Event Log

Post 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.
Former Nagios Employee.
me.
lb2cons
Posts: 72
Joined: Mon Dec 08, 2014 4:11 pm

Re: Nagios Event Log

Post 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.
Locked