[SNMP4J] "Strange" GET Behaviour with OIDs

Frank Fock fock at agentpp.com
Wed Jan 18 20:05:31 CET 2006


Hi Marco,

It seems that your agent is not fully standard conform. If
1.3.6.1.4.1.637.54.1.1.8.1.5.1.2.3 is a scalar, then the
trailing .0 is a requirement and an agent should return
a noSuchInstance error when receiving a request on
such an OID.

Your SET request probably failed because you did not
used the appropriate community string (for write access).

Best regards,
Frank

Marco.Bresciani at alcatel.it wrote:

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


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





More information about the SNMP4J mailing list