How get OIDs from returned values in python net-snmp
standa dolinek <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello, It is true that I can get OID from response, but I cant find there attached index values.(When you are browsing table with SNMPWALK) - I use this code: import netsnmp OID = ".1.3.6.1.2.1.2.2.1.6" Var = netsnmp.Varbind(OID) Vars = netsnmp.VarList(Var) sess = netsnmp.Session(Version = 2, DestHost='10.0.0.1', Community='public') sess.UseLongNames = 1 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' But in response from command line snmpwalk are included index values too: IF-MIB::ifPhysAddress.1 = STRING: c8:2:5:d4:0:0 IF-MIB::ifPhysAddress.2 = STRING: c8:2:5:d4:0:1 IF-MIB::ifPhysAddress.3 = STRING: Is there a way how to get the index values too? Workaroud is call snmpwalk as subprocess and then parse output... but that isnt great way. I use bindings with net-snmp version 5.7.1 Thanks for response ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ 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