Sending v3 traps and using an agent


We are using snmp4j 2.8.6 and snmp4j agent 2.7.4

We have a process that creates an Agent and in the same process we also send out traps.

I noticed that the local USM for v3 is shared with the Agent and the snmp class for sending traps.

We have users that could potentially use the same Security Name for the traps and for the agent but have different passwords / auth combinations.

I noticed that in the snmp4j 3.4.0 they added DirectUserTarget so the target user details for the traps doesn’t have to be saved in the USM. Is there something similar I can use in snmp4j 2.8.6 as we are required to use java 8.

The following FAQ provides a solution for your issue that works with SNMP4J 2.x too:
It is about either using two USM instances, or localize the users appropriately.