A database connection error has been detected

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

A database connection error has been detected

Post by SavaSC »

Hello,

This weekend something happened to one of our NagiosXI servers. At first the webpage said we needed to re-install Nagios. I rebooted the server and now it gives the following message:

Code: Select all

"Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh

Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh

SQL: SQL Error [nagiosxi] : Database connection failed SQL: SQL Error [nagiosxi] : Database connection failed SQL: SQL Error [nagiosxi] : Database connection failedMessage: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.

Run the following from the CLI as root to attempt to repair the DB

/usr/local/nagiosxi/scripts/repair_databases.sh"
I have run the repair_database.sh command twice now, but no change.

We are running CENTOS.

Thank you for your help.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: A database connection error has been detected

Post by lmiltchev »

Can you log in mysql manually from the CLI?

Code: Select all

mysql -pnagiosxi
Mysql is not offloaded to a remote server, is it? Run the following command and show us the output in code wraps:

Code: Select all

tail -50 /var/log/mysqld.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
SavaSC
Posts: 238
Joined: Wed Feb 23, 2011 4:49 pm

Re: A database connection error has been detected

Post by SavaSC »

Thank you for your response. A co-worker figured it out. We had to vacuum the databases and recreate the log files. That server has been up for several years and no database maintenance has ever been done on it. We have now set up a yearly maintenance schedule to keep this from happening again.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: A database connection error has been detected

Post by lmiltchev »

Great! I am glad your issue has been resolved! I am locking this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked