Hi Guys,
We have nagios running for several years. Right now, I got "Database connection failed SQL" error message. I also tried to run "/usr/local/nagiosxi/scripts/repair_databases.sh"; however, it didn't fix the problem.
Please help.
OS: CentOS release 5.6 x64
Nagios XI is manual installed.
Thanks,
James
Database connection failed SQL
Re: Database connection failed SQL
What version of XI are you running? Can you PM over a profile for us to look at? (Admin -> System Profile -> Download Profile)
Former Nagios Employee
Re: Database connection failed SQL
Hi,
My Nagios Core is 4.1.1
Does it help?
Since my Nagios is down right now, I can't download profile. Could you show me the other way to get profile from command line?
Thanks.
My Nagios Core is 4.1.1
Does it help?
Since my Nagios is down right now, I can't download profile. Could you show me the other way to get profile from command line?
Thanks.
Re: Database connection failed SQL
Can you login to the XI server as root, run the following command and post the output?
Also, can you post a screen shot of the Web Interface error as well?
Thanks
Code: Select all
ps -efThanks
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Database connection failed SQL
Hi,
I attached ps -ef output and screenshot of error message.
Please check it.
Thanks,
James
I attached ps -ef output and screenshot of error message.
Please check it.
Thanks,
James
You do not have the required permissions to view the files attached to this post.
Re: Database connection failed SQL
First, check the free space:
Then, make sure the DB services are okay.
Check /var/log/mysqld.log and see if you see any crashed tables messages (happening now).
If there are no crashed tables or any other error messages, let's restart the stack:
Did you make any changes? Harden the system, OS updates, XI upgrades, DB password changes, anything? Did it just start happening or did a change cause it?
Code: Select all
df -h
df -iCheck /var/log/mysqld.log and see if you see any crashed tables messages (happening now).
If there are no crashed tables or any other error messages, let's restart the stack:
Code: Select all
service nagios stop
service ndo2db stop
service mysqld restart
service postgresql restart
service httpd restart
service ndo2db start
service nagios start- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Database connection failed SQL
Following this KB article should resolve that problem:
https://support.nagios.com/kb/article.php?id=25
Specifically the postgres vacuum.
https://support.nagios.com/kb/article.php?id=25
Specifically the postgres vacuum.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Database connection failed SQL
Great!! The problem is on postgres. After I run the code below, my nagios is up and running now.
Thanks a lot for your support.
Code: Select all
service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql startRe: Database connection failed SQL
Great to hear! Going to mark this one as resolved, and close it up!
Feel free to create a new thread if you need any assistance in the future.
Feel free to create a new thread if you need any assistance in the future.
Former Nagios Employee