Class: Nagios::Config

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

Class Method Summary collapse

Class Method Details

.eachObject



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

def Config.each
  Nagios::Object.objects.each { |object|
    yield object
  }
end

.import(config) ⇒ Object



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

def Config.import(config)

  text = String.new

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