daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. hostname IF-MIB::ifDescr.1 = GigabitEthernet0/0/0<br/>
  2. hostname IF-MIB::ifAlias.1 = --> InterfaceDesc<br/>
  3. hostname IF-MIB::ifOperStatus.1 = 'up'<br/>
  4. hostname IF-MIB::ifDescr.2 = GigabitEthernet0/0/1<br/>
  5. hostname IF-MIB::ifAlias.2 = --> InterfaceDesc<br/>
  6. hostname IF-MIB::ifOperStatus.2 = 'up'<br/>
  7. hostname IF-MIB::ifDescr.3 = GigabitEthernet0/0/2<br/>
  8. hostname IF-MIB::ifAlias.3 = --> InterfaceDesc<br/>
  9. hostname IF-MIB::ifOperStatus.3 = 'up'<br/>
  10.    
  11. hostname        interface              interface desc       status
  12. hostname        GigabitEthernet0/0/0   InterfaceDesc        up
  13. hostname        GigabitEthernet0/0/1   InterfaceDesc        up
  14. hostname        GigabitEthernet0/0/2   InterfaceDesc        up
  15.    
  16. for errorIndication, errorStatus, errorIndex, varBinds in snmp_iter:
  17.             # Check for errors and print out results
  18.             if errorIndication:
  19.                 print(errorIndication)
  20.             elif errorStatus:
  21.                 print('%s at %s' % (errorStatus.prettyPrint(),
  22.                                 errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
  23.             else:
  24.                 for varBind in varBinds:
  25.                     print(hostip),
  26.                     print(' = '.join([x.prettyPrint() for x in varBind]))
RAW Paste Data
Top