[check_postgres] [commit] Set the stats to zero if we error out early due to USERWHERECLAUSE. Andras Fabian.
check_postgres at bucardo.org
check_postgres at bucardo.org
Mon Mar 23 22:23:42 UTC 2009
Committed by Greg Sabino Mullane <greg at endpoint.com>
Set the stats to zero if we error out early due to USERWHERECLAUSE. Andras Fabian.
---
check_postgres.pl | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/check_postgres.pl b/check_postgres.pl
index ef1be1e..c268d10 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2497,6 +2497,7 @@ sub check_database_size {
next;
}
if ($max < 0) {
+ $stats{$db->{dbname}} = 0;
if ($USERWHERECLAUSE) {
add_ok msg('no-match-user');
}
@@ -2913,6 +2914,7 @@ sub check_relation_size {
$found = 1;
if ($db->{slurp} !~ /\w/ and $USERWHERECLAUSE) {
+ $stats{$db->{dbname}} = 0;
add_ok msg('no-match-user');
next;
}
@@ -3027,6 +3029,7 @@ sub check_last_vacuum_analyze {
for $db (@{$info->{db}}) {
if ($db->{slurp} !~ /\w/ and $USERWHERECLAUSE) {
+ $stats{$db->{dbname}} = 0;
add_ok msg('no-match-user');
next;
}
@@ -3463,6 +3466,7 @@ sub check_query_time {
for $db (@{$info->{db}}) {
if ($db->{slurp} !~ /\w/ and $USERWHERECLAUSE) {
+ $stats{$db->{dbname}} = 0;
add_ok msg('no-match-user');
next;
}
@@ -3527,6 +3531,7 @@ sub check_txn_time {
}
if ($db->{slurp} !~ /\w/ and $USERWHERECLAUSE) {
+ $stats{$db->{dbname}} = 0;
add_ok msg('no-match-user');
next;
}
@@ -3598,6 +3603,7 @@ sub check_txn_idle {
my $max = -1;
if ($db->{slurp} !~ /\w/ and $USERWHERECLAUSE) {
+ $stats{$db->{dbname}} = 0;
add_ok msg('no-match-user');
next;
}
--
1.6.0.5
More information about the Check_postgres
mailing list