summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorNathaniel Waisbrot2013-04-01 15:33:18 +0000
committerNathaniel Waisbrot2013-04-01 15:33:18 +0000
commit0b85d2209bdf5d366032c7828fb91980fe668840 (patch)
treee18169ed423d75ebca8d6b2f45c4c1d4764dfec0 /check_postgres.pl
parent63927affd96a0486f7e884b95977cd0b2010038c (diff)
cause the --reverse flag to invert string comparisons in custom queries
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 576bfca80..7885b58aa 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -4084,7 +4084,7 @@ sub check_custom_query {
return;
}
if (length $critical) {
- if (($valtype eq 'string' and $result eq $critical)
+ if (($valtype eq 'string' and $reverse ? $result ne $critical : $result eq $critical)
or
($valtype ne 'string' and $reverse ? $result <= $critical : $result >= $critical)) { ## covers integer, time, size
add_critical "$result";
@@ -4093,7 +4093,7 @@ sub check_custom_query {
}
if (length $warning and ! $gotmatch) {
- if (($valtype eq 'string' and $result eq $warning)
+ if (($valtype eq 'string' and $reverse ? $result ne $warning : $result eq $warning)
or
($valtype ne 'string' and length $result and $reverse ? $result <= $warning : $result >= $warning)) {
add_warning "$result";