Skip to content

Instantly share code, notes, and snippets.

@ktbyers
Created July 5, 2016 23:23
Show Gist options
  • Save ktbyers/00d29a2483f6f0b839c1044c4b0b9b13 to your computer and use it in GitHub Desktop.
Save ktbyers/00d29a2483f6f0b839c1044c4b0b9b13 to your computer and use it in GitHub Desktop.
Netmiko example
#!/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
print '#' * 50
print output
print '#' * 50
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment