Java Dynamic Management Kit 4.1 Tools Reference

mibgen Options

In order to invoke the java.com.sun.jdmk.tools.MibGen class you need to invoke java.com.sun.jdmk.tools.MibGen <options> <mib files>.


mibgen<options><mib files>

where <options> include:

-n

Parses the MIB files without generating code.

-d <dir>

Generates code in the specified target directory.

-tp pkgName (target package)

Generates code within the specified Java package.

-desc

Includes the "DESCRIPTION" clause of OBJECT-TYPE as comment in generated code.

-mo (manager-only)

Generates code for the SNMP manager only, that is the metadata file for the MIB variables (SnmpOidTable file). By default, mibgen generates code for both SNMP agents and managers. By selecting the -mo option, you enable mibgen to generate code for only the manager and not for agents.

-mc (MIB-CORE)

Specify to not use the default MIB-CORE definitions file provided with the Java Dynamic Management Kit; in this case, the user must specify the MIB-CORE definitions file as one of the <mib files>.

-a

Generate code for all the MIB files: without this option, the java code is generated only for the first mib file. In this case, the following mib files are simply used to resolve mib definitions.

-p <prefix>

Use the specified prefix for naming generated classes.

-help

Prints this help message:

Note:

The order followed by mibgen to find the MIB_CORE definitions file is:

  1. The user MIB_CORE definitions file specified in the <mib files> using the -mc mibgen option.

  2. The user command line parameter specified using the -Dmibcore.file java option.

  3. The default MIB_CORE definitions file provided with jdmk under <INSTALL_DIR>/etc/mibgen (mib_core.txt). To succeed, you must be able to derive the jdmk installation directory from the CLASSPATH environment variable. Otherwise, mibgen will look for the mib_core.txt file under <CURRENT_DIR>/etc/mibgen.