Class: Nagios::Config

Inherits:
Object show all
Defined in:
core_modules/nagios_core/lib/puppet/external/nagios.rb

Overview

Interface for reading in a Nagios config file.

Class Method Summary collapse

Class Method Details

.eachObject



41
42
43
44
45
# File 'core_modules/nagios_core/lib/puppet/external/nagios.rb', line 41

def self.each
  Nagios::Object.objects.each do |object|
    yield object
  end
end

.import(config) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'core_modules/nagios_core/lib/puppet/external/nagios.rb', line 29

def self.import(config)
  text = ''

  File.open(config) do |file|
    file.each do |line|
      text += line
    end
  end
  parser = Nagios::Parser.new
  parser.parse(text)
end