DB Connect Error [nagiosxi]: Database connection failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
AcademyNag
Posts: 19
Joined: Wed Jun 12, 2013 2:26 pm
Location: Houston, Texas
Contact:

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by AcademyNag »

# whoami
root
-bash-4.1# cd /usr/local/nagiosxi/scripts/
-bash-4.1# service mysqld stop
Stopping mysqld: [ OK ]
-bash-4.1# mysql -u ndoutils -pn@gweb nagios -e 'TRUNCATE TABLE nagios_contactnotificationmethods'
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
"For those that understand Linux, no explanation is necessary, for those that do not understand Linux, no explanation is sufficient. For those that think they know everything- any answer is a waste of time."
AcademyNag
Posts: 19
Joined: Wed Jun 12, 2013 2:26 pm
Location: Houston, Texas
Contact:

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by AcademyNag »

And- Thanks btw for the help, i have downloaded the reference in your link, and bookmarked the parent site for future reference.
"For those that understand Linux, no explanation is necessary, for those that do not understand Linux, no explanation is sufficient. For those that think they know everything- any answer is a waste of time."
AcademyNag
Posts: 19
Joined: Wed Jun 12, 2013 2:26 pm
Location: Houston, Texas
Contact:

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by AcademyNag »

Just more fyi-

I edited the syslog-ng and the logrotate, changed weekly to daily, added compression, and added the ~/var/archives/*, added to keep only 15 days worth, added /store and mysql...
"For those that understand Linux, no explanation is necessary, for those that do not understand Linux, no explanation is sufficient. For those that think they know everything- any answer is a waste of time."
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by lmiltchev »

Is your issue resolved now?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by sreinhardt »

Cool, that should help a lot with space issues. As for the mysql login issues, I suppose I should have told you to stop mysql after running those two. So let me rephrase that:

Code: Select all

cd /usr/local/nagiosxi/scripts/

mysql -u ndoutils -pn@gweb nagios -e 'TRUNCATE TABLE nagios_contactnotificationmethods'
mysql -u ndoutils -pn@gweb nagios -e 'TRUNCATE TABLE nagios_contactnotifications'
mysql -u ndoutils -pn@gweb nagios -e 'TRUNCATE TABLE nagios_logentries'

service mysqld stop

./repairmysql.sh nagios
./repairmysql.sh nagiosql

service mysqld start
service postgresql restart
service nagios restart
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
AcademyNag
Posts: 19
Joined: Wed Jun 12, 2013 2:26 pm
Location: Houston, Texas
Contact:

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by AcademyNag »

This "mysql -u *~" still errors, but i think it does what its supposed to, and the rest works without error, so, yes, the issue seems to be resolved, if i find issue with these steps i will inquire of that separately, as it is a different issue than what i presented, and that part is resolved, I have downloaded the documentation from the links provided from this support, so I can use it prior to posting if these issues arise again. And again- Thank you for all your Help- everyone.

Shawn Miller
Academy Sports + Outdoors
IT - Linux Systems Engineer
"For those that understand Linux, no explanation is necessary, for those that do not understand Linux, no explanation is sufficient. For those that think they know everything- any answer is a waste of time."
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: DB Connect Error [nagiosxi]: Database connection failed

Post by slansing »

Great to hear! Let us know via a new thread if you run into issues, feel free to link the URL to this one for background.
Locked