Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from netmiko import Netmiko
- from getpass import getpass
- username = input("What is your username?")
- password = getpass()
- cisco1 = {
- "host": "MyRouter2",
- "username": username,
- "password": password,
- "device_type": "cisco_ios",
- }
- for device in (cisco1):
- net_connect = Netmiko(**device)
- command = "show version | i uptime"
- print(net_connect.find_prompt())
- output = net_connect.send_command(command)
- net_connect.disconnect()
- print(output)
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement