1. Introduction to the System Management Agent
Setting MIB Environment Variables
8. Long-Running Data Collection
10. Migration of Solstice Enterprise Agents to the System Management Agent
You use the mib2c tool to generate C header files and implementation files from your MIB. You can use the generated C files as templates for your module. You can modify the templates appropriately for your purposes, and then use the templates to make your module. Before the file generation begins, mib2c tests your MIB node for syntax errors. Any errors are reported to standard output. You must fix any syntax errors before the code can be generated. This error-checking ability enables you to use mib2c as you create your MIB to ensure that the MIB syntax is correct.
Note - Be sure to set your MIB environment variables as described in Setting MIB Environment Variables before you use mib2c.
The mib2c command must be run against nodes in the MIB, not on the entire MIB at once. You do not need to specify the MIB name, but the MIB file must be located in a directory on your MIB search path. On the mib2c command line, you must specify a configuration file and the name of one or more MIB nodes. The configuration file must matches the type of data in the MIB node. The command must use the following format:
mib2c -c configfile MIBnode [MIBnode2 MIBnode3 ...]
For example, if you have one node that is called scalarGroup in your MIB, you could use the following command to generate the code templates:
% mib2c -c mib2c.scalar.conf scalarGroup
The files scalarGroup.h and scalarGroup.c are generated.
If your MIB contains both scalar and table data, you should run mib2c separately on the MIB nodes for each type of data. You specify the appropriate configuration file for each type of data.
The following table lists the mib2c configuration files. The table describes the purpose of each configuration file, to help you decide which configuration file to use for your data.
Table 2-1 Configuration Files for Use With mib2c Tool
|
The mib2c(1M) man page includes more details about using the mib2c tool. You should also see Chapter 3, Data Modeling for more examples of using mib2c.