Page 1 of 1

<<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:12 pm
by uhiadmin
Linux Distribution and version?
1. Cent OS 6.2 / 64 Bit
2. Manual Install
3. Gnome installed

To Nagios XI Tech Support Specialist:
I came in today and got this on our network monitor. What can I do to fix this?

DB Connect Error [nagiosxi]: Database connection failed

[root@fldmon ~]# tail /var/log/messages
Dec 20 15:11:42 fldmon ndo2db: Error: mysql_query() failed for 'DELETE FROM nagios_timedeventqueue WHERE instance_id='1' AND event_type='12' AND scheduled_time=FROM_UNIXTIME(1356041502) AND recurring_event='0' AND object_id='3593''
Dec 20 15:11:42 fldmon ndo2db: mysql_error: 'MySQL server has gone away'
Dec 20 15:11:42 fldmon ndo2db: Error: Connection to MySQL database has been lost!
Dec 20 15:11:42 fldmon ndo2db: Error: Could not connect to MySQL database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Dec 20 15:11:44 fldmon last message repeated 114 times
Dec 20 15:11:44 fldmon nagios: HOST ALERT: 736057;UP;SOFT;2;OK - 10.36.57.1: rta 98.734ms, lost 0%
Dec 20 15:11:44 fldmon ndo2db: Error: Could not connect to MySQL database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Dec 20 15:11:45 fldmon last message repeated 175 times
Dec 20 15:11:47 fldmon nagios: HOST ALERT: 744066;DOWN;SOFT;7;CRITICAL - 10.44.66.1: rta nan, lost 100%
Dec 20 15:11:53 fldmon nagios: SERVICE ALERT: localhost;Current Load;WARNING;SOFT;1;WARNING - load average: 6.20, 5.83, 3.53
[root@fldmon ~]#

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:23 pm
by abrist
This is a known issue with gnome on cent systems. Check out the faq:

http://support.nagios.com/wiki/index.ph ... _failed.22

Also check your free disk space.

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:32 pm
by uhiadmin
Would I have to add this path? and how do I add this?

/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:38 pm
by uhiadmin
Would an update to our Nagios Server Fix this?

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:44 pm
by uhiadmin
Getting this so far:


root@fldmon ~]# /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin
:/bin:/usr/sbin:/usr/bin
-bash: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: No such file or directory
[root@fldmon ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@fldmon ~]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
[root@fldmon ~]#

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 5:57 pm
by uhiadmin
Is there any other solution beside the one you pointed out to me?

The path mentioned for the database. How can I correct that?

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 6:10 pm
by uhiadmin
[root@fldmon /]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/kerberos/sbin
[root@fldmon /]#

URGENT: <<DB ERROR>> - PLEASE ASSIST.

Posted: Thu Dec 20, 2012 6:33 pm
by uhiadmin
To Nagios Support Team:
It appears that the PATH are set correctly...is there anything else that I am overlooking?

[root@fldmon /]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/kerberos/sbin

[root@fldmon /]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
You have new mail in /var/spool/mail/root
[root@fldmon /]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Fri Dec 21, 2012 12:03 am
by uhiadmin
I performed an emergency backup with the "backup script." These are my results....What direction can I take to get this fixed?


[root@fldmon ~]# /usr/local/nagiosxi/scripts/backup_xi.sh

Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
pg_dump: [archiver (db)] connection to database "nagiosxi" failed: FATAL: database is not accepting commands to avoid wraparound data loss in database "postgres"
HINT: Stop the postmaster and use a standalone backend to vacuum database "postgres".
Error backing up PostgresQL database 'nagiosxi' !
You have new mail in /var/spool/mail/root
[root@fldmon ~]#
[root@fldmon ~]# cd /store/backups/nagiosxi/
[root@fldmon nagiosxi]# ls -a
. 1338436944 1338441707 1338941507 1339125327.zip
.. 1338440381 1338526530.zip 1338945608.zip 1356064562
[root@fldmon nagiosxi]#

Re: <<DB CONNECT ERROR>> - PLEASE ASSIST.

Posted: Fri Dec 21, 2012 10:04 am
by scottwilkerson
going to lock this as it is directly related to
http://support.nagios.com/forum/viewtop ... =16&t=8709