Hi,
First of all, NET-SNMP's snmpwalk and the SNMP
GETBULK operation are two totally different things.
GETRBULK is similar to GETNEXT. Thus if you provide
an instance OID (ends with .0) you will not get
the instance but its successor (if available).
snmpwalk works very differently and it is not worth the
time trying to compare it with GETBULK.
Best regards,
Frank
Am 03.11.2011 10:06, schrieb pierre.coquen...@livingobjects.com:
Hi,
I'm facing a problem when executing a walk operation to get a single
value. I'm using snmp4j 2.0.2. I've tried with the main provided in jar
but I've the same result.
What am I doing wrong ?
Here what I receive when I use the snmpwalk :
lobj:$ snmpwalk -v 2c -c public 10.67.219.49 1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (363840427) 42 days,
2:40:04.27
If I execute the same operation with SnmpRequest.java, I receive this
:
lobj@:$ java -cp ../lib/snmp4j-2.0.2.jar:../lib/log4j-1.2.16.jar
org.snmp4j.tools.console.SnmpRequest -Ow -c public -v 2c 10.67.219.49
1.3.6.1.2.1.1.3.0
0 [main] DEBUG org.snmp4j.security.Salt - Initialized Salt to
44c42b090a16e1a4.
26 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - UDP receive buffer
size for socket 10.116.192.18/0 is set to: 57344
55 [main] DEBUG org.snmp4j.Snmp - Running pending async request with
handle PduHandle[898904463] and retry count left 1
68 [main] DEBUG org.snmp4j.transport.DefaultUdpTransportMapping -
Sending message to 10.67.219.49/161 with length 43:
30:29:02:01:01:04:06:70:75:62:6c:69:63:a1:1c:02:04:35:94:31:8f:02:01:00:02:01:00:30:0e:30:0c:06:08:2b:06:01:02:01:01:03:00:05:00
101 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - Received message
from /10.67.219.49/161 with length 58:
30:38:02:01:01:04:06:70:75:62:6c:69:63:a2:2b:02:04:35:94:31:8f:02:01:00:02:01:00:30:1d:30:1b:06:08:2b:06:01:02:01:01:04:00:04:0f:4e:4f:43:2d:44:53:4c:2d:53:55:50:50:4f:52:54
120 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Looking up pending request with handle PduHandle[898904463]
123 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Cancelling pending request with handle PduHandle[898904463]
Total requests sent:0
Total objects received: 0
Total walk time:101 milliseconds
And if I execute again but with removing the last '0' at the end of
OID :
lobj@:$ java -cp ../lib/snmp4j-2.0.2.jar:../lib/log4j-1.2.16.jar
org.snmp4j.tools.console.SnmpRequest -Ow -c public -v 2c 10.67.219.49
1.3.6.1.2.1.1.3
1 [main] DEBUG org.snmp4j.security.Salt - Initialized Salt to
75f59990912b2a82.
26 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - UDP receive buffer
size for socket 10.116.192.18/0 is set to: 57344
54 [main] DEBUG org.snmp4j.Snmp - Running pending async request with
handle PduHandle[1118795335] and retry count left 1
57 [main] DEBUG org.snmp4j.transport.DefaultUdpTransportMapping -
Sending message to 10.67.219.49/161 with length 42:
30:28:02:01:01:04:06:70:75:62:6c:69:63:a1:1b:02:04:42:af:76:47:02:01:00:02:01:00:30:0d:30:0b:06:07:2b:06:01:02:01:01:03:05:00
91 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - Received message
from /10.67.219.49/161 with length 47:
30:2d:02:01:01:04:06:70:75:62:6c:69:63:a2:20:02:04:42:af:76:47:02:01:00:02:01:00:30:12:30:10:06:08:2b:06:01:02:01:01:03:00:43:04:15:b0:70:68
113 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Looking up pending request with handle PduHandle[1118795335]
115 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Cancelling pending request with handle PduHandle[1118795335]
1.3.6.1.2.1.1.3.0 = 42 days, 2:47:26.48
166 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Running pending async request with handle PduHandle[1118795337] and
retry count left 1
167 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - Sending message to
10.67.219.49/161 with length 43:
30:29:02:01:01:04:06:70:75:62:6c:69:63:a1:1c:02:04:42:af:76:49:02:01:00:02:01:00:30:0e:30:0c:06:08:2b:06:01:02:01:01:03:00:05:00
209 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG
org.snmp4j.transport.DefaultUdpTransportMapping - Received message
from /10.67.219.49/161 with length 58:
30:38:02:01:01:04:06:70:75:62:6c:69:63:a2:2b:02:04:42:af:76:49:02:01:00:02:01:00:30:1d:30:1b:06:08:2b:06:01:02:01:01:04:00:04:0f:4e:4f:43:2d:44:53:4c:2d:53:55:50:50:4f:52:54
211 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Looking up pending request with handle PduHandle[1118795337]
211 [DefaultUDPTransportMapping_10.116.192.18/0] DEBUG org.snmp4j.Snmp
- Cancelling pending request with handle PduHandle[1118795337]
Total requests sent:1
Total objects