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.
netmiko-mikrotik-routeros-minimal-example.py
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:
netmiko_example_output.txt
name: MySwitch01Check out similar posts by category:
MikroTik, Networking, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow