SHARE
TWEET

Untitled

a guest Sep 11th, 2019 159 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top