[check_postgres] Could not parse psql output! on windows

Lord, David d.lord at cgi.com
Wed Jan 4 14:35:04 UTC 2017


Hello,

I'm getting the following message when I run a connection test:

~~~~
$ perl ./WHHT/Postgres/check_postgres-2.22.0/check_postgres-2.22.0/check_postgres.pl -H localhost -p 5432 -db postgres -u postgres --action connection
Could not parse psql output!
Please report these details to check_postgres at bucardo.org:
Version:          2.22.0
OS:               MSWin32
Action:           connection
Calling line:     4039
<<
Command:          c:\PostgreSQL\9.6\bin\psql.EXE -q -t -d postgres -U postgres -p 5432 -h localhost -o C:\Users\lordd\AppData\Local\Temp\vJkA1zLCvF\check_postgres_psql.mleKMuL.tmp -x -c "BEGIN;SET statement_timeout=30000;COMMIT;SELECT version() AS v"
Could not parse psql output!
Please report these details to check_postgres at bucardo.org:
Version:          2.22.0
OS:               MSWin32
Action:           connection
Calling line:     2505
<<
Command:          c:\PostgreSQL\9.6\bin\psql.EXE -q -t -d postgres -U postgres -p 5432 -h localhost -o C:\Users\lordd\AppData\Local\Temp\K6ZyqKj_pv\check_postgres_psql.XHwQzkt.tmp -x -c "BEGIN;SET statement_timeout=30000;COMMIT;SELECT version() AS version"
Full output: $POSTGRES1 = "version | PostgreSQL 9.6.1, compiled by Visual C++ build 1800, 32-bit\r\n\r\n";
~~~~

I'm using Gow-0.8.0 and strawberry-perl-5.24.0.1-32bit. 

However, if I run the same on Cygwin using postgresql-client v. 9.6.1.1, it works:

~~~~
$ perl WHHT/Postgres/check_postgres-2.22.0/check_postgres-2.22.0/check_postgres.pl -H localhost -p 5432 -db postgres -u postgres --action connection
Password for user postgres:
POSTGRES_CONNECTION OK: DB "postgres" (host:localhost) version 9.6.1, | time=20.19s
~~~~

I have tried a few obvious things with no success:

- Setting the DOS codepage: C:\>cmd.exe /c chcp 1252
- Running perl with various options to set the input line separator: perl -0x0d0a or -0x0d or -0x0a

Unfortunately, I need to run it on windows as that is where the monitoring software lives, and the people that support it will not allow Cygwin (I think it chews the CPU).

Any advice gratefully received.

Regards
-- 
David Lord





More information about the Check_postgres mailing list