Hi,
the error is reproducable at the following
- session:AgentXSession is instantiated and connected
to the local master agent Net-SNMP via
connection:AgentXConnection.
- group groupA:AgentXGroup is registered to session to
handle MIB requests for .1.2.3.1.1
- groupA comprises one scalar MIB object of type
integer with OID .1.2.3.1.1.1.0
- group groupB:AgentXGroup is registered to session to
handle MIB requests for .1.2.3.1.1.2
- groupB comprises one scalar MIB object of type
integer with OID .1.2.3.1.1.2.1.0
- snmpset -v2c -cprivate localhost .1.2.3.1.1.2.1.0 i 5
returns INCONSISTENT_NAME although the MIB object
obviously exists.
In method AgentXSession.handleSetRequest() groups are
unsufficiently tested on whether they comprise a given
OID or not:
...
int x = oid.compareTo(group.getOID());
if ((x == 0) || (x > group.getOID().getLength())) break;
...
These lines only test, if the OIDs are exactly the same
or the
the OID to be set resides in a subtree of the group
OID. Comparing .1.2.3.1.1 and .1.2.3.1.1.2.1.0 the
latter holds true, i.e. .1.2.3.1.1.2.1.0 indeed seems
to reside in a subtree of .1.2.3.1.1. The second
registered group is never tested. Anyway groupA does
not contain a scalar with such an OID,
INCONSISTENT_NAME is returned.
All registered groups must be tested, to actually
contain the scalar MIB object in question. For this
purpose group.getElement() must be called for each
registered group.
I am going to attach the fixed AgentXSession.java. Any
comments are very much appreciated.
Kind regards
Jakob
Fixed AgentXSession.java
Logged In: YES
user_id=1201253
Is this in the 0.0.17 or 0.0.16 or both?
Thanks,
Daniel
Logged In: YES
user_id=1201253
Didn't see the attached file. However, can you upload a
copy of the interface IfAgentXSession you created? What is
the puropse behind this interface and where else are you
referencing it?