summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorKabalin, Ruslan2010-05-19 20:48:04 +0000
committerGreg Sabino Mullane2010-05-19 20:48:04 +0000
commit4bd4cc2f956667af08b4817f7f4f4ee64393e703 (patch)
tree631870071f2179c3fa7c826b452fb2a27a04783b /check_postgres.pl
parent697d759b2abcde46f4d5f1b532402f3cadeedd8f (diff)
Fix logic for backends check with negative numbers.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl5
1 files changed, 3 insertions, 2 deletions
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;