bin/check-consul-members.rb in sensu-plugins-consul-1.2.0 vs bin/check-consul-members.rb in sensu-plugins-consul-1.3.0
- old
+ new
@@ -66,11 +66,17 @@
description: 'whether to check the wan members',
short: '-w',
long: '--wan',
boolean: false
+ option :scheme,
+ description: 'consul listener scheme',
+ short: '-S SCHEME',
+ long: '--scheme SCHEME',
+ default: 'http'
+
def run
- url = "http://#{config[:server]}:#{config[:port]}/v1/agent/members"
+ url = "#{config[:scheme]}://#{config[:server]}:#{config[:port]}/v1/agent/members"
if config[:wan]
url += '?wan=1'
end
json = RestClient::Resource.new(url, timeout: 5).get
peers = 0