mirror of
https://github.com/MichaelCade/90DaysOfDevOps.git
synced 2025-01-07 14:00:34 +07:00
46 lines
970 B
Python
46 lines
970 B
Python
#!/usr/bin/env python
|
|
from netmiko import ConnectHandler
|
|
from getpass import getpass
|
|
|
|
#password = getpass()
|
|
|
|
R1 = {
|
|
"device_type": "cisco_ios",
|
|
"host": "192.168.169.115",
|
|
"username": "admin",
|
|
"password": "access123",
|
|
}
|
|
|
|
SW1 = {
|
|
"device_type": "cisco_ios",
|
|
"host": "192.168.169.178",
|
|
"username": "admin",
|
|
"password": "access123",
|
|
}
|
|
|
|
SW2 = {
|
|
"device_type": "cisco_ios",
|
|
"host": "192.168.169.193",
|
|
"username": "admin",
|
|
"password": "access123",
|
|
}
|
|
|
|
SW3 = {
|
|
"device_type": "cisco_ios",
|
|
"host": "192.168.169.125",
|
|
"username": "admin",
|
|
"password": "access123",
|
|
}
|
|
|
|
SW4 = {
|
|
"device_type": "cisco_ios",
|
|
"host": "192.168.169.197",
|
|
"username": "admin",
|
|
"password": "access123",
|
|
}
|
|
command = "show ip int brief"
|
|
for device in (R1, SW1, SW2, SW3, SW4):
|
|
net_connect = ConnectHandler(**device)
|
|
print(net_connect.find_prompt())
|
|
print(net_connect.send_command(command))
|
|
net_connect.disconnect() |