Sha256: b2e9fd48fb6abf6fb9c67fb2e85d26cb8fa74d87b72ba3a30a3a340564906796
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 KB
Contents
module DashingContrib module Nagios module Status extend self def fetch(client, options = {}) critical = client.service_status(default_critical_options.merge(options)) warning = client.service_status(default_warning_options.merge(options)) ok = client.service_status(default_ok_options.merge(options)) unknown = client.service_status(default_unknown_options.merge(options)) ok.select! { |check| check['status'] == 'OK' } { critical: critical, warning: warning, unknown: unknown, ok: ok } end private def default_critical_options { :service_status_types => [:critical], :sort_type => :descending, :sort_option => :last_check } end def default_warning_options { :service_status_types => [:warning], :sort_type => :descending, :sort_option => :last_check } end def default_unknown_options { :service_status_types => [:unknown], :sort_type => :descending, :sort_option => :last_check } end def default_ok_options { :sort_option => :last_check, :sort_type => :descending } end end end end
Version data entries
17 entries across 17 versions & 1 rubygems