Sha256: a4b745eba1b14dfedc6e0ecf76d149640df930cd8d1b7f555c6aece44141e81c

Contents?: true

Size: 864 Bytes

Versions: 89

Compression:

Stored size: 864 Bytes

Contents

#!/usr/bin/env ruby -w

#--------------------
# A script to retrieve hosts from ldap and create an importable
# cfservd file from them

require 'digest/md5'
#require 'ldap'
require 'puppet/external/nagios/parser.rb'
require 'puppet/external/nagios/base.rb'

module Nagios
  NAGIOSVERSION = '1.1'
  # yay colors
  PINK = ""
  GREEN = ""
  YELLOW = ""
  SLATE = ""
  ORANGE = ""
  BLUE = ""
  NOCOLOR = ""
  RESET = ""

  def self.version
    NAGIOSVERSION
  end

  class Config
    def Config.import(config)

      text = String.new

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

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

Version data entries

89 entries across 89 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/external/nagios.rb
puppet-parse-0.1.3 lib/vendor/puppet/external/nagios.rb
puppet-parse-0.1.2 lib/vendor/puppet/external/nagios.rb
puppet-parse-0.1.1 lib/vendor/puppet/external/nagios.rb
puppet-2.7.26 lib/puppet/external/nagios.rb
puppet-2.7.25 lib/puppet/external/nagios.rb
puppet-2.7.24 lib/puppet/external/nagios.rb
puppet-3.3.2 lib/puppet/external/nagios.rb
puppet-3.3.1 lib/puppet/external/nagios.rb
puppet-3.3.1.rc3 lib/puppet/external/nagios.rb
puppet-3.3.1.rc2 lib/puppet/external/nagios.rb
puppet-3.3.1.rc1 lib/puppet/external/nagios.rb
puppet-3.3.0 lib/puppet/external/nagios.rb
puppet-3.3.0.rc3 lib/puppet/external/nagios.rb
puppet-3.3.0.rc2 lib/puppet/external/nagios.rb
puppet-3.2.4 lib/puppet/external/nagios.rb
puppet-2.7.23 lib/puppet/external/nagios.rb
puppet-3.2.3 lib/puppet/external/nagios.rb
puppet-3.2.3.rc1 lib/puppet/external/nagios.rb
puppet-3.2.2 lib/puppet/external/nagios.rb