Guest User

Untitled

a guest
Dec 27th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from ncclient import manager
  4.  
  5. if __name__ == '__main__':
  6.  
  7. with manager.connect(host='nxosv', port=22, username='cisco', password='cisco',
  8. hostkey_verify=False, device_params={'name': 'nexus'},
  9. allow_agent=False, look_for_keys=False) as device:
  10.  
  11. commands = ['config t', 'interface Ethernet2/6', 'switchport', 'description Configured by Python ncclient']
  12. nc_config_reply = device.exec_command(commands)
  13. print nc_config_reply.xml
Add Comment
Please, Sign In to add comment