[SNMP4J] console tool (SnmpRequest) returns an incorrect value

Erik Torres Serrano etserrano at yahoo.com
Thu Apr 3 18:53:31 CEST 2008


<!--
		@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



More information about the SNMP4J mailing list