Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added classifier to dependency code snippet to make sure to select jar-with-dependencies


 

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.

Tip
titleSNMP4J Maven Repository

To include SNMP4J-SMI-PRO in your Maven build, you need to add the SNMP4J Maven repository to your .m2/settings.xml file as shown below.


Code Block
titleMaven Repository Definition
      <repositories>
        <repository>
          <id>snmp4j</id>
          <name>SNMP4J Releases</name>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
          <url>https://snmp.app/dist/release</url>
          <layout>default</layout>
        </repository>
      </repositories>


Code Block
titleMaven Dependency for pom.xml
<dependency>
   <groupId>org.snmp4j.smi</groupId>
   <artifactId>snmp4j-smi-pro</artifactId>
   <version>1.9.13</version>
   <classifier>jar-with-dependencies</classifier>
 </dependency>

Integrating SNMP4J-SMI into SNMP4J

...

Code Block
smiManager.loadModule("SNMP-VIEW-BASED-ACM-MIB");
smiManager.loadModule("SNMPv2-MIBSMI");

The SmiManager will also load all MIB objects that are imported by the specified modules! You do not have to implement this logic yourself

...