Class: Monitoring
- Inherits:
-
Object
- Object
- Monitoring
- Defined in:
- app/services/monitoring.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#proxy_api ⇒ Object
readonly
Returns the value of attribute proxy_api.
Instance Method Summary collapse
-
#initialize ⇒ Monitoring
constructor
A new instance of Monitoring.
- #set_downtime_host(host, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Monitoring
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
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
3 4 5 |
# File 'app/services/monitoring.rb', line 3 def proxy @proxy end |
#proxy_api ⇒ Object (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, = {}) proxy_api.create_host_downtime(host.fqdn, { :author => 'Foreman', :comment => 'triggered by Foreman' }.merge()) end |