Netmiko MikroTik RouterOS minimal example
This example prints the identity (i.e. user-defined name) of the switch/router at IP address 10.0.0.1
with password abc123abc
.
from netmiko import ConnectHandler
mikrotik = {
'device_type': 'mikrotik_routeros',
'host': '10.0.0.1',
'username': 'admin',
'password': 'abc123abc'
}
mikrotik_connection = ConnectHandler(**mikrotik)
print(mikrotik_connection.send_command(f'/system/identity/print', cmd_verify=False))
Example output:
name: MySwitch01