Page 1 of 2

DB Connect Error [nagiosxi]: Database connection failed

Posted: Tue Nov 27, 2012 2:03 pm
by mcwhorts
profile.txt
I'm getting this error 'DB Connect Error [nagiosxi]: Database connection failed'
after restarting our Nagios instance. I tried
service postgresql restart
and it fails.

How can I fix this?

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

Posted: Tue Nov 27, 2012 2:10 pm
by scottwilkerson
Sounds like the hard drive may be full

can you run

Code: Select all

df -h
and post the output

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

Posted: Tue Nov 27, 2012 2:12 pm
by mcwhorts
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
36G 24G 11G 69% /
/dev/sda1 99M 57M 37M 61% /boot
tmpfs 6.0G 0 6.0G 0% /dev/shm
none 500M 3.8M 497M 1% /mnt/ram

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

Posted: Tue Nov 27, 2012 2:49 pm
by scottwilkerson
Ok, not full, can you run

Code: Select all

tail /var/lib/pgsql/pgstartup.log

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

Posted: Tue Nov 27, 2012 2:52 pm
by mcwhorts
I get the following after running that command

FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
/etc/profile: line 39: HISTSIZE: readonly variable
/etc/profile: line 60: HISTCONTROL: readonly variable
/etc/profile: line 61: HISTFILE: readonly variable
/etc/profile: line 62: HISTFILESIZE: readonly variable
/etc/profile: line 63: HISTIGNORE: readonly variable
/etc/profile: line 64: HISTSIZE: readonly variable
/etc/profile: line 65: HISTTIMEFORMAT: readonly variable
/etc/profile: line 79: PROMPT_COMMAND: readonly variable
FATAL: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied

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

Posted: Tue Nov 27, 2012 2:59 pm
by scottwilkerson
looks like cannot creat the lock file...

lets check permissions on /tmp

Code: Select all

ls -ld /tmp

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

Posted: Tue Nov 27, 2012 3:00 pm
by mcwhorts
drwxr-xr-x 19 root root 32768 Nov 27 13:00 /tmp

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

Posted: Tue Nov 27, 2012 3:06 pm
by scottwilkerson
run

Code: Select all

chmod +w /tmp
Then try restarting postgresql again

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

Posted: Tue Nov 27, 2012 3:08 pm
by mcwhorts
Unfortunately postgresql still fails to start.

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

Posted: Tue Nov 27, 2012 3:10 pm
by mcwhorts
Would it hurt to re-run the upgrade script? Would this refresh postgresql?