Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. from netmiko import Netmiko
  2. from getpass import getpass
  3.  
  4.  
  5. username = input("What is your username?")
  6. password = getpass()
  7.  
  8.  
  9. cisco1 = {
  10. "host": "MyRouter2",
  11. "username": username,
  12. "password": password,
  13. "device_type": "cisco_ios",
  14. }
  15.  
  16. for device in (cisco1):
  17. net_connect = Netmiko(**device)
  18. command = "show version | i uptime"
  19. print(net_connect.find_prompt())
  20. output = net_connect.send_command(command)
  21. net_connect.disconnect()
  22. print(output)
  23. print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement