check_postgres icon indicating copy to clipboard operation
check_postgres copied to clipboard

--dbpass can't contain a comma

Open couilllard45682 opened this issue 6 years ago • 6 comments

The password will be cut where the comma is. Still looking for a way to escape it.

Thanks

couilllard45682 avatar Nov 30 '17 05:11 couilllard45682

Hi @couilllard45682, I assume at the very least you should be able to use a .pgpass file to provide any password. Otherwise I think we'd have to change the logic to look for an escaped comma in the general arg split functionality.

machack666 avatar Nov 30 '17 14:11 machack666

It's running in a Cygwin enviroment with 'noacl' disk flag. So I can't chmod 600 on the .pgpass file and pg won't use it. :-(

couilllard45682 avatar Nov 30 '17 15:11 couilllard45682

I really think the logic changes are required. Passwords can contain comma.

couilllard45682 avatar Nov 30 '17 15:11 couilllard45682

I am running this on Icinga and found that due to the checks running as user icinga, and the postgres server being remote, placing a .pgpass in /home/icinga is not read. What determines where the .pgpass file is read?

mdeguzis avatar Feb 18 '18 22:02 mdeguzis

Hi @mdeguzis — the .pgpass would be for the user which is running the script in question; basically at the time of the DBI->connect() call. If the icinga daemon is running the command remotely (say), it would have to be stored on the server where the script is actually running.

machack666 avatar Feb 19 '18 15:02 machack666

Am 19. Februar 2018 16:46:06 MEZ schrieb David Christensen [email protected]:

Hi @mdeguzis — the .pgpass would be for the user which is running the script in question; basically at the time of the DBI->connect() call. If the icinga daemon is running the command remotely (say), it would have to be stored on the server where the script is actually running.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/bucardo/check_postgres/issues/133#issuecomment-366730774

Iirc the file would be silently ignored if it had the wrong permissions.

df7cb avatar Feb 19 '18 18:02 df7cb