Class: Check

Inherits:
CloudstackNagios::Base show all
Defined in:
lib/cloudstack-nagios/commands/check.rb

Constant Summary

Constants included from CloudstackNagios::Helper

CloudstackNagios::Helper::RETURN_CODES

Instance Attribute Summary

Attributes inherited from CloudstackNagios::Base

#config

Instance Method Summary collapse

Methods inherited from CloudstackNagios::Base

exit_on_failure?

Methods included from CloudstackNagios::Helper

#check_data, #cs_routers, #exit_with_failure, #load_template

Instance Method Details

#storage_poolObject



45
46
47
48
49
50
# File 'lib/cloudstack-nagios/commands/check.rb', line 45

def storage_pool
   pool = client.list_storage_pools(name: options[:pool_name], zone: options[:zone]).first
   data = check_data(pool['disksizetotal'].to_f, pool['disksizeused'].to_f, options[:warning], options[:critical])
   puts "storage_pool #{options[:pool_name]} #{RETURN_CODES[data[0]]} - usage = #{data[1]}% | usage=#{pool['disksizeused']}"
   exit data[0]
end