Created
July 5, 2016 23:23
-
-
Save ktbyers/00d29a2483f6f0b839c1044c4b0b9b13 to your computer and use it in GitHub Desktop.
Netmiko example
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 | |
from netmiko import ConnectHandler | |
from getpass import getpass | |
ip_addr = raw_input("Enter IP Address: ") | |
device = { | |
'device_type': 'cisco_ios', | |
'ip': ip_addr, | |
'username': 'admin', | |
'password': getpass(), | |
'port': 22, | |
} | |
net_connect = ConnectHandler(**device) | |
output = net_connect.send_command_expect("show version") | |
print '#' * 50 | |
print output | |
print '#' * 50 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment