From 965626543965ca3dada49d26204ca6777af656ec Mon Sep 17 00:00:00 2001 From: Robert Nemeti Date: Thu, 10 Aug 2017 10:29:45 +0200 Subject: [PATCH] print current value in the icinga message --- check_http_json.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/check_http_json.py b/check_http_json.py index c723b9f..8717a31 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -182,19 +182,19 @@ class JsonRuleProcessor: end = vals[1] if(start == '~'): if (invert and self.helper.lte(key, end)): - failure += " Value for key %s was less than or equal to %s." % (alias, end) + failure += " Value (%s) for key %s was less than or equal to %s." % (self.helper.get(key), alias, end) elif (not invert and self.helper.gt(key, end)): - failure += " Value for key %s was greater than %s." % (alias, end) + failure += " Value (%s) for key %s was greater than %s." % (self.helper.get(key), alias, end) elif(end == 'infinity'): if (invert and self.helper.gte(key, start)): - failure += " Value for key %s was greater than or equal to %s." % (alias, start) + failure += " Value (%s) for key %s was greater than or equal to %s." % (self.helper.get(key), alias, start) elif (not invert and self.helper.lt(key, start)): - failure += " Value for key %s was less than %s." % (alias, start) + failure += " Value (%s) for key %s was less than %s." % (self.helper.get(key), alias, start) else: if (invert and self.helper.gte(key, start) and self.helper.lte(key, end)): - failure += " Value for key %s was inside the range %s:%s." % (alias, start, end) + failure += " Value (%s) for key %s was inside the range %s:%s." % (self.helper.get(key), alias, start, end) elif (not invert and (self.helper.lt(key, start) or self.helper.gt(key, end))): - failure += " Value for key %s was outside the range %s:%s." % (alias, start, end) + failure += " Value (%s) for key %s was outside the range %s:%s." % (self.helper.get(key), alias, start, end) return failure def checkThresholds(self, threshold_list):