This chapter describes the MOF Compiler and explains how to use it. The following topics are covered.
The MOF Compiler parses files created in Managed Object Format, converts files to Java classes, and stores the extracted classes and instances in the CIM Repository.
During installation, the MOF Compiler is provided in the SUNWwbmof package. After installation, the MOF Compiler is located in the following path: /opt/SUNWconn/wbem/bin/.
The mofcomp command uses the following command-line parameters.
Parameter |
Description |
-help |
Causes a man page to display with information about the MOF compiler command and parameters |
-version |
Causes the build version of the MOF Compiler to display |
-v or -verbose |
Turns on verbose mode, which displays compiler messages as the file compiles |
-c cimom_host |
Enables you to specify the name of a host computer that is running the CIM Object Manager |
-u |
Enables you to specify a user name when you want to compile a file that is protected by user name and password authentication |
-p |
Enables you to provide a password when you want to compile a file that is protected by user name and password authentication |
The MOF Compiler uses the following command syntax:
% mofcomp filename.mof |
where mofcomp is the command to run the MOF Compiler and filename.mof is the name of a MOF file to be compiled.
If you run a command with the -p or the -up parameters, and you include a password, another user can run the ps command or the history command to find out your password.
If you run a command that requires you to provide your password, immediately change your password after running the command.
The following examples show use of the mofcomp command with the -p parameter:
mofcomp -p Log8Rif |
mofcomp -up molly Log8Rif |
Change your password immediately after running the mofcomp command with the option to specify a password.
Using the MOF Compiler, you can compile all MOF files with or without a .mof extension. You can start the compiler in any directory where you want to compile a file. All MOF files that make up the CIM and Solaris Schemas are located in the path: /opt/SUNWconn/wbem/schema.
Change directories to the location of the MOF Compiler.
% cd /opt/SUNWconn/wbem/bin/ |
To run the MOF Compiler without parameters, type the following command:
% mofcomp <filename> |
At the prompt, type the path and name of the MOF file that you want to compile.
For example, type: /opt/SUNWconn/wbem/schema/Solaris_Schema1.0.mof
The MOF file is compiled.
The following example shows MOF output after compiling the file:
Initializing CIMValue Parsing input file Parsing input file Parsed input file MofcBackend: NamespaceTable: {}End of NamespaceTable QualifierTypesTable: {}End of QualifierTypesTable Syntax Errors: 0 Semantic Errors: 0 Warnings: 0 End of MofcBackend |