Netmiko - sjherrick/code-base GitHub Wiki

Netmiko

Connect to Host

host = {
    'device_type': 'cisco_ios',
    'ip': ip,
    'username': username,
    'password': password
}
conn = ConnectHandler(**host)

Session Logger

import io
router = {
    'device_type': 'cisco_ios',
    'ip': ip,
    'username': username,
    'password': password,
    'port': port,
    'secret': secret,
    'timeout': 10,
    'session_log': io.BytesIO()
}
session_log = conn.session_log.getvalue().decode("utf-8")