From ba87c611df222efdead8287e87bc25744fd492fa Mon Sep 17 00:00:00 2001 From: baddlan Date: Fri, 19 Feb 2016 13:32:25 -0500 Subject: [PATCH 1/2] Update check_http_json.py Fixed the undefined critical_message variable error --- check_http_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_http_json.py b/check_http_json.py index 05a65df..08df991 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -56,7 +56,7 @@ class NagiosHelper: def append_critical(self, critical_message): self.critical_message += critical_message def append_unknown(self, unknown_message): - self.critical_message += critical_message + self.critical_message += unknown_message def append_metrics(self, (performance_data, warning_message, critical_message)): self.performance_data += performance_data self.append_warning(warning_message) From 5d1100e6460f2cdd49590f63417cd7fa34ed730e Mon Sep 17 00:00:00 2001 From: baddlan Date: Fri, 19 Feb 2016 13:34:02 -0500 Subject: [PATCH 2/2] Update check_http_json.py Added a request header to specify the Content-Type as application/json. --- check_http_json.py | 1 + 1 file changed, 1 insertion(+) diff --git a/check_http_json.py b/check_http_json.py index 08df991..6eb9977 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -406,6 +406,7 @@ if __name__ == "__main__": # Attempt to reach the endpoint try: req = urllib2.Request(url) + req.add_header('Content-Type', 'application/json') if args.auth: base64str = base64.encodestring(args.auth).replace('\n', '') req.add_header('Authorization', 'Basic %s' % base64str)