Don't fail when query contains 'disabled' word
authorMarco Nenciarini <[email protected]>
Tue, 12 Aug 2014 08:27:17 +0000 (10:27 +0200)
committerChristoph Berg <[email protected]>
Thu, 26 May 2016 15:58:58 +0000 (17:58 +0200)
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)

check_postgres.pl

index 2dc16b6c4025dbd59dfadc94801b7f1986a76f46..e0950f42070209cfae30673cdfdcc6a377704a3c 100755 (executable)
@@ -7928,7 +7928,7 @@ sub check_txn_idle {
         }
 
         ## Return unknown if stats_command_string / track_activities is off
-        if ($cq =~ /disabled/o or $cq =~ /<command string not enabled>/) {
+        if ($st =~ /disabled/o or $cq =~ /<command string not enabled>/) {
             add_unknown msg('psa-disabled');
             return;
         }