Page 1 of 2
can not connect to database
Posted: Wed Oct 30, 2013 9:07 am
by afernandez
i cant see anything in my nagisoxi URL the logs say this:
[Wed Oct 30 09:50:22 2013] [error] [client ::1] PHP Warning: mysql_pconnect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
if you need more logs let me know thanks
my url only shows 3 green checks
Re: can not connect to database
Posted: Wed Oct 30, 2013 1:47 pm
by lmiltchev
Run the following commands and show the output:
Code: Select all
tail /var/log/mysqld.log
service mysqld status
cat /etc/my.cnf
df -h
Have you tried restarting mysql?
Re: can not connect to database
Posted: Wed Oct 30, 2013 3:21 pm
by afernandez
yes but let me tell you mysql have been migrated to another server
Re: can not connect to database
Posted: Wed Oct 30, 2013 3:23 pm
by BanditBBS
afernandez wrote:yes but let me tell you mysql have been migrated to another server
Did you follow this doc?
http://assets.nagios.com/downloads/nagi ... Server.pdf
Re: can not connect to database
Posted: Wed Oct 30, 2013 4:55 pm
by slansing
afernandez,
Let us know when you can, if you followed the document bandit linked above.
Re: can not connect to database
Posted: Thu Oct 31, 2013 12:02 pm
by afernandez
yes that is the one i followed so when nagios does its back up it backs up that remote db also?
HA on Nagios
Posted: Thu Oct 31, 2013 12:06 pm
by afernandez
Can you recommend a good strategy for nagios using HA?
im under fire, they are saying mysql is a single point of failure
Re: can not connect to database
Posted: Thu Oct 31, 2013 2:04 pm
by lmiltchev
...so when nagios does its back up it backs up that remote db also?
The mysql backup script is "/root/scripts/automysqlbackup". You will have to modify it in order to backup the database on a remote server. What is the output of the following command?
Code: Select all
grep DBHOST= /root/scripts/automysqlbackup
Re: can not connect to database
Posted: Thu Oct 31, 2013 2:11 pm
by BanditBBS
lmiltchev wrote:...so when nagios does its back up it backs up that remote db also?
The mysql backup script is "/root/scripts/automysqlbackup". You will have to modify it in order to backup the database on a remote server. What is the output of the following command?
Code: Select all
grep DBHOST= /root/scripts/automysqlbackup
Umm, thank god I was watching this thread. I think that note about modifying the backup script needs added to the offloading database documents. I'm making that change to my script right now!
EDIT: is that script part of the backup that is created daily, or is that another one? I want to make sure my DB is being backed up properly, like the opening poster
Re: can not connect to database
Posted: Thu Oct 31, 2013 3:21 pm
by lmiltchev
It's a cron job.
Code: Select all
cat /etc/cron.d/nagiosxi | head -n 5
We will need to modify our doc on offloading mysql.