sensu-plugins / sensu-plugins-elasticsearch

This plugin provides native ElasticSearch instrumentation for monitoring and metrics collection, including: service health and metrics for cluster, node, and more.

Home Page:http://sensu-plugins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metrics-es-node-graphite.rb constructs invalid URL when cert file flag is used

cwjohnston opened this issue · comments

In #101 many plugins in this collection were updated to add a --cert-file argument. In this change, a bug was introduced in metrics-es-node-graphite.rb plugin in particular which prevents the check from correctly constructing a request URL when this flag is used.

Specifically, the value of the --host argument is assigned to config[:server] around https://github.com/sensu-plugins/sensu-plugins-elasticsearch/blob/4.2.0/bin/metrics-es-node-graphite.rb#L53-L57 but around https://github.com/sensu-plugins/sensu-plugins-elasticsearch/blob/4.2.0/bin/metrics-es-node-graphite.rb#L135-L144 the logic tries to use config[:host] as the host component of the URL, which will always be null.