[check_postgres] check_postgres - NRPE - .pgpass file

Christoph Berg cb at df7cb.de
Mon Nov 10 16:54:57 UTC 2014


Re: Sureshkumar Rajayokkian 2014-11-10 <CAF_GjZmieyC3NrtVi4sRArW9kZmBwre43dj=ydDfOmQZjpLYuw at mail.gmail.com>
> Hello,
> 
> Is it possible to use .pgpass file for postgres check over NRPE check?
> I am getting error when I try below command but it works fine when passing
> clear text password.
> 
>  [root at nagios_server01 ~]# /usr/local/nagios/libexec/check_nrpe -H
> PostgresDB.domain.com -t 30 -c check_postgres -a '--dbuser=nagios
> --dbpass='/root/.pgpass' --action=connection'

--dbpass does something else:

       --dbpass=PASSWORD
		  Provides the password to connect to the database
		  with. Use of this option is highly discouraged.
		  Instead, one should use a .pgpass or pg_service.conf
		  file.

Did you try putting the .pgpass file into the home dir or the user
running the nrpe agent? (~nagios or the like)

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/


More information about the Check_postgres mailing list