Created
February 18, 2017 05:42
-
-
Save natenka/dcaf5427cd1cf4b523d9135a0af70d8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# https://github.com/ktbyers/netmiko/issues/322 | |
from netmiko import ConnectHandler | |
from getpass import getpass | |
ip_addr = input("Enter IP Address: ") | |
device = { | |
'device_type': 'cisco_ios', | |
'ip': ip_addr, | |
'username': 'testuser', | |
'use_keys': True, | |
'key_file': '/home/gituser/.ssh/test_rsa', | |
'port': 22, | |
} | |
net_connect = ConnectHandler(**device) | |
output = net_connect.send_command_expect("show version") | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment