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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
divya9raj
Posts: 10
Joined: Thu Jun 13, 2013 2:05 am

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

Post by divya9raj »

Hi Nagios Team,

Until last week, Nagios XI which I am running using the VMware was working well, but today when i tried to login, I got the following error:
DB Connect Error [nagiosxi]: Database connection failed DB Connect Error [nagiosxi]: Database connection failed DB Connect Error [nagiosxi]: Database connection failed

Then, I tried searching for solution in this forum, but suggestions were asked to check if mysql and postgresql was running.
After checking these in my case, mysql seems to be running by postgresql failed to start. It stopped, but failed to start the service.
And I tried running the suggested command: df -h
I have attached the output here, but it doesn't seem to be hard disk issue.
output.jpg
Please help! Thanks in advance!
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Try to start the postgresql service, post the output here (looking for more information):

Code: Select all

service postgresql start
tail /var/lib/pgsql/pgstartup.log
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
divya9raj
Posts: 10
Joined: Thu Jun 13, 2013 2:05 am

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

Post by divya9raj »

Okay, I have tried the command given and attached here is the output.
output.jpg
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Have you tried starting Postgres with either of the commands shown in your picture? Can you also try the following "slight change":

Code: Select all

service postgresql start
tail -50 /var/lib/pgsql/pgstartup.log
divya9raj
Posts: 10
Joined: Thu Jun 13, 2013 2:05 am

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

Post by divya9raj »

The following shows the output of the tail -50 /var/lib/pgsql/pgstartup.log
command.jpg
And I tried one of the command shown on the picture but it shoots me error as in the figure attached here.
output-1.jpg
When i tried to connecting it using psql command line tool, it threw me the following error.
boohoo-1.jpg
You do not have the required permissions to view the files attached to this post.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post by sreinhardt »

Let's also do a "df -i" to check inodes since this has been a little bit. Additionally, did anything aside from this happen to your server? Such as power failures or disk issues? It seems that each time you start postgres it is starting for the very first time, initializing everything as though it was new.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
divya9raj
Posts: 10
Joined: Thu Jun 13, 2013 2:05 am

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

Post by divya9raj »

There was no issue on the server, we just had to restart the server last week.
And I tried 'df -i' command, following shows the output.
df-i.jpg
You do not have the required permissions to view the files attached to this post.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post by sreinhardt »

When you restarted the server, was this done via power button or vmware restart action, or the actual shutdown -r\restart command in linux?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

Run the following commands, and show the output:

Code: Select all

echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
service postgresql status
Can you log in postgres by running the following command?

Code: Select all

psql nagiosxi nagiosxi
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked