Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The integration of SNMP4J-SMI in SNMP4J is very easy and complete. If you create an OID or Variable value from a String value or converting them using the toString() or 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:

Code Block
static {
    SmiManager smiManager = new SmiManager("myLicenseKey", new File("myEmptyDirectory"));
    SNMP4JSettings.setOIDTextFormat(smiManager);
    SNMP4JSettings.setVariableTextFormat(smiManager);
    // If you need to disable full index formatting, then choose a different format below and uncomment the line:
    // smiManager.setOidFormat(OIDFormat.ObjectNameAndDecodedIndex4RoundTrip);
 }

Compiling MIB specification text files

Sample code to compile textual MIB specifications into the SNMP4J-SMI repository directory:

...