Netmiko

This script can be used to apply different configuration to groups of switch types:

from netmiko import ConnectHandler

s1 = {
‘device_type’: ‘avaya_vsp’,
‘ip’: ‘192.168.1.1’,
‘username’: ‘rwa’,
‘password’: ‘rwa’,
}

with open(‘core_config.txt’) as f:
lines = f.read().splitlines()
print(lines)

all_devices = [s1]

for devices in all_devices:
net_connect = ConnectHandler(**devices)
print(net_connect.find_prompt())
net_connect.enable()
print(net_connect.find_prompt())
net_connect.config_mode()
net_connect.send_config_set(lines)
print(net_connect.find_prompt())

net_connect.disconnect()

https://github.com/ktbyers/netmiko

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s