From fb5467d3a25f94ba06b0c4236a2f91cea25fe372 Mon Sep 17 00:00:00 2001 From: Jeff Boes Date: Mon, 27 Apr 2009 15:58:58 -0400 Subject: Add tests for dbstats; fixed invalid error in check_postgres.pl; extended CP_Testing::run method to allow no dbname runs. --- check_postgres.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index 0fad690d6..85c553967 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -175,7 +175,7 @@ our %msg = ( 'range-badsize' => q{Invalid size for '$1' option}, 'range-badtype' => q{validate_range called with unknown type '$1'}, 'range-badversion' => q{Invalid string for '$1' option: $2}, - 'range-cactionly' => q{This action is for cacti use only and takes not warning or critical arguments}, + 'range-cactionly' => q{This action is for cacti use only and takes no warning or critical arguments}, 'range-int' => q{Invalid argument for '$1' option: must be an integer}, 'range-int-pos' => q{Invalid argument for '$1' option: must be a positive integer}, 'range-neg-percent' => q{Cannot specify a negative percent!}, @@ -2045,7 +2045,7 @@ sub validate_range { } elsif ('cacti' eq $type) { ## Takes no args, just dumps data if (length $warning or length $critical) { - ndie msg('range-cacti-only'); + ndie msg('range-cactionly'); } } else { @@ -4655,6 +4655,7 @@ sub show_dbstats { for $db (@{$info->{db}}) { SLURP: for my $row (split /\n/ => $db->{slurp}) { my @stats = split /\s*\|\s*/ => $row; + ((defined($_) and length($_)) or $_ = 0) for @stats; (my $dbname = shift @stats) =~ s/^\s*//; next SLURP if skip_item($dbname); ## If dbnames were specififed, use those for filtering as well -- cgit v1.2.3