From 44499d1ec3ada9e75e0ae3ad8c2ccd8bfc690e4a Mon Sep 17 00:00:00 2001
From: "p.molyavin"
Date: Fri, 10 Feb 2017 13:50:01 +0700
Subject: [PATCH] Add options to enable jmx monitoring
---
defaults/main.yml | 2 ++
templates/jvm.options.j2 | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/defaults/main.yml b/defaults/main.yml
index fb31044..70ad585 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -36,3 +36,5 @@ pid_dir: ''
log_dir: ''
conf_dir: ''
data_dirs: ''
+# JMX remote monitoring
+jmx_remote_monitoring_enabled: true
diff --git a/templates/jvm.options.j2 b/templates/jvm.options.j2
index 8d34be6..cacb1b0 100644
--- a/templates/jvm.options.j2
+++ b/templates/jvm.options.j2
@@ -106,3 +106,10 @@
# WARNING: This option will be removed in Elasticsearch 6.0.0 and is provided
# only for migration purposes.
#-Delasticsearch.json.allow_unquoted_field_names=true
+{% if jmx_remote_monitoring_enabled == true %}
+#-Dcom.sun.management.jmxremote.port={{ jmx_remote_monitoring_port }}
+#-Dcom.sun.management.jmxremote.authenticate={{ jmx_remote_monitoring_auth }}
+#-Dcom.sun.management.jmxremote.ssl={{ jmx_remote_monitoring_ssl }}
+##-Djava.rmi.server.hostname="127.0.0.1"
+-Dcom.sun.management.jmxremote
+{% endif %}