Page 2 of 2
Re: postgres db error
Posted: Tue May 06, 2014 6:24 am
by kgopiramesh
168.125.36.9 nagios-p localhost
Re: postgres db error
Posted: Tue May 06, 2014 9:47 am
by slansing
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?:
Code: Select all
127.0.0.1 localhost localhost.localdomain
Also... did you mean to define that Nagios line with "nagios-p"
Re: postgres db error
Posted: Tue May 06, 2014 9:47 am
by abrist
Can you try changing /etc/hosts from:
To:
Code: Select all
168.125.36.9 nagios-p
127.0.0.1 localhost
Re: postgres db error
Posted: Wed May 07, 2014 2:23 am
by kgopiramesh
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?
Re: postgres db error
Posted: Wed May 07, 2014 3:13 pm
by sreinhardt
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.