From: Kabalin, Ruslan Date: Wed, 19 May 2010 20:48:04 +0000 (-0400) Subject: Fix logic for backends check with negative numbers. X-Git-Tag: 2.15.1~26 X-Git-Url: http://git.postgresql.org/gitweb/stat%3Cscript%20data-cfasync=?a=commitdiff_plain;h=4bd4cc2f956667af08b4817f7f4f4ee64393e703;p=check_postgres.git Fix logic for backends check with negative numbers. --- diff --git a/check_postgres.pl b/check_postgres.pl index d9699d819..089ff12ab 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2638,8 +2638,9 @@ ORDER BY datname my $percent = (int $total / $limit*100) || 1; my $msg = msg('backends-msg', $total, $limit, $percent); my $ok = 1; + if ($e1) { ## minus - $ok = 0 if $limit-$total >= $e2; + $ok = 0 if $limit-$total <= $e2; } elsif ($e3) { ## percent my $nowpercent = $total/$limit*100; @@ -2654,7 +2655,7 @@ ORDER BY datname } if ($w1) { - $ok = 0 if $limit-$total >= $w2; + $ok = 0 if $limit-$total <= $w2; } elsif ($w3) { my $nowpercent = $total/$limit*100;