Difference between revisions of "VnStat"
Kynikos.bot (talk | contribs) (remove language suffix from Category:Networking (English), see Talk:Table of Contents#English Category Names: Capitalization and Conflict with i18n) |
|||
(6 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Networking]] | [[Category:Networking]] | ||
+ | [[ru:vnStat]] | ||
{{lowercase title}} | {{lowercase title}} | ||
[http://humdi.net/vnstat/ 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. | [http://humdi.net/vnstat/ 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. | ||
− | ==Installation== | + | |
− | + | == Installation == | |
− | + | ||
− | ==Configuration== | + | [[pacman|Install]] {{Pkg|vnstat}} from the [[official repositories]]. |
− | ===Setting the interfaces=== | + | |
+ | == Configuration == | ||
+ | |||
+ | === Setting the interfaces === | ||
+ | |||
First introduce every interface that needs to be logged to vnStat. For example a wired interface: | First introduce every interface that needs to be logged to vnStat. For example a wired interface: | ||
# vnstat -u -i eth0 | # vnstat -u -i eth0 | ||
Line 14: | Line 19: | ||
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. | 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=== | + | === Updating method === |
+ | |||
After introducing the interface(s) set one of the update methods. | After introducing the interface(s) set one of the update methods. | ||
− | {{Warning| Only use one of the methods, do not use them | + | {{Warning| Only use one of the methods, do not use them at the same time!}} |
− | ====Cron==== | + | |
+ | ==== Cron ==== | ||
+ | |||
The first method is using [[Cron]]. A sample of Cron usage is provided with vnStat at {{ic|/usr/share/doc/vnstat/examples/vnstat.cron}}. | The first method is using [[Cron]]. A sample of Cron usage is provided with vnStat at {{ic|/usr/share/doc/vnstat/examples/vnstat.cron}}. | ||
− | |||
− | |||
− | |||
− | ===Global settings=== | + | ==== Service ==== |
+ | |||
+ | The second way is using [[systemd]] (and the provided service): | ||
+ | # systemctl start vnstat.service | ||
+ | |||
+ | === Global settings === | ||
+ | |||
Other settings, like settings to control the daemon, can be done in {{ic|/etc/vnstat.conf}}. | Other settings, like settings to control the daemon, can be done in {{ic|/etc/vnstat.conf}}. | ||
− | ==Usage== | + | == Usage == |
+ | |||
Query the network traffic: | Query the network traffic: | ||
# vnstat -q | # vnstat -q | ||
Line 38: | Line 50: | ||
# vnstat --longhelp | # vnstat --longhelp | ||
− | ==See Also== | + | == See Also == |
− | [http:// | + | [http://gotux.net/arch-linux/vnstat-network-monitor/ VnStat Custom WebUI] |
Revision as of 11:30, 13 July 2013
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.
Contents
Installation
Install vnstat from the official repositories.
Configuration
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.
Cron
The first method is using Cron. A sample of Cron usage is provided with vnStat at /usr/share/doc/vnstat/examples/vnstat.cron
.
Service
The second way is using systemd (and the provided service):
# systemctl start vnstat.service
Global settings
Other settings, like settings to control the daemon, can be done in /etc/vnstat.conf
.
Usage
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