[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® 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-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
> When I try to get it via python using this code:
>>>> 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've no real experience with the Python interface,
but try looking at the 'vars' variable following the walk,
rather than 'vals'.
A brief look at the documentation (python/README)
includes the following:
snmpwalk(<Varbind/VarList>, <Session args>))
- .....
Returns a tuple of values retrieved from the MIB below
the Varbind passed in. ==> If a VarList is passed in it
will be updated to contain a complete set of VarBinds
created for the results of the walk. <==
Dave