interface_monitor
Monitor the link and optical status of a specified Ethernet interface on a MikroTik device, returning speed, duplex, auto-negotiation, and SFP module diagnostics when available.
Instructions
Link/optical status of one ethernet interface
(/interface/ethernet/monitor once=yes) - status (link-ok/
no-link), rate, full-duplex (coerced to bool | None - see
formatting.coerce_ros_bool), auto-negotiation (RouterOS's raw
value - a "done"/"incomplete"-style state, not a strict boolean, so
left as-is), plus SFP/DDM optics fields WHEN the port has an SFP
cage and a module is present: sfp-temperature,
sfp-supply-voltage, sfp-tx-power, sfp-rx-power,
sfp-tx-bias-current, sfp-vendor-name, sfp-vendor-part-number,
sfp-wavelength, sfp-module-present (also coerced to
bool | None).
A plain copper port (the vast majority) has NONE of the sfp-*
fields in RouterOS's reply at all - each is only added to the
result when the device's reply actually carries it (.get/in
checks throughout, nothing invented). The reference hardware this
project was verified against (a mANTBox) has no SFP cage, so the
command path itself is confirmed but the DDM field VALUES are not
yet verified against real SFP optics - see ROADMAP.md.
interface is validated for shape (validate_interface_name)
before it is ever sent to the device - existence isn't checked
separately, so a typo'd/unknown interface name simply produces
whatever error RouterOS itself returns. Returns an empty dict if
the device answers with nothing (same "once" convention as
interface_traffic/poe_status/lte_status).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| interface | Yes | ||
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||