The mibgen tool takes as input a set of SNMP MIBs and generates standard MBeans that you can customize. MIBs can be expressed using either SNMP v1 or SNMP v2 syntax.
A MIB is like a management interface: it defines what is exposed, but it doesn't define how to compute the exposed value. Therefore, MBeans generated by mibgen need to be customized to provide the definitive implementation. The MIB is implemented through Java objects, meaning it has access to all Java runtime libraries and all features of the dynamic agent where it will be instantiated.
The mibgen compiler parses an SNMP MIB and generates the following:
An MBean representing the whole MIB
MBeans representing SNMP groups and table entries
Classes representing SNMP tables
Classes representing SNMP enumerated types
A class mapping symbolic names with object identifiers
The resulting classes should be made accessible in the agent application. When the single MBean representing the whole MIB is registered in the MBean server, all the associated groups are automatically instantiated and registered as well.
The mibgen compiler supports all data structure of the v1 and v2 protocols, including:
Tables with cross references indexed across several MIBs
MIBs that contain both v1 and v2 definitions
Nested groups
Default value variables
Row status variables
The Java Dynamic Management Kit also provides an example program, showing how an agent may act as an SNMP proxy to access MIBs in subagents. This allows SNMP managers to access hierarchies of agents through a single proxy agent. In this way, some MIBs may be implemented by native devices and others may be implemented in JMX agents, yet this heterogeneous architecture is completely transparent to the manager issuing a request.