Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. 34 # Try SNMP first
  2. 35 if self.has_snmp():
  3. 36 try:
  4. 37 for v in self.snmp.get_tables(
  5. 38 ["1.2.840.10006.300.43.1.1.1.1.6",
  6. 39 "1.2.840.10006.300.43.1.1.2.1.1",
  7. 40 "1.2.840.10006.300.43.1.1.1.1.5"], bulk=True):
  8. 41 ==> port = 'Po' + v[1]
  9. 42 s = self.hex_to_bin(v[2])
  10. 43 members = []
  11. 44 for i in range(len(s)):
  12. 45 if s[i] == '1':
  13. 46 oid = "1.3.6.1.2.1.31.1.1.1.1." + str(i + 1)
  14. 47 iface = self.snmp.get(oid, cached=True) # IF-MIB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement