MIB object identifier numbers

MIB object identifier numbers

Post by jwma.. » Thu, 04 Apr 1996 04:00:00



Hi, all.  Quick question about MIB object/variable numbers.  Looking at my
handy MIB cheat-sheet, I see that the "system.sysDescr" variable can be
returned by doing an SNMP Get on object number 1.3.6.1.2.1.1.1.0.

First, can anyone explain to me what that zero is doing there on the end?
I've seen an explanation of it before, but it didn't make a lot of sense
to me.  Something about "instantiation" vs. "variable" -- is this an SNMP
way of saying something analagous to "value" vs. "address", or is there
some other part of this paradigm that I'm missing?  The explanation also
said it helped a lot with SNMP GETNEXT operations, and that explanation
similarly seems kind of fuzzy.  In what way does it make SNMP GETNEXT's
more convenient?

Secondly, suppose I want to get the ifDescr of interface number 4 on a
particular unit from the Interfaces group. What would the number look
like for it?  Clearly, 1.3.6.1.2.1.2.1.0 gets me the number of interfaces
(though again that mysterious zero makes its appearance), and my chart
shows something like:

1.3.6.1.2.1
   Interfaces(2)
     ifNumber(1)
     ifTable(2)
       ifEntry(1)
         ifIndex(1)
         ifDescr(2)

But it isn't clear to me how to translate that into a number for (say) the
"ifDescr" variable for the 4th interface.  I've tried the obvious approach
of using 1.3.6.1.2.1.2.2.4.1 (both with and without the trailing .0), but
this doesn't seem to work, implying that I'm not doing the right thing by
simply replacing the "ifEntry" 1 with a 4 (for the fourth interface or
table entry).

Can anyone shed a little light on this?


 
 
 

MIB object identifier numbers

Post by Lionel Chamb » Fri, 05 Apr 1996 04:00:00



>Hi, all.  Quick question about MIB object/variable numbers.  Looking at my
>handy MIB cheat-sheet, I see that the "system.sysDescr" variable can be
>returned by doing an SNMP Get on object number 1.3.6.1.2.1.1.1.0.
>First, can anyone explain to me what that zero is doing there on the end?
>I've seen an explanation of it before, but it didn't make a lot of sense
>to me.  Something about "instantiation" vs. "variable" -- is this an SNMP
>way of saying something analagous to "value" vs. "address", or is there
>some other part of this paradigm that I'm missing?  The explanation also
>said it helped a lot with SNMP GETNEXT operations, and that explanation
>similarly seems kind of fuzzy.  In what way does it make SNMP GETNEXT's
>more convenient?

The rule for instance identification is as follow:
If the object type isn't part of a table, it's a variable and there is
only one instance. The OID suffix is .0

If not, object is part of a table: row or column in a row.
For column of a row append index number at the end of the OID.

In your example:
ifDesc of interface number 4 means ifDesc.4
ie
1.3.6.1.2.1
   Interfaces(2)
     ifTable(2)
       ifEntry(1)
         ifDescr(2)
         4                      interface number

And ifNumber  isn't part of a table it's an instance ( variable ) of
the MIB
It' OID is

1.3.6.1.2.1
   Interfaces(2)
     ifNumber(1)
    0

>Secondly, suppose I want to get the ifDescr of interface number 4 on a
>particular unit from the Interfaces group. What would the number look
>like for it?  Clearly, 1.3.6.1.2.1.2.1.0 gets me the number of interfaces
>(though again that mysterious zero makes its appearance), and my chart
>shows something like:
>1.3.6.1.2.1
>   Interfaces(2)
>     ifNumber(1)
>     ifTable(2)
>       ifEntry(1)
>         ifIndex(1)
>         ifDescr(2)
>But it isn't clear to me how to translate that into a number for (say) the
>"ifDescr" variable for the 4th interface.  I've tried the obvious approach
>of using 1.3.6.1.2.1.2.2.4.1 (both with and without the trailing .0), but
>this doesn't seem to work, implying that I'm not doing the right thing by
>simply replacing the "ifEntry" 1 with a 4 (for the fourth interface or
>table entry).
>Can anyone shed a little light on this?


L. Chambon

 
 
 

MIB object identifier numbers

Post by Eric Riche » Sat, 13 Apr 1996 04:00:00



> First, can anyone explain to me what that zero is doing there on the end?
> I've seen an explanation of it before, but it didn't make a lot of sense
> to me.  Something about "instantiation" vs. "variable" -- is this an SNMP
> way of saying something analagous to "value" vs. "address", or is there
> some other part of this paradigm that I'm missing?  The explanation also
> said it helped a lot with SNMP GETNEXT operations, and that explanation
> similarly seems kind of fuzzy.  In what way does it make SNMP GETNEXT's
> more convenient?

> Secondly, suppose I want to get the ifDescr of interface number 4 on a
> particular unit from the Interfaces group. What would the number look
> like for it?  



I am not a big expert on MIB objects but I have played with it a couple of
years ago.  

I believe that the 0 at the end is used when you get only get one instance of
an object such as "system.sysDescr".  If the case that there are more than
one instance of an object such as the 4th interface, you must use "4" at the
end of the object identifier.

For example, to get the "ifDescr" of the 4th interface, use the following
object ID:

        1.3.6.1.2.1.2.2.1.2.4 or
        1.3.6.1.2.1.Interfaces.ifTable.ifEntry.ifDescr.4

I know this works.  I hope this sheds some light.
--

*******************************************************************
* Eric Richer            |     8585 Cote de Liesse                *
* Group Leader           |     St-Laurent, Quebec, Canada H4L 4X4 *
* Energy Control Systems |     (514) 341-6780                     *
* CAE Electronics Ltd    |     (514) 734-5708 (fax)               *
*******************************************************************

 
 
 

MIB object identifier numbers

Post by Dean Beeb » Wed, 17 Apr 1996 04:00:00




> > First, can anyone explain to me what that zero is doing there on the end? ...  The explanation also
> > said it helped a lot with SNMP GETNEXT operations, and that explanation
> > similarly seems kind of fuzzy.  In what way does it make SNMP GETNEXT's
> > more convenient?


> I believe that the 0 at the end is used when you get only get one instance of
> an object such as "system.sysDescr".

> *******************************************************************

Eric is correct, as I understand it. A scalar value is designated the
zeroth element. So the .0 specifies the value of the object ID to which
the .0 is appended. Many agents will ignore this requirement and return
the correct value when the zero is omitted, while others will return an
error.

When applied to tables, the zeroth element is the column heading. This
makes it possible to use getnext against the zeroth element, and have
returned either the first value in the column, or a change in object ID,
which indicates that there were no entries in the table.

By requiring the .0 even for scalar objects, the same syntax is
preserved for both scalars and tables.

Hope this helps.

Dean Beebe
Unisys / Volpe Center - Washington Operations Branch