Class: NagiosConfig

Inherits:
CloudstackNagios::Base show all
Defined in:
lib/cloudstack-nagios/commands/nagios_config.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

#api_hosts ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 38

def api_hosts
  service_template = load_template(options[:template])
  puts service_template.result(
    zones: client.list_zones,
    bin_path: bin_path,
    config_file: options[:config],
    date: date_string
  )
end

#asyncjobs_services ⇒ Object



88
89
90
91
92
93
94
95
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 88

def asyncjobs_services
  service_template = load_template(options[:template])
  puts service_template.result(
    bin_path: bin_path,
    config_file: options[:config],
    date: date_string
  )
end

#capacity_services ⇒ Object



73
74
75
76
77
78
79
80
81
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 73

def capacity_services
  service_template = load_template(options[:template])
  puts service_template.result(
    capacity_types: Capacity::CAPACITY_TYPES,
    bin_path: bin_path,
    config_file: options[:config],
    date: date_string
  )
end

#router_hosts ⇒ Object



10
11
12
13
14
15
16
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 10

def router_hosts
  host_template = load_template(options[:template])
  puts host_template.result(
    routers: cs_routers,
    date: date_string
  )
end

#router_services ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 23

def router_services
  service_template = load_template(options[:template])
  puts service_template.result(
    routers: cs_routers,
    bin_path: bin_path,
    config_file: options[:config],
    date: date_string
  )
end

#storage_pool_services ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 54

def storage_pool_services
  service_template = load_template(options[:template])
  storage_pools = client.list_storage_pools.select do |pool| 
    pool['state'].downcase == 'up'
  end
  puts service_template.result(
    storage_pools: storage_pools,
    over_provisioning: options[:over_provisioning],
    bin_path: bin_path,
    config_file: options[:config],
    date: date_string
  )
end