Class: NagiosConfig
Constant Summary
CloudstackNagios::Helper::RETURN_CODES
Instance Attribute Summary
#config
Instance Method Summary
collapse
exit_on_failure?
#check_data, #cs_routers, #exit_with_failure, #load_template
Instance Method Details
#api_hosts ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 36
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
|
#capacity_services ⇒ Object
69
70
71
72
73
74
75
76
77
|
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 69
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
8
9
10
11
12
13
14
|
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 8
def router_hosts
host_template = load_template(options[:template])
puts host_template.result(
routers: cs_routers,
date: date_string
)
end
|
#router_services ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 21
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
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/cloudstack-nagios/commands/nagios_config.rb', line 51
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,
bin_path: bin_path,
config_file: options[:config],
date: date_string
)
end
|