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 = "[0;31m" GREEN = "[0;32m" YELLOW = "[0;33m" SLATE = "[0;34m" ORANGE = "[0;35m" BLUE = "[0;36m" NOCOLOR = "[0m" RESET = "[0m" 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