bin/check-marathon.rb in sensu-plugins-mesos-0.0.2 vs bin/check-marathon.rb in sensu-plugins-mesos-0.0.3

- old
+ new

@@ -34,11 +34,18 @@ description: 'Marathon Host', short: '-s SERVER', long: '--server SERVER', default: 'localhost' + option :timeout, + description: 'timeout in seconds', + short: '-t TIMEOUT', + long: '--timeout TIMEOUT', + proc: proc(&:to_i), + default: 5 + def run - r = RestClient::Resource.new("http://#{config[:server]}:8080/ping", timeout: 5).get + r = RestClient::Resource.new("http://#{config[:server]}:8080/ping", timeout: config[:timeout]).get if r.code == 200 ok 'Marathon Service is up' else critical 'Marathon Service is not responding' end