[SNMP4J] Authorization error when doing GET for SNMPv3
pradip de
pradip.de at gmail.com
Fri Oct 9 23:49:48 CEST 2009
Thanks Frank for the reply. I still cannot figure out where I am making an
error in providing the right view access to the user. I am pasting part of
the addViews(..) method and the addUsmUser(..) method for your convenience.
The agentConfig.SecName() is the security name that I am using with MD5 and
DES as the protocols.
The command I am using is
snmpget -v 3 -u <secName> -a MD5 -A <AuthPassphrase> -x DES -X
<PrivPassphrase> <IP address> OID
vacm.addGroup(SecurityModel.SECURITY_MODEL_USM,
new OctetString(agentConfig.getSecName()),
new OctetString("v3group"),
StorageType.nonVolatile);
vacm.addAccess(new OctetString("v1v2group"), new OctetString(),
SecurityModel.SECURITY_MODEL_ANY,
SecurityLevel.NOAUTH_NOPRIV, VacmMIB.vacmExactMatch,
new OctetString("fullReadView"),
new OctetString("fullWriteView"),
new OctetString("fullNotifyView"),
StorageType.nonVolatile);
vacm.addAccess(new OctetString("v3group"), new OctetString(),
SecurityModel.SECURITY_MODEL_USM,
SecurityLevel.AUTH_PRIV, VacmMIB.vacmExactMatch,
new OctetString("fullReadView"),
new OctetString("fullWriteView"),
new OctetString("fullNotifyView"),
StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullReadView"), new
OID("1.3"),
new OctetString(), VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullWriteView"), new
OID("1.3"),
new OctetString(), VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullNotifyView"), new
OID("1.3"),
new OctetString(), VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
protected void addUsmUser(USM usm) {
UsmUser user = new UsmUser(
new OctetString(agentConfig.getSecName()),
AuthMD5.ID,
new OctetString(agentConfig.getAuthPassPhrase()),
PrivDES.ID,
new OctetString(agentConfig.getPrivPassPhrase()));
usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
}
thanks,
Pradip
On Fri, Oct 9, 2009 at 1:38 PM, Frank Fock <fock at agentpp.com> wrote:
> You get an *authorizationError* so this is not related
> to a password (which is used to *authenticate*).
> Check your VACM setup, there seems not to be any matching
> SNMPv3 group or view for that user.
>
> Regards,
> Frank
>
> pradip de wrote:
>
>> Hi,
>> I am getting an authorization error(access denied to object) when I do a
>> snmpget for v3. I am specifying the right user name and passphrase for
>> both
>> auth and priv. The error messag eis pasted below. Any help is greatly
>> appreciated.
>> thanks,
>> Pradip
>>
>> at
>>
>> org.snmp4j.agent.request.SnmpRequest$SnmpSubRequest.requestStatusChanged(SnmpRequest.java:618)
>> at
>>
>> org.snmp4j.agent.request.RequestStatus.fireRequestStatusChanged(RequestStatus.java:90)
>> at
>>
>> org.snmp4j.agent.request.RequestStatus.setErrorStatus(RequestStatus.java:52)
>> at
>>
>> org.snmp4j.agent.CommandProcessor.setAuthorizationError(CommandProcessor.java:487)
>> at
>>
>> org.snmp4j.agent.CommandProcessor.processRequest(CommandProcessor.java:366)
>> at
>>
>> org.snmp4j.agent.CommandProcessor.dispatchCommand(CommandProcessor.java:327)
>> at
>> org.snmp4j.agent.CommandProcessor$Command.run(CommandProcessor.java:548)
>> at org.snmp4j.util.ThreadPool$TaskManager.run(Unknown Source)
>> |#]
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/snmp4j
>>
>
> --
> AGENT++
> http://www.agentpp.com
> http://www.snmp4j.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
>
>
More information about the SNMP4J
mailing list