Skip to content

vergoh/vnstat-snap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vnStat in a snap

vnStat is a network traffic monitor that uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources regardless of network traffic rate.

By default, traffic statistics are stored on a five minute level for the last 48 hours, on a hourly level for the last 4 days, on a daily level for the last 2 full months and on a yearly level forever. The data retention durations are fully user configurable. Total seen traffic and a top days listing is also provided.

See the official webpage or the GitHub repository for additional details and output examples. An example of the included image output is also available.

How to install

Using release channel:

sudo snap install vnstat

Or alternatively using development channel:

sudo snap install vnstat --edge

vnStat will automatically start monitoring all available interfaces once installed. Statistics can be viewed using the vnstat command (sudo not required) after around 5 minutes.

For more install options, see https://snapcraft.io/vnstat. For more details about channels and versions, see the "Channels and versions" section below.

Configurability

Snap doesn't support using a configuration file in /etc or in the home directory due to sandbox restrictions. Instead, Snap provides a configuration interface via the snap command directly. For vnStat, the commands are:

  • sudo snap get vnstat - list all configuration options and values
  • sudo snap set vnstat key=value - set configuration option key with value value
  • sudo snap unset vnstat key - restore default value of option key

All the configuration options in Snap mirror the same names as in the vnStat configuration file but in full lower case. From vnStat's perspective, the active configuration can be queried with vnstat --showconfig. A restart of the daemon (sudo snap restart vnstat) is needed after changing daemon related configuration options. See the vnstat.conf man page for longer descriptions of each option.

Known limitations

Channels and versions

vnStat is published on two snap channels:

  • latest/stable - tracks the latest vnStat release
    • snap defaults to using this channel when none is specified
    • the version string consists of two - separated fields:
      1. vnStat release version
      2. commit identifier for current repository
  • latest/edge - tracks the latest all tests passing commit in the vnStat GitHub repository
    • can be selected using the --edge parameter
    • the version string consists of four - separated fields:
      1. vnStat release version
      2. number of commits after the above version
      3. commit identifier of the latest change
      4. commit identifier for current repository

In addition, with snap list command, a revision is visible. This revision is a unique incremental identifier for the build being used. It will be incremented for any vnstat snap builds regardless of channel or architecture.