os-vnstat: Show statistics separately for multiple interfaces

Abierto
#5,960 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php
Área
frontend

Línea de trabajo

Read the os-vnstat plugin sources under src/opnsense/mvc/app/ first: the controller that assembles vnstat output, the Volt views behind the hourly/daily/monthly/yearly tabs, and the plugin's interface-selection settings. The payload shows the combined igc0+pppoe0+pppoe1 output, so check how vnstat is invoked with several -i arguments before splitting it per interface. Done means each statistics page offers a per-interface selector (plus an optional All view) while keeping the existing combined output available.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

When multiple interfaces are selected in os-vnstat, the statistics pages show a combined view. For example, selecting LAN (igc0), WAN1 (pppoe0) and WAN2 (pppoe1) displays igc0+pppoe0+pppoe1.

This makes it difficult to compare individual interface usage in the GUI, particularly for multi-WAN load balancing, failover and ISP usage monitoring. Combining LAN and WAN counters can also count the same traffic more than once as it passes through the firewall.

Describe the solution you'd like

Add an interface selector or tabs to the statistics pages so users can view hourly, daily, monthly and yearly statistics for each selected interface separately.

For example: LAN | WAN1 | WAN2 | All

The existing combined view could remain available as an optional All view.

Describe alternatives you've considered

I can view each interface separately from the command line using:

vnstat -i igc0 -h
vnstat -i pppoe0 -h
vnstat -i pppoe1 -h
root@onyx-fw:~ # vnstat --iflist
Available interfaces: igc0 (1000 Mbit) igc1 (1000 Mbit) igc2 (1000 Mbit) igc3 (10 Mbit) enc0 pflog0 pfsync0 pppoe0 pppoe1 zen0

root@onyx-fw:~ # vnstat -i igc0 -h

 igc0  /  hourly

         hour        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     11/22/26
         15:00     41.10 MiB |   56.89 MiB |   97.99 MiB |  228.33 kbit/s
         16:00      5.78 GiB |   10.07 GiB |   15.85 GiB |   37.83 Mbit/s
         17:00    227.31 MiB |  347.48 MiB |  574.79 MiB |    1.34 Mbit/s
         18:00    981.19 MiB |    1.46 GiB |    2.42 GiB |    5.78 Mbit/s
         19:00    431.93 MiB |  479.93 MiB |  911.86 MiB |    2.12 Mbit/s
         20:00      3.19 GiB |   57.09 GiB |   60.28 GiB |  143.83 Mbit/s
         21:00      1.60 GiB |   38.22 GiB |   39.83 GiB |   95.03 Mbit/s
         22:00    920.94 MiB |  966.56 MiB |    1.84 GiB |    4.40 Mbit/s
         23:00     28.18 MiB |  327.98 MiB |  356.16 MiB |  829.90 kbit/s
     11/23/26
         00:00     54.70 MiB |    1.47 GiB |    1.52 GiB |    3.62 Mbit/s
         01:00     34.51 MiB |  755.65 MiB |  790.16 MiB |    1.84 Mbit/s
         02:00     53.69 MiB |    1.22 GiB |    1.28 GiB |    3.05 Mbit/s
         03:00     35.24 MiB |  848.96 MiB |  884.19 MiB |    2.06 Mbit/s
         04:00    478.53 MiB |    1.01 GiB |    1.47 GiB |    3.52 Mbit/s
         05:00     45.41 MiB |   19.18 MiB |   64.59 MiB |  150.50 kbit/s
         06:00    239.06 MiB |  347.17 MiB |  586.24 MiB |    1.37 Mbit/s
         07:00     57.46 MiB |    1.72 GiB |    1.78 GiB |    4.25 Mbit/s
         08:00    531.24 MiB |    2.00 GiB |    2.52 GiB |    6.01 Mbit/s
         09:00     56.55 MiB |  930.04 MiB |  986.59 MiB |    2.30 Mbit/s
         10:00    154.98 MiB |    1.46 GiB |    1.61 GiB |    3.85 Mbit/s
         11:00     46.85 MiB |  999.51 MiB |    1.02 GiB |    2.44 Mbit/s
         12:00    499.99 MiB |    1.22 GiB |    1.71 GiB |    4.09 Mbit/s
         13:00     55.03 MiB |    1.39 GiB |    1.44 GiB |    3.43 Mbit/s
         14:00     68.89 MiB |    1.11 GiB |    1.18 GiB |    8.42 Mbit/s
     ------------------------+-------------+-------------+---------------
