Extensible SNMPv3 open source stack for Java SE 8 or later

with MD5, SHA-1, SHA-2 and DES, 3DES, and AES security, as well as UDP, TCP, TLS, DTLS transport.

SNMP-Agent Development

Developing an SNMP agent is far more complex than implementing a SNMP manager. SNMP4J-Agent - the defacto standard for Java SNMP agent development - reduces that complexity to a minimum.
Use AgenPro code generator to create an agent from exisiting MIBs instantly and safe even more time and effort!

Download SNMP4J-Agent Tutorial

API Documentation

SNMP4J is open source and has a very good API documentation even down to the details. Don't miss it!

API Documentation


Send SNMP commands, send and receive notifications/traps and informs. This is the base API for any SNMP application or agent.



Extend SNMP4J with agent (command responder) capabilities. Implement atomic SET operations with 2-phase commit, table, and GETBULK operations.



Add AgentX master/subagent support to any SNMP4J-Agent and buffered table models to support large tables efficiently.



Use SMI MIB module specifications to use object name to identifier (OID) mapping and syntax conversions with all SNMP4J APIs at runtime.


SNMP4J Sample Code - GETNEXT with SNMPv3 (SHA256+AES128)

 * Brief flow description of using the new SNMP4J fluent interface: 
 * SnmpBuilder.udp() => Snmp
 * => TargetBuilder 
 *     TargetBuilder.user(..)...done() => Target
 *     TargetBuilder.pdu() => PDUrequest
 * SnmpCompletableFuture.send(Snmp, Target, PDUrequest) => SnmpCompletableFuture
 * SnmpCompletableFuture.get() => PDUresponse

public class UsmGetNext {

    public void nextFluent(String address, String contextName, String securityName,
                           String authPassphrase, String privPassphrase, String... oids) throws IOException {
        SnmpBuilder snmpBuilder = new SnmpBuilder();
        Snmp snmp = snmpBuilder.udp().v3().usm().threads(2).build();
        Address targetAddress = GenericAddress.parse(address);
        byte[] targetEngineID = snmp.discoverAuthoritativeEngineID(targetAddress, 1000);
        if (targetEngineID != null) {
            TargetBuilder<?> targetBuilder =;
            Target<?> userTarget = targetBuilder
                    .user(securityName, targetEngineID)

            PDU pdu = targetBuilder.pdu().type(PDU.GETNEXT).oids(oids).contextName(contextName).build();
            SnmpCompletableFuture snmpRequestFuture = SnmpCompletableFuture.send(snmp, userTarget, pdu);
            try {
                List<VariableBinding> vbs = snmpRequestFuture.get().getAll();

                System.out.println("Received: " + snmpRequestFuture.getResponseEvent().getResponse());
                System.out.println("Payload:  " + vbs);
            } catch (ExecutionException | InterruptedException ex) {
                if (ex.getCause() != null) {
                } else {
                    System.err.println("Request failed: "+ex.getMessage());
        else {
            System.err.println("Timeout on engine ID discovery for "+targetAddress+", GETNEXT not sent.");

    public static void main(String[] args) {
        if (args.length < 5) {
            System.out.println("Usage: UsmGetNext <address> <secName> <authPassphrase> <privPassphrase> <oid>...");
            System.out.println("where <address> is of the form 'udp:<hostname>/<port>'");
        String targetAddress = args[0];
        String context = "";
        String securityName = args[1];
        String authPasssphrase = args[2].length() == 0 ? null : args[2];
        String privPasssphrase = args[3].length() == 0 ? null : args[3];
        String[] oids = new String[args.length - 4];
        System.arraycopy(args, 4, oids, 0, args.length - 4);
        UsmGetNext usmGetNext = new UsmGetNext();
        try {
            usmGetNext.nextFluent(targetAddress, context, securityName, authPasssphrase, privPasssphrase, oids);
        } catch (IOException e) {
Card image cap
Create custom MIBs with MIB Designer

Use MIB Designer to create, edit, and manage organizational MIB specifications. Ensure 100% standard compliance & interoperability.

Card image cap
Code Generation with AgenPro

Generate SNMP4J agent and manager code with ready-to-use but modifiable templates that support round-trip engineering.

Card image cap
Explore and test SNMP devices with MIB Explorer

Debug, test, explore, monitor, and configure SNMP agents intuitivly. MIB Explorer is built with SNMP4J and SNMP4J-SMI-PRO!


OID vacmAccessContextMatch = new OID("");
System.out.println("> "+vacmAccessContextMatch.toString())
With SNMP4J only:
> vacmAccessContextMatch."v3group"."\".3.'noAuthNoPriv(1)'
Construct OIDs by using object names too:
assertEquals(new OID("vacmAccessContextMatch.\"v3group\".\"\".3.'noAuthNoPriv(1)'"), vacmAccessContextMatch);
assertEquals(new OID("vacmAccessContextMatch.\"\".3.'noAuthNoPriv(1)'"), vacmAccessContextMatch);
assertEquals(new OID("vacmAccessContextMatch.\"\".3.1"), vacmAccessContextMatch;
MIB Information @Runtime with SNMP4J-SMI-PRO

SNMP4J seamlessly uses SMI MIB data provided by the SNMP4J-SMI-PRO API and MIB compiler.


Contact Us

Maximilian-Kolbe-Str. 10
73257 Köngen, Germany
P: +49 7024 8688230



About Us was founded 2003 to provide an open source SNMP API based on the experiences with SNMP++ and AGENT++ development by AGENTPP since 1998. The initial version of SNMP4J was released April, 2004. SNMP4J is the first Apache 2 Open Source licensed pure Java SNMP library supporting all IETF standard SNMP versions, transport mappings, and security protocols.

AGENTPP was founded 1998 by Frank Fock. AGENTPP provides commercial APIs, support, and SMNP development tools. These offerings are funding and ensuring the continuous free open source SNMP4J development.