A parser for the Managed Object Format (MOF) language used to describe classes and instances of the Common Information Model (CIM)
See www.dmtf.org/education/mof
-
Uses Racc (Ruby Yacc) as parser generator
-
Provides class information as Ruby objects (using the ‘cim’ gem)
-
Can switch between DMTFs standard format and the one used in Microsofts WMI implementation (msdn.microsoft.com/en-us/library/aa823192(VS.85).aspx)
-
A simple mof reader for validation of MOF files
require ‘mof’ moffiles, options = Mofparser.argv_handler “moflint”, ARGV options ||= :cim; options ||= [] options.unshift(Pathname.new “.”) options.unshift(Pathname.new “/usr/share/mof/cim-current”)
moffiles.unshift “qualifiers.mof” unless moffiles.include? “qualifiers.mof”
parser = Mofparser.new options
begin
result = parser.parse moffiles
rescue Exception => e
parser.error_handler e exit 1
end
result.each do |name,res| puts “/*=============== #{name} ===================*/n”
puts res
end
-
cim (rubygems.org/gems/cim)
gem install cim
(The Ruby License)
Copyright © 2010 Klaus Kämpf <[email protected]>
See www.ruby-lang.org/en/LICENSE.txt for the full text