Difference between revisions of "VnStat"

From ArchWiki
Jump to navigation Jump to search
(→‎Configuration: As of this writing, the daemon mark as an error adding an interface that was referred to in the configuration file)
Line 15: Line 15:
 
Pick a preferred network interface and edit the {{ic|Interface}} variable in the {{ic|/etc/vnstat.conf}} accordingly. To list all interfaces available to vnstat, use {{ic|vnstat --iflist}}.
 
Pick a preferred network interface and edit the {{ic|Interface}} variable in the {{ic|/etc/vnstat.conf}} accordingly. To list all interfaces available to vnstat, use {{ic|vnstat --iflist}}.
  
To start monitoring a particular interface you must initialize a database first. Each interface needs its own database. The command to initialize one for the {{ic|eth0}} interface is:
+
To start monitoring a particular interface that was not referred to in the configuration file when the daemon was started, you must initialize a database first. Each interface needs its own database. The command to initialize one for the {{ic|eth0}} interface is:
 
  # vnstat --add -i eth0
 
  # vnstat --add -i eth0
  

Revision as of 18:19, 8 March 2019

vnStat is a lightweight (command line) network traffic monitor. It monitors selectable interfaces and stores network traffic logs in a database for later analysis.

Installation

Install the vnstat package.

Configuration

Start/Enable the vnstat.service daemon.

Pick a preferred network interface and edit the Interface variable in the /etc/vnstat.conf accordingly. To list all interfaces available to vnstat, use vnstat --iflist.

To start monitoring a particular interface that was not referred to in the configuration file when the daemon was started, you must initialize a database first. Each interface needs its own database. The command to initialize one for the eth0 interface is:

# vnstat --add -i eth0

Remember to restart the vnstat.service daemon after you have added a new interface.

Usage

Query the network traffic:

# vnstat -q

Viewing live network traffic usage:

# vnstat -l

To find more options, use:

# vnstat --help

or to see all options use:

# vnstat --longhelp