root@onyx-fw:~ # vnstat -i pppoe0 -h

 pppoe0  /  hourly

         hour        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     11/22/26
         15:00     41.51 MiB |   28.75 MiB |   70.26 MiB |  163.72 kbit/s
         16:00      7.24 GiB |    3.96 GiB |   11.19 GiB |   26.71 Mbit/s
         17:00    300.08 MiB |   63.43 MiB |  363.51 MiB |  847.03 kbit/s
         18:00      0.98 GiB |  946.83 MiB |    1.91 GiB |    4.55 Mbit/s
         19:00    470.60 MiB |  413.76 MiB |  884.36 MiB |    2.06 Mbit/s
         20:00      3.44 GiB |    1.05 GiB |    4.49 GiB |   10.71 Mbit/s
         21:00    352.87 MiB |   28.98 MiB |  381.85 MiB |  889.77 kbit/s
         22:00    159.02 MiB |   25.97 MiB |  184.99 MiB |  431.06 kbit/s
         23:00     21.59 MiB |   13.54 MiB |   35.13 MiB |   81.87 kbit/s
     11/23/26
         00:00    469.13 MiB |   24.05 MiB |  493.17 MiB |    1.15 Mbit/s
         01:00    330.08 MiB |   20.42 MiB |  350.50 MiB |  816.73 kbit/s
         02:00    618.41 MiB |   30.45 MiB |  648.86 MiB |    1.51 Mbit/s
         03:00    808.58 MiB |   22.64 MiB |  831.22 MiB |    1.94 Mbit/s
         04:00    554.62 MiB |   25.38 MiB |  580.01 MiB |    1.35 Mbit/s
         05:00     18.30 MiB |   36.43 MiB |   54.73 MiB |  127.54 kbit/s
         06:00     69.03 MiB |   14.26 MiB |   83.29 MiB |  194.09 kbit/s
         07:00     94.66 MiB |   25.82 MiB |  120.48 MiB |  280.74 kbit/s
         08:00     61.59 MiB |   23.35 MiB |   84.94 MiB |  197.92 kbit/s
         09:00     34.29 MiB |   21.50 MiB |   55.79 MiB |  129.99 kbit/s
         10:00     66.33 MiB |  122.26 MiB |  188.60 MiB |  439.46 kbit/s
         11:00     27.14 MiB |   16.83 MiB |   43.97 MiB |  102.46 kbit/s
         12:00     41.79 MiB |   19.78 MiB |   61.57 MiB |  143.47 kbit/s
         13:00     99.65 MiB |   34.62 MiB |  134.27 MiB |  312.88 kbit/s
         14:00     35.69 MiB |   37.65 MiB |   73.34 MiB |  512.68 kbit/s
     ------------------------+-------------+-------------+---------------
root@onyx-fw:~ # vnstat -i pppoe1 -h

 pppoe1  /  hourly

         hour        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     11/22/26
         15:00     17.27 MiB |    9.73 MiB |   27.00 MiB |   62.91 kbit/s
         16:00      2.88 GiB |    1.73 GiB |    4.61 GiB |   10.99 Mbit/s
         17:00     50.07 MiB |  160.05 MiB |  210.12 MiB |  489.61 kbit/s
         18:00    482.47 MiB |   20.58 MiB |  503.05 MiB |    1.17 Mbit/s
         19:00      9.47 MiB |   11.29 MiB |   20.77 MiB |   48.39 kbit/s
         20:00     54.93 GiB |    1.68 GiB |   56.61 GiB |  135.07 Mbit/s
         21:00     38.89 GiB |    1.28 GiB |   40.18 GiB |   95.86 Mbit/s
         22:00    805.75 MiB |  886.04 MiB |    1.65 GiB |    3.94 Mbit/s
         23:00    314.20 MiB |   19.49 MiB |  333.69 MiB |  777.55 kbit/s
     11/23/26
         00:00      1.01 GiB |   32.21 MiB |    1.04 GiB |    2.47 Mbit/s
         01:00    428.38 MiB |   15.84 MiB |  444.22 MiB |    1.04 Mbit/s
         02:00    630.36 MiB |   18.96 MiB |  649.33 MiB |    1.51 Mbit/s
         03:00     40.41 MiB |    9.65 MiB |   50.06 MiB |  116.64 kbit/s
         04:00    470.68 MiB |  443.68 MiB |  914.36 MiB |    2.13 Mbit/s
         05:00      7.22 MiB |    8.56 MiB |   15.79 MiB |   36.79 kbit/s
         06:00    280.10 MiB |  221.44 MiB |  501.54 MiB |    1.17 Mbit/s
         07:00      1.62 GiB |   27.15 MiB |    1.65 GiB |    3.93 Mbit/s
         08:00      1.93 GiB |  497.18 MiB |    2.41 GiB |    5.75 Mbit/s
         09:00    898.60 MiB |   36.47 MiB |  935.06 MiB |    2.18 Mbit/s
         10:00      1.39 GiB |   31.49 MiB |    1.42 GiB |    3.39 Mbit/s
         11:00    974.60 MiB |   31.79 MiB |    0.98 GiB |    2.35 Mbit/s
         12:00      1.18 GiB |  477.85 MiB |    1.65 GiB |    3.93 Mbit/s
         13:00      1.28 GiB |   24.91 MiB |    1.30 GiB |    3.11 Mbit/s
         14:00      1.07 GiB |   28.52 MiB |    1.09 GiB |    7.83 Mbit/s
     ------------------------+-------------+-------------+---------------

These commands return separate statistics, but require shell access. Selecting only one interface in the plugin is another workaround, but makes comparing multiple interfaces inconvenient.

Thank you for considering this enhancement.

Screenshot 2026-11-22 144241 Screenshot 2026-11-22 144432

Additional context

  • OPNsense: 26.7.x
  • os-vnstat: 1.4
  • Interfaces: LAN (igc0), WAN1 (pppoe0), WAN2 (pppoe1)

The vnStat commands above return separate statistics for all three interfaces, so the requested change appears to concern how the existing data is presented in the plugin GUI.

This replaces #5955, which was closed because it did not use an issue template. Screenshots and command output are available there.

Lenguaje dominante
PHP
Estrellas
1.2k
Forks
932
Merge medio
1 d 11 h
PR fusionados (30 d)
22

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de opnsense/plugins

Todos los issues de opnsense/plugins

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.