Page 2 of 2

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

Posted: Tue Jul 09, 2013 3:34 pm
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)

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

Posted: Tue Jul 09, 2013 3:46 pm
by AcademyNag
And- Thanks btw for the help, i have downloaded the reference in your link, and bookmarked the parent site for future reference.

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

Posted: Tue Jul 09, 2013 3:52 pm
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...

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

Posted: Wed Jul 10, 2013 10:20 am
by lmiltchev
Is your issue resolved now?

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

Posted: Wed Jul 10, 2013 10:23 am
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

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

Posted: Wed Jul 10, 2013 11:19 am
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

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

Posted: Wed Jul 10, 2013 11:28 am
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.