can not connect to database

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
afernandez
Posts: 17
Joined: Mon Sep 23, 2013 4:02 pm

can not connect to database

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: can not connect to database

Post 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?

Code: Select all

service mysqld restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
afernandez
Posts: 17
Joined: Mon Sep 23, 2013 4:02 pm

Re: can not connect to database

Post by afernandez »

yes but let me tell you mysql have been migrated to another server
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: can not connect to database

Post 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
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: can not connect to database

Post by slansing »

afernandez,

Let us know when you can, if you followed the document bandit linked above.
afernandez
Posts: 17
Joined: Mon Sep 23, 2013 4:02 pm

Re: can not connect to database

Post by afernandez »

yes that is the one i followed so when nagios does its back up it backs up that remote db also?
afernandez
Posts: 17
Joined: Mon Sep 23, 2013 4:02 pm

HA on Nagios

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: can not connect to database

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: can not connect to database

Post 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
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: can not connect to database

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked