Page 1 of 1

A database connection error has been detected

Posted: Mon Jul 21, 2014 10:59 am
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.

Re: A database connection error has been detected

Posted: Mon Jul 21, 2014 12:43 pm
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

Re: A database connection error has been detected

Posted: Mon Jul 21, 2014 1:00 pm
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.

Re: A database connection error has been detected

Posted: Mon Jul 21, 2014 2:51 pm
by lmiltchev
Great! I am glad your issue has been resolved! I am locking this topic.