From 0ed0cb58c8eb1a3b02b271d43394d6941fd978f7 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 3 Jan 2011 14:04:30 -0500 Subject: [PATCH] Fixes for custom_query. --- check_postgres.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 968c1c6bf..de56cbea0 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3155,6 +3155,10 @@ sub check_custom_query { $goodrow++; $db->{perf} .= " $msg"; my $gotmatch = 0; + if (! defined $data) { + add_unknown msg('custom-invalid'); + return; + } if (length $critical) { if (($valtype eq 'string' and $data eq $critical) or @@ -3167,7 +3171,7 @@ sub check_custom_query { if (length $warning and ! $gotmatch) { if (($valtype eq 'string' and $data eq $warning) or - ($reverse ? $data <= $warning : $data >= $warning)) { + (length $data and $reverse ? $data <= $warning : $data >= $warning)) { add_warning "$data"; $gotmatch = 1; } @@ -6937,7 +6941,7 @@ WHERE xact_start IS NOT NULL $USERWHERECLAUSE ## Use of skip_item means we may have no matches if ($maxdb eq '?') { if ($USERWHERECLAUSE) { ## needed? - add_unknown msg('fixme-nomatch'); + add_unknown msg('txntime-none'); } else { add_ok msg('txntime-none'); -- 2.39.5