vnStat

async OPNsenseClient.get_vnstat_metrics(period)

Return parsed vnStat traffic rows for one supported reporting period.

Parameters:

period (str) – Requested vnStat period identifier. Supported values are hourly, daily, monthly, and yearly.

Returns:

Parsed vnStat payload containing the selected

period and an interfaces mapping of interface names to traffic rows. Returns an empty mapping for unsupported periods or when no interface rows are available.

Return type:

dict[str, Any]

async OPNsenseClient.get_vnstat()

Collect summarized vnStat usage data across available interfaces.

Returns:

Mapping with interfaces keyed by

interface name and interface_count. Each interface contains parsed hourly, daily, and monthly rows plus convenience byte counters for today, this month, yesterday, last month, and the last complete hour.

Return type:

MutableMapping[str, Any]