Advertisement
Guest User

Untitled

a guest
Apr 15th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import sys
  5.  
  6. from device import Device
  7. import  xmltodict
  8.  
  9. switch = Device(ip='10.1.1.1',username='admin',password='PSWD')
  10. switch.open()
  11. show_command = switch.show('show mod ')
  12.  
  13. # optionally convert to a dictionary
  14. show_version = xmltodict.parse(show_command[1])
  15. print show_command
  16. # push a config
  17.  
  18. #push_config = switch.conf('config t ; interface eth1/1 ; no shut')
  19.  
  20. # credentials are stored in device.py - can change there or use:
  21. #switch = Device(ip='10.48.50.137',username='admin',password='nexu7000')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement