Module: check_mk
Branch: master
Commit: c76d9b4e4957312b50c31a9e46ad74c1aeb9d1f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c76d9b4e495731…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 29 09:49:59 2013 +0200
FIX: mk_jolokia: Handling spaces in application server instances correctly
---
ChangeLog | 1 +
agents/plugins/mk_jolokia | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dfd2322..68d9a8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -116,6 +116,7 @@
* FIX: vsphere_agent: fix problems whith ! and \ in username or password
* FIX: check_mk_agent.aix: fix shebang: was python, must be ksh
* FIX: cisco_qos: Be compatible to newer IOS-XE versions (Thanks to Ken Smith)
+ * FIX: mk_jolokia: Handling spaces in application server instances correctly
Multisite:
* FIX: do not remove directories of non-exisant users anymore. This lead to
diff --git a/agents/plugins/mk_jolokia b/agents/plugins/mk_jolokia
index def7dd8..74afb61 100755
--- a/agents/plugins/mk_jolokia
+++ b/agents/plugins/mk_jolokia
@@ -92,7 +92,7 @@ def query_instance(inst):
# Prepare user/password authentication via HTTP Auth
if inst.get("password"):
passwdmngr = urllib2.HTTPPasswordMgrWithDefaultRealm()
- passwdmngr.add_password(None, "http://%s:%d/" %
+ passwdmngr.add_password(None, "http://%s:%d/" %
(inst["server"], inst["port"]),
inst["user"], inst["password"])
if inst["mode"] == 'digest':
authhandler = urllib2.HTTPDigestAuthHandler(passwdmngr)
@@ -117,7 +117,6 @@ def query_instance(inst):
sys.stdout.write('<<<jolokia_metrics>>>\n')
# Fetch the general information first
for path, title, itemspec in global_vars + specific_vars.get(product, []):
-
try:
values = fetch_var(inst["server"], inst["port"],
"read/" + path, inst["suburi"], itemspec)
@@ -131,7 +130,7 @@ def query_instance(inst):
raise
# Simply ignore exceptions. Need to be removed for debugging
continue
-
+
for subinstance, value in values:
if not subinstance and not title:
print "INTERNAL ERROR: %s" % value
@@ -149,7 +148,7 @@ def query_instance(inst):
else:
tit = subinstance[-1]
- sys.stdout.write("%s %s %s\n" % (item, tit, value))
+ sys.stdout.write("%s %s %s\n" % (item.replace(" ",
"_"), tit, value))
# Default configuration for all instances