[SNMP4J] "Strange" GET Behaviour with OIDs

Marco.Bresciani at alcatel.it Marco.Bresciani at alcatel.it
Wed Jan 18 11:01:39 CET 2006


Hi all,
  a strange thing happens... :-) I'm implementing an SNMP layer above a 
lot of existing things so I'm a bit messed up! I'm working on the SET part 
that gives me some problems but the GET part, working, gimve me some 
problems too. I've used the command line in two ways and both works:

------------------------------------------------------------------------------
"C:\Program Files\Java\jdk1.5.0_03\bin\java.exe" -cp 
lib/SNMP4J.jar;lib/log4j-1.2.9.jar org.snmp4j.tools.console.SnmpRequest -v 
2c -d INFO -p GET udp:10.0.1.2/161 "1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3"
0 [DefaultUDPTransportMapping_151.98.71.55/0] INFO 
org.snmp4j.transport.DefaultUdpTransportMapping  - UDP receive buffer size 
for socket 151.98.71.55/0 is set to: 8192
Received response after 78 millis
Response received with requestID=1192208468, errorIndex=0, 
errorStatus=Success(0)
1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3 = CPI3

"C:\Program Files\Java\jdk1.5.0_03\bin\java.exe" -cp 
lib/SNMP4J.jar;lib/log4j-1.2.9.jar org.snmp4j.tools.console.SnmpRequest -v 
2c -d INFO -p GET udp:10.0.1.2/161 "1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3.0"
0 [DefaultUDPTransportMapping_151.98.71.55/0] INFO 
org.snmp4j.transport.DefaultUdpTransportMapping  - UDP receive buffer size 
for socket 151.98.71.55/0 is set to: 8192
Received response after 78 millis
Response received with requestID=432694549, errorIndex=0, 
errorStatus=Success(0)

1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3.0 = CPI3
------------------------------------------------------------------------------

So, using OIDs with both ".0" at the end or not, it works fine. But if I 
remove the ".0" from my code it does not work. I'll put the GET code the 
next time, now I would like to focus on the SET part.

------------------------------------------------------------------------------
"C:\Program Files\Java\jdk1.5.0_03\bin\java.exe" -cp 
lib/SNMP4J.jar;lib/log4j-1.2.9.jar org.snmp4j.tools.console.SnmpRequest -v 
2c -d INFO -p SET udp:10.0.1.2/161 
"1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3.0={s}CPI32"
0 [DefaultUDPTransportMapping_151.98.71.55/0] INFO 
org.snmp4j.transport.DefaultUdpTransportMapping  - UDP receive buffer size 
for socket 151.98.71.55/0 is set to: 8192
Received response after 2015 millis
Request timed out.

"C:\Program Files\Java\jdk1.5.0_03\bin\java.exe" -cp 
lib/SNMP4J.jar;lib/log4j-1.2.9.jar org.snmp4j.tools.console.SnmpRequest -v 
2c -d INFO -p SET udp:10.0.1.2/161 
"1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3={s}CPI32"
0 [DefaultUDPTransportMapping_151.98.71.55/0] INFO 
org.snmp4j.transport.DefaultUdpTransportMapping  - UDP receive buffer size 
for socket 151.98.71.55/0 is set to: 8192
Received response after 2015 millis
Request timed out.
------------------------------------------------------------------------------

As you can see, even if the GET part works fine anyway, it seems the SET 
part does not work at all... what could be the problem? Also, in my code I 
use: result = snmp.send(set_pdu) and the result gives me no error... but, 
obviously, the SET does not change the value. Anyone can help?

Thank you,

Dott. Ing. Marco Bresciani

-- 
Alcatel - WTD R&D SW Lab. [Stage]
Via Trento, 30
20059 Vimercate (Mi) Italia
Phone: +39.039.686.5546
E-Mail: Marco.Bresciani at Alcatel.It



More information about the SNMP4J mailing list