The integration of SNMP4J-SMI in SNMP4J is very easy and complete. If you create an
Variable value from a
String value or converting them using the
format() methods, SNMP4J-SMI will parse and format the values as human readable object names and value combinations on-the-fly.
Integrating SNMP4J-SMI into SNMP4J
The code needed at minimum to use SNMP4J with SNMP4J-SMI OID and Variable value formatting and parsing support is:
Compiling MIB specification text files
Sample code to compile textual MIB specifications into the SNMP4J-SMI repository directory:
If you specify more than one MIB file, the MIB modules in those files will be automatically processed in the order of their import dependencies This avoids manual sorting or syntax errors because of unresolved IMPORTs.
Loading MIB Modules
Sample code to load (already compiled) a MIB module from the MIB repository directory:
The SmiManager will also load all MIB objects that are imported by the specified modules! You do not have to implement this logic yourself