Hi, thanks everyone for the responses. I have used the "-p GET" option and it works. Thanks Frank for the terrific SNMP4J!
Best regards, Erik ----- Original Message ---- From: Frank Fock <[EMAIL PROTECTED]> To: Erik Torres Serrano <[EMAIL PROTECTED]> Cc: [email protected] Sent: Thursday, April 3, 2008 10:51:33 PM Subject: Re: [SNMP4J] console tool (SnmpRequest) returns an incorrect value Hi Erik, With the console tool, you have to explicitly specify the PDU type, since there are no different flavors of the tool like in NET-SNMP for each PDU type. The default is GETNEXT, and so, the behavior is correct. Simply specify "-t GET" as option and you will receive the expected result. Best regards, Frank Erik Torres Serrano wrote: > <!-- > @page { size: 8.5in 11in; margin: 0.79in } > P { margin-bottom: 0.08in } > --Hi, > > I'm using the console tool to search > for a given OID. The issue I'm having is that the response is > different to the response given by the snmpget application bundled > with net-snmp. > > > Search OID: 1.3.6.1.2.1.1.5.0 > > > Values returned: > > > SNMP4J SnmpRequest: 1.3.6.1.2.1.1.6.0 = > "SystemLocation" > Net-SNMP snmpget: .1.3.6.1.2.1.1.5.0 = > STRING: SystemName > > > The correct value is the one given by > snmpget. What's more, a search of the successor OID 1.3.6.1.2.1.1.6.0 > (sysLocation.0 > ) with SnmpRequest returns the correct value for > 1.3.6.1.2.1.1.5.0, and the same behavior is reproduced for different > pairs (for instance, a search OID = 1.3.6.1.4.1.2021.4.4.0 produces a > response OID = 1.3.6.1.4.1.2021.4.5.0). > > > Am I missing something? > > > Regards, > > > Erik Torres > > > ********* Execution traces ********* > > > java -cp SNMP4J.jar:log4j-1.2.15.jar > org.snmp4j.tools.console.SnmpRequest -a MD5 -A MY_PASSPHRASE -u > monitor -v 3 -x DES -X MY_PASSPHRASE udp:localhost 1.3.6.1.2.1.1.5.0 > > Apr 3, 2008 5:51:24 PM > org.snmp4j.log.JavaLogAdapter log > > INFO: UDP receive buffer size for > socket 127.0.0.1/0 is set to: 55296 > > Received response after 481 millis > > Response received with > requestID=994930613, errorIndex=0, errorStatus=Success(0) > > 1.3.6.1.2.1.1.6.0 = "SystemLocation" > > > snmpget -On -v 3 -u monitor -n "" > -l authNoPriv -a MD5 -A MY_PASSPHRASE localhost sysName.0 > > .1.3.6.1.2.1.1.5.0 = STRING: SystemName > > > ********* Testbed ********* > > > OS: Ubuntu with Linux kernel 2.6.22 > SNMP: NET SNMP 5.3.1 (Ubuntu build) > Java: Java(TM) SE Runtime Environment > (build 1.6.0_03-b05) > SNMP4J: 1.8 and 1.9.1c > > > > > > > ____________________________________________________________________________________ > You rock. That's why Blockbuster's offering you one month of Blockbuster > Total Access, No Cost. > http://tc.deals.yahoo.com/tc/blockbuster/text5.com > _______________________________________________ > SNMP4J mailing list > [email protected] > http://lists.agentpp.org/mailman/listinfo/snmp4j -- AGENT++ http://www.agentpp.com http://www.mibexplorer.com http://www.mibdesigner.com ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com _______________________________________________ SNMP4J mailing list [email protected] http://lists.agentpp.org/mailman/listinfo/snmp4j
