GitHub - vergoh/vnstat-snap: vnStat as a snap with image output (original) (raw)
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 theGitHub repository for additional details and output examples. An example of the included image output is alsoavailable.
How to install
Using release channel:
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 valuessudo snap set vnstat key=value
- set configuration optionkey
with valuevalue
sudo snap unset vnstat key
- restore default value of optionkey
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 thevnstat.conf man page for longer descriptions of each option.
Known limitations
vnstati
(image output) command is available asvnstat.image
vnstat.image
can't write files due to snap sandbox restriction- use
-o - >file.png
as a workaround
- use
sudo snap restart vnstat
is required after changing daemon related configuration options- man pages aren't available, use these these instead:
- more details regarding lack of man pages in snaps:
Channels and versions
vnStat is published on two snap channels:
latest/stable
- tracks the latest vnStat releasesnap
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
- can be selected using the
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.