Re: How get OIDs from returned values in python net-snmp

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKoMtGaVXMR5avqrm_2_QbRjrpvvNef7Lr2Q3PGcSJ0C-_DPPg@mail.gmail.com>
On 8 April 2012 17:50, standa dolinek <[email protected]> wrote:
> result = sess.walk(Vars)
> print Vars[0].tag
> print Vars[1].tag
>
> And i get:
>
> '.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifPhysAddress'
> '.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifPhysAddress'

That's correct - since you are just asking for the MIB object name for
each varbind.


> But in response from command line snmpwalk are included index values too:

Try

  print  Vars[0].tag,  Vars[0].iid
  print  Vars[1].tag,  Vars[1].iid

or even

  print  Vars[0].tag,  Vars[0].iid,  " = ", Vars[0].val
  print  Vars[1].tag,  Vars[1].iid,  " = ", Vars[1].val

The index and value (and type) are available as separate elements
within the Varbind structure

Dave

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.