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:

[u...@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® 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to