Module: check_mk
Branch: master
Commit: bbf2e2be92048079b0d3e99c2efc3419dbf0b90f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bbf2e2be920480…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Jul 31 15:38:21 2017 +0200
4802 mk_jolokia: Can now be configured to use the local machine's FQDN to access
Jolokia
Previously, the Jolokia server could be configured via an IP address or an explicit FQDN.
When using HTTPS on a large number of devices, configuring "localhost" or
127.0.0.1
would lead to certificate errors unless one configured the FQDN for each host
individually.
This is unreasonably tedious, and can be avoided using this feature.
Change-Id: I786ba5170f4cd8e06cda8fa2191a0a49c26c289b
---
.werks/4802 | 13 +++++++++++++
agents/plugins/mk_jolokia | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/.werks/4802 b/.werks/4802
new file mode 100644
index 0000000..ba0045d
--- /dev/null
+++ b/.werks/4802
@@ -0,0 +1,13 @@
+Title: mk_jolokia: Can now be configured to use the local machine's FQDN to access
Jolokia
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1501508004
+Class: feature
+
+Previously, the Jolokia server could be configured via an IP address or an explicit
FQDN.
+When using HTTPS on a large number of devices, configuring "localhost" or
127.0.0.1
+would lead to certificate errors unless one configured the FQDN for each host
individually.
+This is unreasonably tedious, and can be avoided using this feature.
diff --git a/agents/plugins/mk_jolokia b/agents/plugins/mk_jolokia
index f00f606..dc0353f 100755
--- a/agents/plugins/mk_jolokia
+++ b/agents/plugins/mk_jolokia
@@ -478,6 +478,9 @@ conffile = os.getenv("MK_CONFDIR",
"/etc/check_mk") + "/jolokia.cfg"
if os.path.exists(conffile):
execfile(conffile)
+if server = "use fqdn":
+ server = socket.getfqdn()
+
if instance == None:
instance = str(port)
@@ -514,4 +517,7 @@ for inst in instances:
inst["instance"] = str(inst["port"])
inst["instance"] = inst["instance"].replace(" ",
"_")
+ if inst.get("server") == "use fqdn":
+ inst["server"] == socket.getfqdn()
+
query_instance(inst)