Page 1 of 2
Unable to connect to postgres database for monitoring
Posted: Fri Jun 17, 2016 5:36 am
by RIDS_I2MP
Hi Team,
While monitoring Postgres database from Nagios XI server We are not able to connect to the database, refer the attached snapshot message:
error message.PNG
The port is open but when we are trying from the command prompt it shows that port is closed , it shows the same output for 5666 but we are monitoring the filesystem well.
error message.PNG
This is affecting the production harshly.
Kindly suggest on it priority.
Re: Unable to connect to postgres database for monitoring
Posted: Fri Jun 17, 2016 10:03 am
by rkennedy
Can you please post the service definition for us to look at, and also a copy of the plugin?
Your screenshot indicates check_http & check_nrpe, but this appears to be a postgres plugin you're using.
Re: Unable to connect to postgres database for monitoring
Posted: Tue Jun 21, 2016 8:23 am
by RIDS_I2MP
Hi Team,
Please refer the attached snapshot we are firing the mentioned command in snapshot.
We are using check_postgres.pl script.
Let us know from where we can get the service definition? which you have requested.
Re: Unable to connect to postgres database for monitoring
Posted: Tue Jun 21, 2016 10:11 am
by lmiltchev
Is 10.144.223.155 the IP address of your Nagios XI server? Is it added to the "pg_hba.conf" on the remote machine (10.148.54.187)?
Run the following commands on the 10.148.54.187 server and show the output:
Code: Select all
grep 10.144.223.155 /var/lib/pgsql/data/pg_hba.conf
grep "listen_addresses =" /var/lib/pgsql/data/postgresql.conf
Note: Modify the paths to the config files if needed.
Can you log in posgres manually (as "nagios" user) on the remote box and access the "g_db_recohemea" db?
Re: Unable to connect to postgres database for monitoring
Posted: Wed Jun 22, 2016 5:07 am
by RIDS_I2MP
Hi Team,
yes 10.144.223.155 is the Nagios server IP.
Nagios server IP is added to pg_hba.conf on the remote host(10.148.54.187), kindly refer the output of the command below:
-bash-3.2$ grep 10.144.223.155 /psqldata/PostgresPlus/9.2AS/data/pg_hba.conf
host all all 10.144.223.155/32 md5
-bash-3.2$ grep "listen_addresses =" /psqldata/PostgresPlus/9.2AS/data/postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
We are able to login to the postgres database manually on the remote host and access the database.
Kindly suggest.
Re: Unable to connect to postgres database for monitoring
Posted: Wed Jun 22, 2016 12:44 pm
by ssax
Code: Select all
host all all 10.144.223.155/32 md5
This means that you need to provide an MD5 encrypted password when connecting:
Otherwise if you wanted to use a cleartext password, you would change it to:
Code: Select all
host all all 10.144.223.155/32 password
I think you would need to restart the postgresql DB as well.
Re: Unable to connect to postgres database for monitoring
Posted: Fri Jun 24, 2016 6:25 am
by RIDS_I2MP
Hi Team,
We have md5 encryption in all postgres databases and its working fine.
Kindly suggest.
Re: Unable to connect to postgres database for monitoring
Posted: Fri Jun 24, 2016 12:16 pm
by ssax
Did you md5 the password and use the md5'd password in your check command?
Re: Unable to connect to postgres database for monitoring
Posted: Tue Jul 05, 2016 5:40 am
by RIDS_I2MP
Hi Team,
There is no issue with the password as we are able to check the backend connections and it is giving us required output. We are facing issue only for connection status.
Kindly provide us any feasible solution.
Re: Unable to connect to postgres database for monitoring
Posted: Tue Jul 05, 2016 12:56 pm
by tgriep
Do you see any errors in the log files on the Postgress server when the check is run?
Can you upgrade to the latest version of the check_postgres.pl and see if it still fails for you?
You can get the latest plugin here.
https://bucardo.org/wiki/Check_postgres