Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...One of the best run forums I have used in years! ...I like the way the site is organized and your no tolerance of flames..."

Geography

Where in the world do Tek-Tips members come from?
czezz (MIS)
16 May 12 12:15
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 ?
bnorton916 (Programmer)
16 May 12 13:58
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
czezz (MIS)
23 May 12 10:58
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.
bnorton916 (Programmer)
23 May 12 13:02
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



czezz (MIS)
24 May 12 3:46
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
bnorton916 (Programmer)
24 May 12 11:42
>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

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close