opnsense_get_interface_statistics
Retrieve cumulative packet, byte, error, and collision counters per interface. Use rising error counts to identify duplex mismatches or bad cables.
Instructions
Get packet, byte, error and collision counters per interface.
These are cumulative counters since boot, not rates. To measure throughput, call twice and take the difference over the elapsed time. Rising error or collision counts on a physical NIC usually mean a duplex mismatch or a bad cable.
Args: params (InterfaceStatisticsInput): Validated input containing: - device (str): Device name to filter to, e.g. "igb0" (default: "" = all) - response_format (ResponseFormat): 'markdown' or 'json'
Returns: str: Markdown table, or JSON mapping device name to a counter object: {"": {"packets in": int, "packets out": int, "bytes in": int, "bytes out": int, "errors in": int, "errors out": int, "collisions": int, ...}}
Examples: - Use when: "Is the WAN dropping packets?" -> device="pppoe0" - Don't use when: You want live per-connection traffic (use opnsense_query_firewall_states)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |