Wie man auf die RouterOS-API in Python mit der 'routeros'-Bibliothek zugreift (minimales Beispiel)
English
Deutsch
Dieses Beispiel verwendet die routeros-Bibliothek von PyPI (GitHub), um auf die MikroTik-API zuzugreifen und die System-Identität zu extrahieren.
routeros_minimal_example.py
#!/usr/bin/env python3
from routeros import login
routeros = login('admin', 'abc123abc', '192.168.88.1')
output = routeros('/system/identity/print')
# Extract the one identity string from the list of dictionaries
print(output[0]['name'])If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow