[SNMP4J] Multiple SNMPv3 Agents running within same Java process

Frank Fock fock at agentpp.com
Thu Dec 13 08:54:47 CET 2018



Hi Stu,

The code you quote from https://github.com/joescii/snmp4s/blob/master/core/ <https://github.com/joescii/snmp4s/blob/master/core/> seems to be old and not production ready.
It is not related to the original SNMP4J and should not be used a reference!

The problem you are facing is caused by the SNMPv3 security standards, thus it is not a bug! I t is a feature.
Each SNMP agent (engine) has to have a (world) unique engine ID. And each agent needs its own USM.

For tips how to implement this with SNMP4J in the same Java process see the “USM separation” section of the FAQ at:
https://doc.snmp.app/pages/viewpage.action?pageId=1441800 <https://doc.snmp.app/pages/viewpage.action?pageId=1441800>

Best regards,
Frank



> On 12. Dec 2018, at 22:30, Stuart Bonsey <Stuart.Bonsey at Aviatnet.com> wrote:
> 
> Hi,
> 
> I am writing a Java application that creates multiple instances of SNMPv3 Agents using SNMP4j-Agent 2.3.1 – a lot like a simulator.
> 
> It is working correctly when I instantiate a single agent, however whenever I start multiple agents, only the last agent responds correctly…all other agents respond with “Unknown user name”
> 
> If I create multiple agents running in separate Java processes, then both agents work as expected.
> 
> Is this a known issue / limitation of SNMP4J-Agent? Or am I doing something wrong?
> 
> I have reproduced the issue using the TestAgent code provide here https://github.com/joescii/snmp4s/blob/master/core/src/test/java/org/snmp4s/TestAgent.java and starting two agents, only the last one responds correctly to v3 requests.
> 
> public static void main(String[] args) {
>    TestAgent.start("192.168.178.100/1610");
>     TestAgent.start("192.168.178.103/1610");
> }
> 
> Any help here would be greatly appreciated.
> 
> Thanks
> Stu
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list