[SNMP4J] SNMPv3 Trap Receiver

Frank Prepelica Frank.Prepelica at kathrein-net-tech.de
Fri Dec 9 14:31:27 CET 2016


Hi all,

I've been implementing a SNMPv3 trap receiver.

There are several agents in the system which are able to send trap messages.

The agents may have the same user.

As far as I've understood I have to use localized users in order to receive traps from every agent.

Therefore I call the snmp.discoverAuthoritativeEngineID() in order the get the engine ID for every agent.

After that the new user will be added to the USM:

byte[] authKey = secProtocols.passwordToKey(user.getAuthenticationProtocol(), new OctetString(user.getAuthenticationPassphrase()), engineId);
byte[] privKey = secProtocols.passwordToKey(user.getPrivacyProtocol(), user.getAuthenticationProtocol(), new OctetString(user.getPrivacyPassphrase()), engineId);

this.snmp.getUSM().addLocalizedUser(engineId, user.getSecurityName(), user.getAuthenticationProtocol(), authKey, user.getPrivacyProtocol(), privKey);

After this I've send a snmptrap via net-snmp but I see that processPdu(...) has not been called.

If I just add the new user via
this.snmp.getUSM().addUser(user)
I see that processPdu(...) has been called.

(1) I need to distinguish between the users (with the same name) in order to remove them dynamically from the trap receiver. This is only possible when
using the engine ID (as far as I have understood) Correct?

(2) Could someone please tell what I'm doing wrong by adding the localized user?

(3) What excatly means localized user anyway in this context?

Thank you very much for help!

Best regards
Frank




More information about the SNMP4J mailing list