Difference between revisions of "VnStat"

From ArchWiki
Jump to navigation Jump to search
(use new package templates, see Help:Style)
Line 39: Line 39:
==See Also==
==See Also==
[http://wiki.gotux.net/config:vnstat VnStat Custom WebUI]
[http://wiki.gotux.net/config/vnstat VnStat Custom WebUI]

Revision as of 19:22, 14 March 2012

vnStat is a lightweight network traffic monitor. It keeps a network traffic log on selectable interfaces. Through the command line the network traffic statistics can be shown.


The vnStat package is available in [community]:

# pacman -S vnstat


Setting the interfaces

First introduce every interface that needs to be logged to vnStat. For example a wired interface:

# vnstat -u -i eth0

Or a wireless interface:

# vnstat -u -i wlan0

When introducing an interface for the first time there will be an error message saying 'unable to read database'. If this message is followed by an info message saying 'a new database has been created' the interface is successfully introduced. If this is not the case check that the specified interface is valid.

Updating method

After introducing the interface(s) set one of the update methods.

Warning: Only use one of the methods, do not use them both at the same time!


The first method is using Cron. A sample of Cron usage is provided with vnStat at /usr/share/doc/vnstat/examples/vnstat.cron.


The second way of updating is using a daemon provided by vnStat. Add vnstat to your daemons in rc.conf#Daemons.

DAEMONS=(... network vnstat ...)

Global settings

Other settings, like settings to control the daemon, can be done in /etc/vnstat.conf.


Query the network traffic:

# vnstat -q

Viewing live network traffic usage:

# vnstat -l

For all the other options, use:

# vnstat --help

Or for a complete list, use:

# vnstat --longhelp

See Also

VnStat Custom WebUI