Sha256: ca5d99cf3152e3b0c2a41e5057180c7ca50ec35c6aa2ed25bb9c2c72cd8908a1
Contents?: true
Size: 1.25 KB
Versions: 1
Compression:
Stored size: 1.25 KB
Contents
#! /usr/bin/env ruby # # check-marathon # # DESCRIPTION: # This plugin checks that the ping url returns 200 OK # # OUTPUT: # plain text # # PLATFORMS: # Linux # # DEPENDENCIES: # gem: sensu-plugin # gem: rest-client # # USAGE: # #YELLOW # # NOTES: # # LICENSE: # Copyright 2015, Tom Stockton (tom@stocktons.org.uk) # Released under the same terms as Sensu (the MIT license); see LICENSE # for details. # require 'sensu-plugin/check/cli' require 'rest-client' class MarathonNodeStatus < Sensu::Plugin::Check::CLI option :server, 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: config[:timeout]).get if r.code == 200 ok 'Marathon Service is up' else critical 'Marathon Service is not responding' end rescue Errno::ECONNREFUSED critical 'Marathon Service is not responding' rescue RestClient::RequestTimeout critical 'Marathon Service Connection timed out' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sensu-plugins-mesos-0.0.3 | bin/check-marathon.rb |