Class: Monitoring

Inherits:
Object
  • Object
show all
Defined in:
app/services/monitoring.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMonitoring

Returns a new instance of Monitoring.



5
6
7
8
# File 'app/services/monitoring.rb', line 5

def initialize
  @proxy = SmartProxy.with_features('Monitoring').first
  @proxy_api = ProxyAPI::Monitoring.new(:url => proxy.url)
end

Instance Attribute Details

#proxyObject (readonly)

Returns the value of attribute proxy.



3
4
5
# File 'app/services/monitoring.rb', line 3

def proxy
  @proxy
end

#proxy_apiObject (readonly)

Returns the value of attribute proxy_api.



3
4
5
# File 'app/services/monitoring.rb', line 3

def proxy_api
  @proxy_api
end

Instance Method Details

#set_downtime_host(host, options = {}) ⇒ Object



10
11
12
# File 'app/services/monitoring.rb', line 10

def set_downtime_host(host, options = {})
  proxy_api.create_host_downtime(host.fqdn, { :author => 'Foreman', :comment => 'triggered by Foreman' }.merge(options))
end