Module: Upstreamstatus

Extended by:
Forwardable
Defined in:
lib/upstreamstatus.rb,
lib/upstreamstatus/version.rb

Constant Summary collapse

VERSION =
"0.1.2"

Instance Method Summary collapse

Instance Method Details

#initializeObject



13
14
15
# File 'lib/upstreamstatus.rb', line 13

def initialize
  @conf = OpenStruct.new load_conf
end

#runObject



17
18
19
20
21
22
23
24
# File 'lib/upstreamstatus.rb', line 17

def run
  down_hosts =
    current_status['servers']['server'].select { |s| s['status'] != 'up' }

  exit 0 if down_hosts.empty?
  print_hosts down_hosts
  exit 1
end