From: Marco Nenciarini Date: Tue, 12 Aug 2014 08:27:17 +0000 (+0200) Subject: Don't fail when query contains 'disabled' word X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=00dcadc439e4e6ac239b5c3640825a809fa7725a;p=check_postgres.git Don't fail when query contains 'disabled' word If a query contains the disabled word (.e.g. select 1 as disabled) "check_postgres.pl --action txn_idle" exits with ```UNKNOWN: No queries - is stats_command_string or track_activities off?``` If you set track_activities to off, the status field contains 'disabled' (at least on 9.3) --- diff --git a/check_postgres.pl b/check_postgres.pl index 2dc16b6c4..e0950f420 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -7928,7 +7928,7 @@ sub check_txn_idle { } ## Return unknown if stats_command_string / track_activities is off - if ($cq =~ /disabled/o or $cq =~ //) { + if ($st =~ /disabled/o or $cq =~ //) { add_unknown msg('psa-disabled'); return; }