Class: Unsub::Service::Icinga
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #disable_notifications(host) ⇒ Object
- #enable_notifications(host) ⇒ Object
-
#initialize(cmd_url, log) ⇒ Icinga
constructor
A new instance of Icinga.
Methods inherited from Base
Constructor Details
#initialize(cmd_url, log) ⇒ Icinga
Returns a new instance of Icinga.
6 7 8 9 10 |
# File 'lib/unsub/service/icinga.rb', line 6 def initialize cmd_url, log @uri = URI.parse cmd_url @http = Net::HTTP.new uri.host, uri.port @log = log end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
4 5 6 |
# File 'lib/unsub/service/icinga.rb', line 4 def http @http end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
4 5 6 |
# File 'lib/unsub/service/icinga.rb', line 4 def uri @uri end |
Instance Method Details
#disable_notifications(host) ⇒ Object
13 14 15 16 17 |
# File 'lib/unsub/service/icinga.rb', line 13 def disable_notifications host success = cgi_command 29, host # CMD_DISABLE_HOST_SVC_NOTIFICATIONS log.info service: 'icinga', event: 'disable_notifications', host: host, success: success success end |
#enable_notifications(host) ⇒ Object
20 21 22 23 24 |
# File 'lib/unsub/service/icinga.rb', line 20 def enable_notifications host success = cgi_command 28, host # CMD_ENABLE_HOST_SVC_NOTIFICATIONS log.info service: 'icinga', event: 'enable_notifications', host: host, success: success success end |