plugins icon indicating copy to clipboard operation
plugins copied to clipboard

net/vnstat: Handle multiple interfaces better

Open bensmithurst opened this issue 1 year ago • 0 comments

I tried using vnstat to report on multiple interfaces (to see how much traffic is going over a backup LTE connection I'm experimenting with) and it didn't really work. (update: some of this was due to user error)

  • ~~Selecting two interfaces was allowed but resulted in Interface foo+bar in vnstat.conf which appears to be a config directive only supporting one interface.~~ (this works fine, my problem was due to the point below)
  • vnstat was not configured to pick up new interfaces added after it was first installed.
  • ~~The stat in the UI only show the interface configured on the general tab, and as noted, configuring more than one there doesn't work.~~ (also not a problem)

Putting my user error aside, it does work mostly, but doesn't pick up new interfaces, and can't show interface stats individually.

To improve this I have:

  • ~~Restricted the interface option to one interface only, and renamed it to Default interface~~
  • ~~I've added a second 'Interfaces to display' option, which allows more than one to be selected~~
  • ~~The stats pages in the UI now show stats for all interfaces specified under 'Interfaces to display'~~
  • The vnstat config contains AlwaysAddNewInterfaces to make it notice new interfaces added.
  • Added a new config option to show stats separately, instead of a sum.

bensmithurst avatar Jan 04 '25 17:01 bensmithurst