Telemetry

async OPNsenseClient.get_telemetry()

Return consolidated system telemetry from OPNsense.

Returns:

Mapping containing mbuf,

pfstate, memory, system, cpu, filesystems, and temps sections populated from the corresponding diagnostics endpoints. A missing inventory endpoint (404) supplies an empty list for filesystems or an empty mapping for temps. With throw_errors=False, a denied or failed inventory read, undecodable body, or incorrect inventory container sets only its section to None. Strict mode propagates request and decoding errors and preserves the existing handling of decoded bodies.

Return type:

MutableMapping[str, Any]

async OPNsenseClient.get_interfaces()

Return normalized interface status and counters.

Returns:

Mapping keyed by OPNsense interface

identifier. Each interface includes packet and byte counters, error counters, status, addresses, media, gateway and route metadata, MAC address, enabled flag, and VLAN tag when available. HTTP 404 returns an empty mapping. Forbidden reads, transient failures, and undecodable responses return None when throw_errors is disabled and raise when enabled. A decoded body with the wrong shape returns None when throw_errors is disabled and an empty mapping when enabled.

Return type:

MutableMapping[str, Any] | None

async OPNsenseClient.get_gateways()

Return OPNsense gateway status details.

Returns:

Mapping keyed by gateway name, with each

gateway row preserved from OPNsense and status normalized from the translated status when available. HTTP 404 returns an empty mapping. Other request or decoding failures return None when throw_errors is off and raise an OPNsenseError when it is on. With throw_errors off, a decoded response with a missing or invalid items list or a failed backend status also returns None.

Return type:

MutableMapping[str, Any] | None