SNMP Manager Programmer's Guide
SNMP Manager Programmer’s Guide–134249
3-1
3
Using the MIB Compiler
The MIB compiler parses ASN.1 MIB definitions and creates output useful when
writing MIB object handling logic:
•
Output useful for reference while programming can be generated using the
-numbers and -statistics options.
•
Output that is program-readable can be generated using the -nametree and -readtree
options.
When you invoke the MIB compiler, you identify all the files you want it to parse. The
MIB compiler performs ASN.1 syntax checking on MIB definitions in the input files,
returning any warning or error messages to your standard output stream. It also
generates an output file if you use the -numbers, -nametree, or -readtree option.
The MIB compiler has built-in knowledge of the definitions in the following MIB
modules: RFC1155-SMI, RFC-1212, RFC-1215, SNMPv2-SMI, SNMPv2-TC,
SNMPv2-CONF, and SNMPv2-TM. If any of your input files import definitions from
other MIB modules, be sure to name the file providing the definitions before naming
files in which the imported definitions are used. For example, the Host Resource
Subagent’s MIB (in file rfc1514a) imports definitions from RFC 1213 (in file rfc1213):
mibcomp rfc1213 rfc1514a
-numbers
creates an output file containing a line describing each subtree and leaf in a MIB
file. For subtrees, the OID and name appear. For leaves, the OID, name, and syntax
appear. The example on the following page is from the beginning of the -numbers
output file describing the hrDevice group in the Host Resources MIB.
mibcomp [-numbers | -statistics | -nametree | -readtree]
[-exclude MIB-module-name.MIB-object-name]...
[-l file-search-path]...
[-o output-file-name]
[-nowarn]
[-quiet]
{@ automated-response-file-name | MIB-file-name}...