Module: check_mk
Branch: master
Commit: 1c36d923d76b47d96906fc993fa77d2d1541a51a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c36d923d76b47…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Feb 19 14:34:30 2019 +0100
agent_jolokia: fix debug flag
Change-Id: Ibef9e8f328ed5d98f08b1d6dada38ee0e6a7f8c9
---
agents/plugins/mk_jolokia.py | 4 ++--
agents/special/agent_jolokia | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/agents/plugins/mk_jolokia.py b/agents/plugins/mk_jolokia.py
index 251ebdf..b4d9249 100755
--- a/agents/plugins/mk_jolokia.py
+++ b/agents/plugins/mk_jolokia.py
@@ -326,7 +326,7 @@ class JolokiaInstance(object):
def post(self, data):
post_data = json.dumps(data)
if VERBOSE:
- sys.stderr.write("DEBUG: POST data: %r\n" % post_data)
+ sys.stderr.write("\nDEBUG: POST data: %r\n" % post_data)
try:
raw_response = self._session.post(self.base_url, data=post_data)
except () if DEBUG else Exception, exc:
@@ -342,7 +342,7 @@ class JolokiaInstance(object):
response = raw_response.json()
if VERBOSE:
- sys.stderr.write("DEBUG: Result: %r\n\n" % response)
+ sys.stderr.write("DEBUG: Result: %r\n" % response)
return response
diff --git a/agents/special/agent_jolokia b/agents/special/agent_jolokia
index 9d3b0d5..95df1b1 100755
--- a/agents/special/agent_jolokia
+++ b/agents/special/agent_jolokia
@@ -42,8 +42,9 @@ def parse_arguments(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument("-v", "--verbose",
help='''Verbose mode''')
- parser.add_argument("--debug", help="Debug mode: let python exceptions
come through")
+ parser.add_argument("--verbose", action="count",
help='''Verbose mode''')
+ parser.add_argument(
+ "--debug", action="store_true", help="Debug mode: let
python exceptions come through")
opts_with_help = (t for t in mk_jolokia.DEFAULT_CONFIG_TUPLES if len(t) == 3)