Repair database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Repair database

Post by ednaldojta »

Good morning friends!
every time I take the reports, happens to my my Nagios application, lose connection to the database. How can I solve?
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Repair database

Post by lmiltchev »

What is the version of the Nagios XI that you are currently using? Is MySQL DB local or offloaded to a remote server? Run the following commands, and show the output:

Code: Select all

uname -a
cat /etc/*release
tail -20 /var/log/mysqld.log
If you are using mariadb, run:

Code: Select all

tail -20 /var/log/mariadb/mariadb.log
It seems like you need to repair your database and/or truncate some of the tables (if they are getting too large). Please, review our documentation on the topic here:
https://assets.nagios.com/downloads/nag ... tabase.pdf

Also, see how you can optimize your database settings in Nagios XI here:
https://assets.nagios.com/downloads/nag ... zation.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Repair database

Post by ednaldojta »

I'm using Nagios XI 5.2.0 version
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Repair database

Post by lmiltchev »

Did you repair the DB prior to running the tail command? I don't see any errors/crashed tables in the mysqld.log...

Are you still seeing the DB connection errors in the web UI or your issue has been resolved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Repair database

Post by ednaldojta »

It is always so happens and back normal!
but should this not happen again!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Repair database

Post by lmiltchev »

Database corruption is usually caused by power outages, running out of disk space or improper shutting down the Nagios XI server.

Many times users would right-click on the Nagios XI VM in VMWare Workstation/ESXi/Vsphere and select "Power Off". This is wrong - it is like pulling off the power cord. The correct way for shutting down the Nagios XI server would be to issue the following command in the command line:

Code: Select all

shutdown -h now
How much room do you have on the hard drive? Run the following commands and show the output:

Code: Select all

df -h
df -i
Be sure to check out our Knowledgebase for helpful articles and solutions!
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Repair database

Post by ednaldojta »

To turn off, I use the command line.

Not now this happens! And only happens when I do the extraction of reports.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Repair database

Post by tgriep »

It could be that your server is off-loaded to a remote server and the repair script isn't fixing the corruption.
Can you login to the XI server as root, run the following and post the output? This will tell us is the server is local or not.

Code: Select all

grep dbserver /usr/local/nagiosxi/html/config.inc.php
Another thing is could be the Max Connections to the mysql database needs to be increased. Take a look at this article to do that.
https://support.nagios.com/kb/article.php?id=513
Be sure to check out our Knowledgebase for helpful articles and solutions!
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Repair database

Post by ednaldojta »

My bank is local.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Repair database

Post by tgriep »

What report are you running to cause the SQL database corruption?
Did you follow the KB article that I posted and did you try to run the report again to see if that fixes the issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked