I am new to v3. What I figured out so far is that in order to use a context other than the default “”, I need to add mib with the specific context:
mib.add(“testContext”, new snmpGroup()); and of course
After doing above, I was able to send v3 requests with context “testContext”.
But the problem is, when I send v1 or v2c request, it doesn’t work anymore, because the mib was added not in “” context. What I have to do is when adding mid, do again with “” context:
mib.add("", new snmpGroup());
Then I can send v1, v2c and v3 requests.
Is above the correct way to do things? I feel weird to add the same mib twice. Should agent++ ignore checking context in case of v1 and v2c requests?