Class: OpsviewRest::Hostcheckcommand
- Inherits:
-
Object
- Object
- OpsviewRest::Hostcheckcommand
- Includes:
- Mixin
- Defined in:
- lib/opsview_rest/hostcheckcommand.rb
Instance Attribute Summary collapse
-
#opsview ⇒ Object
Returns the value of attribute opsview.
-
#options ⇒ Object
Returns the value of attribute options.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
Instance Method Summary collapse
-
#initialize(opsview, options = {}) ⇒ Hostcheckcommand
constructor
A new instance of Hostcheckcommand.
Methods included from Mixin
#resource_path, #save, #to_json
Constructor Details
#initialize(opsview, options = {}) ⇒ Hostcheckcommand
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/opsview_rest/hostcheckcommand.rb', line 10 def initialize(opsview, = {}) = { :name => "ping", :args => "-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100%", :priority => 1, :plugin => "check_icmp", :uncommitted => false, :save => true, :replace => false }.update @opsview = opsview @resource_type = [:type] [:plugin] = { "name" => [:plugin] } [:hosts] = [:hosts].map { |x| { "name" => x } } [:uncommitted] = if [:uncommitted] then 1 else 0 end save([:replace]) if [:save] end |
Instance Attribute Details
#opsview ⇒ Object
Returns the value of attribute opsview.
8 9 10 |
# File 'lib/opsview_rest/hostcheckcommand.rb', line 8 def opsview @opsview end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/opsview_rest/hostcheckcommand.rb', line 8 def end |
#resource_type ⇒ Object
Returns the value of attribute resource_type.
8 9 10 |
# File 'lib/opsview_rest/hostcheckcommand.rb', line 8 def resource_type @resource_type end |