Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

snmpbulkget

Status
Not open for further replies.

czezz

MIS
May 16, 2012
3
EU
can see very odd behaviour of "snmpbulkget".
NET-SNMP version: 5.4.1

If I query a node with regular "snmpget" I receive one single line with response. But if I do this same with "snmpbulkget" I receive much more information but not the one I desire.
Please have a look:

snmpget:
Code:

# snmpget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2.1
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0

snmpbulkget:
Code:

# snmpbulkget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2.1
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: other(1)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 100000000

Please note that in case of snmpbulkget I am missing: IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
Moreover, if I use snmpwalk and snmpgulkwalk with specific OID then it works correct for both - it receives one single value.

Does anyone can explain what is happening with snmpbulkget, please ?
 
I don't know your background with SNMP, I will give a simple answer with no explanation.

snmpbulkget starts right after the OID you gave 1.3.6.1.2.1.2.2.1.2.1(ifDescr.1).

snmpbulkget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2

would give you the desired results.

Bill
 
Hello Bill,
let me please disagree.

Lets have a look again at standard snmpget where I specified "specific OID" (means I want to get value just for one specific interface):
# snmpget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2.1
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0

Please mind that this query returned single value which is "FastEthernet0/0".
Now, if I request for for this same specific OID - let me repeat "Specific OID" - with SNMPGETBULK, then I will receive bunch of information and none of them contain value I am looking for (and which is returned with regular snmpget correctly).

# snmpbulkget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2.1
!!! ifDescr.1 is missing !!! My comment
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: other(1)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 100000000


If I use OID that you typed, then it is not a specific OID but OID to whole Object Type. This will work like snmpwalk but receive even more informations/Object Types like: ifDescr, ifType, ifMtu and ifSpeed (incomplete - just for one int).
And I need just ifDescr.1
snmpbulkget -c public -v 2c 217.169.128.14 1.3.6.1.2.1.2.2.1.2
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: other(1)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 10000000

That is a bit confusing for me.
 
getbulk works like a snmpwalk, but places the data in one packet, instead of one packet per oid like snmpwalk.

So, when you say ifIndex.1 it will look to the _next_ oid.

Are you confused as to why the SNMP authors choose this implementation or are you disagreeing with something I said?

Bill



 
Hello again and thanks for reply.
I am confused because I was sure that SNMPBULKGET works this same way as SNMPGET but causing less volume traffic.
Now from your explanation I should have understand that SNMPBULKGET works like SNMPWALK / SNMPBULKWALK.

But here again I cant agree. Lets have a look at below examples: snmpbulkget, snmpbulkwalk and snmpwalk.
There is no Specific OID but whole Object Type ifDescr queried.
As you can see SNMPBULKGET gives much more than I asked and if you take a look at ifSpeed ObjectType (which I didnt ask for ) then you will see that it is incomplete (value only for index .1)
Lets compare this to SNMPWALK and SNMPBULKWALK - the output is for exactly what I asked for.

# snmpbulkget -c public -v 2c 217.169.128.14 ifDescr
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: other(1)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifMtu.2 = INTEGER: 1500
IF-MIB::ifMtu.4 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 10000000

# snmpbulkwalk -c public -v 2c 217.169.128.14 ifDescr
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0

# snmpwalk -c public -v 2c 217.169.128.14 ifDescr
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
IF-MIB::ifDescr.2 = STRING: FastEthernet0/1
IF-MIB::ifDescr.4 = STRING: Null0


So, my question is still this same: how can I use SNMPBULKGET to get just a single value of specific OID ?
One more thing: if I use SNMPBULKWALK / SNMPWALK with specific OID then it will give me just a single value that I asked for.
... but that should be SNMPBULKGET work. Thats confusing.
# snmpbulkwalk -c public -v 2c 217.169.128.14 ifDescr.1
IF-MIB::ifDescr.1 = STRING: FastEthernet0/0
 
>As you can see SNMPBULKGET gives much more than I asked and if you take a look at ifSpeed ObjectType >(which I didnt ask for ) then you will see that it is incomplete (value only for index .1)

The net-snmp implementation defaults to 10 max_repetitions and (i think) 0 non-repeaters.
That is why you are seeing 10 objects returned.

>So, my question is still this same: how can I use SNMPBULKGET to get just a single value of specific OID?

You can't use snmpbulkget to get ifDescr.1 if you put in ifDescr.1. That is what a snmpget would be for.


Bill

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top