Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import sys
- from device import Device
- import xmltodict
- switch = Device(ip='10.1.1.1',username='admin',password='PSWD')
- switch.open()
- show_command = switch.show('show mod ')
- # optionally convert to a dictionary
- show_version = xmltodict.parse(show_command[1])
- print show_command
- # push a config
- #push_config = switch.conf('config t ; interface eth1/1 ; no shut')
- # credentials are stored in device.py - can change there or use:
- #switch = Device(ip='10.48.50.137',username='admin',password='nexu7000')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement