[check_postgres] Could not parse psql output! on windows

Greg Sabino Mullane greg at endpoint.com
Sun Jan 8 19:49:37 UTC 2017


> 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";

That's unusual. That line should be triggering the regex around line 2469:

if ($line =~ /^ ?([\?\w]+)\s+\| (.*?)\s*$/) {
  $stuff[$lnum]{$1} = $2;
  $lastval = $1;
}

Certainly the outpute above matches that regex, but something about Windows 
is preventing it from doing so. It's been a long time since I did 
any serious Perl work on Windows, but try adding this above lone 
2469 (above):

$line =~ s/\r//g;

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 2529 DF6A B8F7 9407 E944  45B4 BC9B 9067 1496 4AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/check_postgres/attachments/20170108/935026aa/attachment.sig>


More information about the Check_postgres mailing list