class OpsviewRest::Hostcheckcommand
Attributes
opsview[RW]
options[RW]
resource_type[RW]
Public Class Methods
new(opsview, options = {})
click to toggle source
# File lib/opsview_rest/hostcheckcommand.rb, line 9 def initialize(opsview, options = {}) @options = { 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 options @opsview = opsview @resource_type = @options[:type] @options[:plugin] = { 'name' => @options[:plugin] } @options[:uncommitted] = (@options[:uncommitted] ? 1 : 0) save(@options[:replace]) if @options[:save] end