How get OIDs from returned values in python net-snmp-5.4.2 module

Alexey Kostyuk <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization JSC CenterTelecom Kaluga branch
Message-ID <1269498850.2288.22.camel@localhost>
Hi!
I use python net-snmp module for retrieve some info via snmp.
When I use snmpwalk from net-snmp-utils output will be contain values
and his OIDs, like in this example:

[unit@unit mibs]$ snmpwalk -Cc -c public -v1 10.50.252.1
1.3.6.1.2.1.10.94.1.1.14
SNMPv2-SMI::transmission.94.1.1.14.1.2.68.69.70.86.65.76 = INTEGER: 2
SNMPv2-SMI::transmission.94.1.1.14.1.2.52.48.57.54 = INTEGER: 3
SNMPv2-SMI::transmission.94.1.1.14.1.2.50.48.52.56 = INTEGER: 3
....

When I try to get it via python using this code:

Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:45)
[GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
>>> sess = netsnmp.Session(Version=2, DestHost='10.50.252.1',
Community='public')
>>> sess.UseLongNames = 1
>>> sess.UseEnums = 1
>>> vars = netsnmp.VarList(netsnmp.Varbind('1.3.6.1.2.1.10.94.1.1.14',
''))
>>> vals = sess.walk(vars)
>>> print vals[0:3]
('2', '3', '3')

the output output contains only returned values

How it's possible to get OIDs of this values?

I use Fedora 12 Linux.
versions of net-snmp libs\utils:
net-snmp-utils-5.4.2.1-19.fc12.i686
net-snmp-python-5.4.2.1-19.fc12.i686
net-snmp-5.4.2.1-19.fc12.i686
net-snmp-libs-5.4.2.1-19.fc12.i686

----
Alexey Kostyuk


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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.