[SNMP4J] Consecutive SNMPv3 GET Requests using same User

ulrich berl ulrich.berl at gmx.net
Tue Aug 7 14:30:01 CEST 2018


Take the following:

A SnmpManager application creates one (global) instance of class org.snmp4j.Snmp after startup.

SnmpManager application will do consecutive SNMPv3 GET Requests (sysDescr) with user MD5 using global snmp instance.
The authPassphrase for user MD5 is changeable between GET Requests.


If i do an snmp.getUSM().addUser(...) in the getRequest(...):

[OK] Request 1 - CorrectAuthPassphrase -> sysDescr returned
--- change authPassphrase in SnmpManager application
[NOK] Request 2 - WrongAuthPassphrase -> sysDescr returned <-- should be an authentication failure


If i do an snmp.getUSM().addLocalizedUser(...) in the getRequest(...):

[OK] Request 1 - CorrectAuthPassphrase -> sysDescr returned
--- change authPassphrase in SnmpManager application
[OK] Request 2 - WrongAuthPassphrase -> error

So for such an application i should always use localized users (https://oosnmp.net/confluence/pages/viewpage.action?pageId=1441800) or clearing the user table before next request ?
What about the snmp.getUSM().addUser(...) method - when to use this method ?

br, Ulrich




More information about the SNMP4J mailing list