SNMP Compiler Options

[This is preliminary documentation and subject to change.]

The following table shows the SNMP compiler options. The arguments shown in these option descriptions are:

MIBfile(s)
Specifies the name of an SNMP information module file. The compiler accepts both SNMPv1 and SNMPv2C information modules. You can specify a file name, or specify an absolute or relative path name of a file. In addition to the main input file, you can also specify subsidiary files that can sometimes be required to resolve external references.
MIBdirectory
Specifies a directory to search for MIB files. This can also be an absolute or relative path.
modulename
Specifies the ASN.1 module name of an SNMP information module file. For example, RFC1213-MIB is the module name of the SNMP MIB commonly referred to as MIB-II.

Note also that there must be at least one space between an option and its arguments.

The SNMP compiler options are as follows:

Option Description
/a [/auto] [/s] MIBfiles Performs local syntax-checking, locates IMPORTS references automatically, and, if no errors are found, loads data into the SMIR. Specify /auto to repair the lookup table automatically, if necessary. Specify /s to prevent loading of text subclauses into the SMIR.
/auto Repairs the MIB lookup table, if necessary. When used with /a, /ec, /g, or /gc, this option automatically tries to rebuild the lookup table if any of the following conditions occur:
  • The lookup table cannot be found, or is corrupt. In this case, the compiler completely rebuilds the lookup table.
  • A module name referenced in an IMPORTS statement cannot be located in the lookup table. If the compiler locates the file, a new entry is added to the lookup table; otherwise, the compiler reports an error.
  • A MIB file name referenced in the lookup table cannot be found. The compiler removes the entry from the lookup table, and tries to locate the referenced file. If the file is located, the compiler adds it to the lookup table; otherwise, the compiler reports an error.
/c count Specifies the maximum number of errors the compiler reports; count must be a positive decimal integer. If /c is not specified, there is no limit to the number of errors that can be reported.
/ch Used with /g or /gc. Generates context information in the MOF file header. This information includes the command line, date and time, host name, user name, and process directory.
/d modulename Deletes the specified information module from the SMIR.
/ec [/auto] MIBfiles Performs local syntax-checking, locates IMPORTS references automatically, and reports any errors found. Specify /auto to repair the lookup table automatically, if necessary.
/g [/auto] [/s] [/ch] MIBfiles Performs local syntax-checking, locates IMPORTS references automatically, and writes a SMIR MOF file to the standard output. The SNMP class provider uses a SMIR MOF file to dynamically provide SNMP classes for one or more namespaces. Specify /auto to automatically repair the lookup table, if necessary. Specify /s to prevent loading of text subclauses into the MOF file. Specify /ch to generate context information in the MOF file header.

Use the /g option when you do not know which MIBs are supported by the SNMP devices being managed. The SNMP class provider checks the device at runtime for the presence of this MIB and supplies the classes dynamically to the namespace.

See Loading Static MOF Files and SMIR MOF Files for information on loading the MOF file into CIMOM.

/gc [/auto] [/s] [/ch] MIBfiles Same as /g, but generates a static MOF file which can be loaded as static classes in one or more namespaces.

Use the /gc option when you know which MIBs are supported by the SNMP devices being managed.

See Loading Static MOF Files and SMIR MOF Files for information on loading the MOF file into CIMOM.

/h Displays help on the SNMP compiler syntax. Same as /?.
/i MIBdirectory Adds the specified directory to the list of directories to search for dependent MIB modules. The /i option can appear multiple times on the command line; in this case, directories are searched in the order specified on the command line.
/l Lists all modules in the SMIR.
/lc MIBfile Performs local syntax-checking of the MIB file, but does not resolve IMPORTS references. The compiler reports any errors found.
/m diagnosticlevel Specifies one of the following levels:

0—Completely silent.

1—Reports fatal errors only.

2—Reports fatal errors and warning messages.

3—Reports fatal errors, warnings, and informational messages.

The default is 2.

/n MIBfile Returns the ASN.1 module name of the specified information module.
/ni MIBfiles Returns the ASN.1 module name of all IMPORTS modules referenced by the input file. The compiler does not try to determine second, or greater, level IMPORTS modules.
/p Deletes all information modules from the SMIR.
/pa [MIBdirectory] Adds the directory to the list of directories in the registry and adds the information modules in this directory to the MIB lookup table. This is followed by an implicit /r operation.

If you do not specify a directory, the default is the current directory in which the compiler is being run.

/pd [MIBdirectory] Deletes the directory from the list of directories in the registry and deletes the information modules in this directory from the MIB lookup table. This is followed by an implicit /r operation.

If you do not specify a directory, the default is the current directory in which the compiler is being run.

/r Rebuilds the lookup table.
/s Does not load text subclauses into the SMIR or MOF file. When used with /a, /g, or /gc, this option generates the DESCRIPTION and REFERENCE subclauses of the OBJECT-TYPE macro as empty strings in the SMIR or MOF file. Use this option when minimizing storage requirements is important.
/sa [/auto] [/s] MIBfiles Same as /a, but runs silently. The compiler tries to perform the /a operation but generates no error, warning, or information messages, even if the operation is unsuccessful.
/v1
/v2c
Specifying /v1 compiles the module as an SNMPv1 information module. The compiler reports an error if it detects non-SNMPv1 statements.

Specifying /v2c compiles the module as an SMNPv2C information module. The compiler reports an error if it detects non-SNMPv2C statements.

The default is the union of SNMPv1 and SNMPv2C; as long as a MOF file can be generated or data can be loaded into the SMIR, no errors are reported.

/? Displays help on the SNMP compiler syntax. Same as /h.

For details on the error messages generated by the compiler, see SNMP Compiler Error Messages.