postgres db error
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: postgres db error
I'm not sure why that is the only entry you have there, you must have wiped everything else out, add the following to the list for good measure, on a separate line, and remove localhost from the line you showed?:
Also... did you mean to define that Nagios line with "nagios-p"
Code: Select all
127.0.0.1 localhost localhost.localdomainRe: postgres db error
Can you try changing /etc/hosts from:
To:
Code: Select all
168.125.36.9 nagios-p localhostCode: Select all
168.125.36.9 nagios-p
127.0.0.1 localhost 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.
"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.
-
kgopiramesh
Re: postgres db error
after changing the hosts file as per the suggestion from Arbist, when I ran the backup script, I have got the following error
Backing up PostgresQL databases...
pg_dump: [archiver (db)] connection to database "nagiosxi" failed: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
Error backing up PostgresQL database 'nagiosxi' !
echo $?
1
and after changing, the configuration was not applied and never got completed but when I reverted the changed the nagios ccm is running fine. Is this the problem with the credentials used in the script?
Backing up PostgresQL databases...
pg_dump: [archiver (db)] connection to database "nagiosxi" failed: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
Error backing up PostgresQL database 'nagiosxi' !
echo $?
1
and after changing, the configuration was not applied and never got completed but when I reverted the changed the nagios ccm is running fine. Is this the problem with the credentials used in the script?
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: postgres db error
As far as I have seen up to this point, I doubt that it is a credentials issue, or you would have gotten an error for invalid credentials instead of connection refused. Per standard system parameters, localhost must be defined as 127.0.0.x (generally .1). Please change this back, do a full server reboot with "shutdown -r now" and attempt your backup again. My guess would be that do to the previous localhost definition, postgres was started with those settings, and not restarted before you attempted the backup, thus it was still bound to the wrong interface.
I would also as what other configuration changes outside of the nagios interface you may have changed, this seems very odd and prone to more issues, which I'm sure we all would like to avoid and keep you running smoothly instead.
I would also as what other configuration changes outside of the nagios interface you may have changed, this seems very odd and prone to more issues, which I'm sure we all would like to avoid and keep you running smoothly instead.
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.