Skip to content

Instantly share code, notes, and snippets.

@Slurpgeit
Created February 7, 2017 17:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Slurpgeit/c728b9464d4176b1e725a82d9244cf2a to your computer and use it in GitHub Desktop.
--- monitoring.rb 2017-02-07 16:48:27.129098149 +0100
+++ monitoring.rb 2017-02-07 17:52:47.013679654 +0100
@@ -16,6 +16,8 @@
ca_path,
truststore_path,
truststore_password,
+ keystore_path,
+ keystore_password,
collection_interval,
collection_timeout_interval)
@system_api_version = system_api_version
@@ -26,12 +28,14 @@
@ca_path = ca_path
@truststore_path = truststore_path
@truststore_password = truststore_password
+ @keystore_path = keystore_path
+ @keystore_password = keystore_password
@collection_interval = collection_interval
@collection_timeout_interval = collection_timeout_interval
end
attr_accessor :system_api_version, :es_host, :user, :password, :node_uuid
- attr_accessor :ca_path, :truststore_path, :truststore_password
+ attr_accessor :ca_path, :truststore_path, :truststore_password, :keystore_path, :keystore_password
def collection_interval
TimeUnit::SECONDS.convert(@collection_interval, TimeUnit::NANOSECONDS)
@@ -53,6 +57,10 @@
truststore_path && truststore_password
end
+ def keystore?
+ keystore_path && keystore_password
+ end
+
def healthcheck_path
uri = URI.parse(es_host)
if auth?
@@ -115,12 +123,15 @@
ca_path = settings.get("xpack.monitoring.elasticsearch.ssl.ca")
truststore_path = settings.get("xpack.monitoring.elasticsearch.ssl.truststore.path")
truststore_password = settings.get("xpack.monitoring.elasticsearch.ssl.truststore.password")
+ keystore_path = settings.get("xpack.monitoring.elasticsearch.ssl.keystore.path")
+ keystore_password = settings.get("xpack.monitoring.elasticsearch.ssl.keystore.password")
collection_interval = settings.get("xpack.monitoring.collection.interval")
collection_timeout_interval = settings.get("xpack.monitoring.collection.timeout_interval")
data = TemplateData.new(LogStash::SETTINGS.get("node.uuid"), API_VERSION,
url, username, password,
ca_path, truststore_path, truststore_password,
+ keystore_path, keystore_password,
collection_interval, collection_timeout_interval)
template_path = ::File.join(::File.dirname(__FILE__), "..", "template.cfg.erb")
@@ -150,6 +161,8 @@
settings.register(LogStash::Setting::NullableString.new("xpack.monitoring.elasticsearch.ssl.ca"))
settings.register(LogStash::Setting::NullableString.new("xpack.monitoring.elasticsearch.ssl.truststore.path"))
settings.register(LogStash::Setting::NullableString.new("xpack.monitoring.elasticsearch.ssl.truststore.password"))
+ settings.register(LogStash::Setting::NullableString.new("xpack.monitoring.elasticsearch.ssl.keystore.path"))
+ settings.register(LogStash::Setting::NullableString.new("xpack.monitoring.elasticsearch.ssl.keystore.password"))
settings.register(LogStash::Setting::String.new("node.uuid", ""))
rescue => e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment