[SNMP4J] About SNMP4J

Jochen Katz katz at agentpp.com
Mon Mar 7 23:46:45 CET 2005


Hello,

> I modifyed the code to this:
> if (version == SnmpConstants.version3)
 > [...]

ok, now I got the error.... It is not sufficient to give the engineId to 
the USM, it must be set on the MPv3 object, too:

It will work, if you change the createSnmpSession function to:

if (version == SnmpConstants.version3) {
   byte[] tt = {01,02,03,04,05,06};
   MPv3 mpv3 =
       (MPv3)snmp.getMessageProcessingModel(MessageProcessingModel.MPv3);
   mpv3.setLocalEngineID(tt);

   USM usm = new USM(SecurityProtocols.getInstance(),
                     new OctetString(mpv3.getLocalEngineID()), 0);
   SecurityModels.getInstance().addSecurityModel(usm);
   addUsmUser(snmp);
}

Command line:
./SNMP4J-linux -d DEBUG -p TRAP -v 3 -u DES -a MD5 -A 12345678 -x DES 
-X12345678 127.0.0.1/162 "1.3.6.1.2.1.1.3.0={t}0"

trapd.conf:
engineID TESTED
createUser -e 010203040506 DES MD5 12345678 DES 12345678

Command line snmptrapd:
snmptrapd -d -f -n -C -c ./trapd.conf -Le -Dusm

Regards,
   Jochen



More information about the SNMP4J mailing list