Java Dynamic Management Kit 3.2 Programming Guide | ||||
---|---|---|---|---|
![]() | ![]() | Chapter 18. The mibgen Compiler | ![]() | ![]() |
The mibgen compiler is a command line utility that enables you to generate Java source code that implements SNMP MIBs. MIBs can be expressed using SNMP v1 or SNMP v2 syntax. To use mibgen to compile your MIBs, type the command for your operating environment:
In a Solaris operating environment:
prompt% installDir/SUNWconn/bin/mibgen [options] mib1 ... mibN |
In a Windows NT operating environment:
C:\> "installDir\SUNWconn\jaw\bin\mibgen" [options] mib1 ... mibN |
The mibgen tool can be invoked with the following options:
mibgen [-n] [-d dir] [-tp packageName] [-desc] [-a] [-m] [-mo] [-p prefix] [-help] mib1 ... mibN |
-n
Parses the MIB files without generating Java code. Use this option to check the syntax of your MIB files.
-d dir
Specifies the destination directory for the generated code.
-tp packageName
Assigns the Java package packageName to each generated class.
-desc
Includes the comments, that is, the DESCRIPTION clause of OBJECT-TYPE in the MIB file, as Java comments in the generated Java code.
-a
Generates Java code for all the specified MIB files. If you do not specify this parameter, only the first MIB specified is used to generate code.
-m
Generates Java code for the SNMP manager and the agent. The -m option cannot be used with the -n option.
-mo
Generates Java code for the SNMP manager only. The -mo option cannot be used with the -n option.
-p prefix
Use the specified prefix when generating Java code.
-help
Prints a usage message describing the options for mibgen.
mib1 ... mibN
Specifies the list of MIB files to be compiled. Each MIB in the list must be separated from the one that precedes it by a space.
![]() | ![]() | ![]() |
The mibgen Compiler | ![]() | Output From the mibgen Compiler |