[SNMP4J] TestAgent and SNMPv3

Frank Fock fock at agentpp.com
Mon Dec 18 20:12:24 CET 2006


Hello Ricardo,

Yes, you are missing something obvious:
You have *excluded* the sub-trees from your
view and you then try to access them.
When you *include* them you probably have more
luck ;-)

Best regards,
Frank

Ricardo Nabinger Sanchez wrote:
> Hello,
> 
> I'm trying to run the TestAgent with SNMPv3, but am not succeeding at it.
> 
> The users were not changed, but here they are:
> 
>   protected void addUsmUser(USM usm) {
>     UsmUser user = new UsmUser(new OctetString("SHADES"),
>                                AuthSHA.ID,
>                                new OctetString("SHADESAuthPassword"),
>                                PrivDES.ID,
>                                new OctetString("SHADESPrivPassword"));
>     usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
>     System.err.println(user);
>     user = new UsmUser(new OctetString("TEST"),
>                                AuthSHA.ID,
>                                new OctetString("maplesyrup"),
>                                PrivDES.ID,
>                                new OctetString("maplesyrup"));
>     usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
>     System.err.println(user);
>     user = new UsmUser(new OctetString("SHA"),
>                                AuthSHA.ID,
>                                new OctetString("SHAAuthPassword"),
>                                null,
>                                null);
>     usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
>     System.err.println(user);
>   }
> 
> 
> I've added the subtrees I want to access, just in case this was needed:
> 
>   protected void addViews(VacmMIB vacm) {
>     ...
>     vacm.addViewTreeFamily(new OctetString("testReadView"),
>                            new OID("1.3.6.1.2.1.4"),
>                            new OctetString(), VacmMIB.vacmViewExcluded,
>                            StorageType.nonVolatile);
>     vacm.addViewTreeFamily(new OctetString("testReadView"),
>                            new OID("1.3.6.1.2.1.4.24"),
>                            new OctetString(), VacmMIB.vacmViewExcluded,
>                            StorageType.nonVolatile);
>     ...
>   }
> 
> 
> But when I try to query the agent, all I get is:
> % java -jar SNMP4J.jar -a SHA -A maplesyrup -u TEST -p GETNEXT -Ow 127.0.0.1/12345 .1.3.6.1.2.1.4.24
> Dec 18, 2006 4:58:56 PM org.snmp4j.log.JavaLogAdapter log
> INFO: UDP receive buffer size for socket 192.168.1.100/0 is set to: 42080
> Dec 18, 2006 4:58:57 PM org.snmp4j.log.JavaLogAdapter log
> WARNING: 1.3.6.1.6.3.15.1.1.2.0 = 1
> Dec 18, 2006 4:58:57 PM org.snmp4j.log.JavaLogAdapter log
> WARNING: 1.3.6.1.6.3.15.1.1.2.0 = 2
> 
> Total requests sent:    1
> Total objects received: 0
> Total walk time:        2083 milliseconds
> Request timed out.
> 
> 
> And in the agent's log:
> 4364 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.4.0 = 1
> 4745 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.2.0 = 1
> 5413 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.2.0 = 2
> 39804 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.4.0 = 2
> 40307 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.2.0 = 3
> 40830 [DefaultUDPTransportMapping_0.0.0.0/12345] WARN org.snmp4j.MessageDispatcherImpl  - 1.3.6.1.6.3.15.1.1.2.0 = 4
> 
> 
> May this be related to an issue with timeouts, discussed here:
>     http://lists.agentpp.org/pipermail/snmp4j/2004-December/000231.html
> 
> 
> If I go with SNMPv2 or SNMPv1, everything is perfect:
> % java -jar SNMP4J.jar -v 2c -c public -p GETNEXT -Ow 127.0.0.1/12345 .1.3.6.1.2.1.4.24
> Dec 18, 2006 5:08:44 PM org.snmp4j.log.JavaLogAdapter log
> INFO: UDP receive buffer size for socket 192.168.1.100/0 is set to: 42080
> 1.3.6.1.2.1.4.24.1.0 = 9
> ...
> Total requests sent:    138
> Total objects received: 138
> Total walk time:        1555 milliseconds
> Dec 18, 2006 5:08:45 PM org.snmp4j.log.JavaLogAdapter log
> WARNING: java.io.InterruptedIOException: operation interrupted
> End of walked subtree '1.3.6.1.2.1.4.24' reached at:
> 1.3.6.1.2.1.11.1.0 = 144
> 
> 
> I'm sure I'm missing something pretty obvious here, but reading the docs and googling are not helping anymore.
> 
> Thanks in advance.
> Regards.
> 

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list