From 94ed100feab368468f48ebfb0c3f9b191f09005b Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Wed, 7 Oct 2026 12:29:26 -0500 Subject: [PATCH] Docs: document byte counters configuration and API endpoint Documents the optional [byte_counters] section, counter reset semantics, subtree-inclusive node totals, and the GET /byte_counters endpoint in English and Spanish. --- docs-es/v2.0/api-es.md | 3 +++ docs-es/v2.0/configuration-advanced-es.md | 17 +++++++++++++++++ docs/v2.0/api.md | 3 +++ docs/v2.0/configuration-advanced.md | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/docs-es/v2.0/api-es.md b/docs-es/v2.0/api-es.md index 9bb97dd7..65600d8c 100644 --- a/docs-es/v2.0/api-es.md +++ b/docs-es/v2.0/api-es.md @@ -121,9 +121,12 @@ Endpoints representativos: - `GET /search` - `GET /current_throughput` - `GET /queue_stats_total` +- `GET /byte_counters` - `GET /warnings` - `GET /urgent`, `GET /urgent/status` +`GET /byte_counters` devuelve contadores de bytes acumulados por nodo y por circuito cuando `[byte_counters] enabled = true` está configurado en `/etc/lqos.conf`. Los valores son acumulados desde que `lqosd` inició, incluyen el tráfico descendiente en los nodos y se reinician cuando `lqosd` se reinicia. Consulte [Configuración avanzada](configuration-advanced-es.md). + ### 5) Operaciones de control y reload Disparar acciones de control operativo cuando sea necesario. diff --git a/docs-es/v2.0/configuration-advanced-es.md b/docs-es/v2.0/configuration-advanced-es.md index 0df8da6a..88c44f46 100644 --- a/docs-es/v2.0/configuration-advanced-es.md +++ b/docs-es/v2.0/configuration-advanced-es.md @@ -62,6 +62,23 @@ netflow_version = 5 do_not_track_subnets = ["192.168.0.0/16"] ``` +### Contadores de bytes (opcional) + +LibreQoS puede mantener contadores de bytes acumulados por circuito y por nodo de red para la contabilidad de uso de datos, y exponerlos a través de `lqos_api`. La función está deshabilitada por defecto. Para habilitarla, agregue la siguiente sección a `/etc/lqos.conf` y reinicie `lqosd`: + +```toml +[byte_counters] +enabled = true +``` + +- Los contadores acumulan el tráfico medido por el rastreador de throughput de un segundo. +- Los valores son bytes realmente transmitidos, no bytes descartados por el shaping. +- Los valores son acumulados desde que `lqosd` inició y se reinician cuando `lqosd` se reinicia. +- Los valores de un nodo incluyen el tráfico de todos sus nodos descendientes. +- Solo se listan los circuitos con tráfico registrado. + +Con los contadores habilitados, `GET /byte_counters` en la API del nodo devuelve los valores actuales. Consulte [API del nodo LibreQoS](api-es.md). + ### Contabilidad RADIUS (opcional) LibreQoS acepta una sección opcional `[radius_accounting]` para definir clientes NAS de confianza. Cuando está habilitada, `lqosd` inicia un servicio de contabilidad RADIUS, verifica paquetes de los clientes configurados, envía paquetes Accounting-Response para solicitudes aceptadas y mantiene el estado de sesión decodificado en memoria. Cuando `radius_accounting.dynamic_circuit_application.enabled` y la opción global `dynamic_circuits.enabled` están habilitadas, las sesiones Start e Interim-Update aptas se envían a la ruta de circuitos dinámicos. diff --git a/docs/v2.0/api.md b/docs/v2.0/api.md index 3f564200..dfc33982 100644 --- a/docs/v2.0/api.md +++ b/docs/v2.0/api.md @@ -121,9 +121,12 @@ Representative endpoints: - `GET /search` - `GET /current_throughput` - `GET /queue_stats_total` +- `GET /byte_counters` - `GET /warnings` - `GET /urgent`, `GET /urgent/status` +`GET /byte_counters` returns cumulative per-node and per-circuit byte counters when `[byte_counters] enabled = true` is set in `/etc/lqos.conf`. Values are cumulative since `lqosd` started, include descendant traffic for nodes, and reset when `lqosd` restarts. See [Advanced Configuration](configuration-advanced.md). + ### 5) Control and Reload Operations Trigger operational control actions when needed. diff --git a/docs/v2.0/configuration-advanced.md b/docs/v2.0/configuration-advanced.md index 7672585e..2c075db4 100644 --- a/docs/v2.0/configuration-advanced.md +++ b/docs/v2.0/configuration-advanced.md @@ -64,6 +64,23 @@ netflow_version = 5 do_not_track_subnets = ["192.168.0.0/16"] ``` +#### Byte counters (optional) + +LibreQoS can keep cumulative byte counters per circuit and per network node for data-usage accounting, and expose them through `lqos_api`. The feature is disabled by default. To enable it, add the following section to `/etc/lqos.conf` and restart `lqosd`: + +```toml +[byte_counters] +enabled = true +``` + +- Counters accumulate the traffic measured by the one-second throughput tracker. +- Values are actual transmitted bytes, not bytes dropped by shaping. +- Values are cumulative since `lqosd` started and reset when `lqosd` restarts. +- Node values include traffic from all descendant nodes. +- Only circuits with recorded traffic are listed. + +With the counters enabled, `GET /byte_counters` on the Node API returns the current values. See [LibreQoS Node API](api.md). + #### On-a-stick mode queue mapping (single interface) When running on-a-stick mode, LibreQoS splits available TX queues in half: