Class: NagiosConfig

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

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

#cs_routers, #load_template

Instance Method Details

#hostsObject



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

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

#servicesObject



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

def services
  bin_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'bin'))
  config_file = options[:config]
	service_template = load_template(options[:template])
  puts service_template.result(
    routers: cs_routers,
    bin_path: bin_path,
    config_file: config_file,
    date: date_string
  )
end