[SNMP4J] Problem with SNMPv3 Trap Receiver

Marcin Kokoszka mkokoszka82 at gmail.com
Wed May 27 12:46:24 CEST 2009


Hello Frank,

I have created some simply trap receiver (using the SNMP4J command line tool
as an example).
I'm adding the users manually to the USM Table:

....

OctetString localEngineID = new OctetString(MPv3.createLocalEngineID());
            USM usm = new USM(SecurityProtocols.getInstance(),
localEngineID, 0);
            usm.setEngineDiscoveryEnabled(true);
            SecurityModels.getInstance().addSecurityModel(usm);
....

snmp.getUSM().addUser(securityName, new UsmUser(securityName, authProtocol,
authPassphrase, privProtocol, privPassphrase,
OctetString.fromHexString("ED:0C:00:00:03:00:60:A7:01:56:E5", ':')));

....

The engin ID is also entered manually. The strange thing is that when I'm
sending the SNMPv3 Trap to my trap receiver with command (the same engine
id):

java -jar SNMP4J.jar -p TRAP -v 3 -u user -a MD5 -A password -x DES -P
password -l 0xED:0C:00:00:03:00:60:A7:01:56:E5......

I'm receiving always the "SEVERE: java.lang.NullPointerException".
When I will add the same user but without the EnginId:

....
snmp.getUSM().addUser(securityName, new UsmUser(securityName, authProtocol,
authPassphrase, privProtocol, privPassphrase ));
...

and use the same command to send the SNMPv3 trap everything seems to be ok.
The EngineId is discovered automatically.

Do You have any clues where is the problem?

Best regards
Marcin



More information about the SNMP4J mailing list