包含在查找更多文档专项支持资源 | 以 PDF 格式下载本书 (267 KB)
Chapter 4 MOF CompilerThis chapter describes the Managed Object Format (MOF) Compiler, including the following topics. About the MOF CompilerThe Managed Object Format (MOF) Compiler parses a file containing MOF statements, converts the classes and instances defined in the file to Java classes, and adds the Java classes to the CIM Object Manager Repository, a central storage area for management data. The compiler loads the Java classes into the default namespace, root\cimv2, unless a #pragma namespace("namespace_path") statement appears in the MOF file. The mofcomp command, which starts the MOF compiler, is executed before installation to compile MOF files that describe the CIM and Solaris Schemas. The CIM Schema is a collection of class definitions used to represent managed objects that occur in every management environment. The Solaris Schema is a collection of class definitions that extend the CIM Schema and represent managed objects in a typical Solaris operating environment. MOF is a language for defining CIM classes and instances. MOF files are ASCII text files that use the MOF language to describe CIM objects. A CIM object is a computer representation or model of a managed resource, such as a printer, disk drive, or CPU. Many sites store information about managed resources in MOF files. Because MOF can be converted to Java, Java applications that can run on any system with a Java Virtual Machine can interpret and exchange this information. You can also use the mofcomp command to compile MOF files at any time after installation. Note - If you recompile the CIM_Schema23.mof file or the Solaris_Schema1.0.mof file, you must change to become root user before compiling. For example: % /usr/sadm/bin/mofcomp -v -u root -p [root-password] /usr/sadm/mof/Solaris_Schema1.0.mof The mofcomp CommandThe mofcomp command compiles the specified MOF file into CIM classes and instances that are stored in the CIM Object Manager Repository as Java classes and passed to the CIM Object Manager. You must run the mofcomp command as root or as a user with write access to the namespace in which you are compiling. /usr/sadm/bin/mofcomp [-help] [-v] [-sc] [-si] [-sq] [-version] [-c cimom_hostname ] [-u username] [-p password] file
The mofcomp command will exit with 0 upon success and a positive integer upon failure. Compiling a MOF FileYou can compile a MOF file with or without a .mof extension. The MOF files that describe the CIM and Solaris Schemas are located in /usr/sadm/mof. How to Compile a MOF File
Security AdvisoryIf you run the mofcomp command with the -p option or -u and -p options, and you include a password on the command line, another user can run the ps command or the history command to see your password. Note - If you run a command that requires you to provide your password, immediately change your password after running the command. The following examples show unsafe (insecure) usage, running the mofcomp command with its -p option and then with its -up options: % mofcomp -p Log8Rif % mofcomp -up molly Log8Rif You should change your password immediately after running the mofcomp command in this way. |