interface_traffic
Read the current rx/tx traffic rate and packet rate of a single MikroTik interface in one instant snapshot, so you can quickly check live throughput without streaming.
Instructions
Current rx/tx traffic rate of one interface (/interface/monitor-traffic interface= once=yes).
interface is validated for shape (validate_interface_name) before
it is ever sent to the device - existence isn't checked separately
here (unlike the guarded write tools), so a typo'd/unknown interface
name simply produces whatever error RouterOS itself returns.
Returns a single reply dict - typically rx-bits-per-second/
tx-bits-per-second and rx-packets-per-second/tx-packets-per-second -
or an empty dict if the device returned nothing. once=yes makes
this a single instantaneous reading, not a continuous stream, so the
call always returns promptly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| interface | Yes | ||
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||