+tl;dr: ./configure --prefix=/usr --sysconfdir=/etc && make && make install
+
+
Prerequisites
:::::::::::::
- user with access to kernel interface statistics
- usually available by default but can be restricted for example
by grsecurity and similar security enhancement suites or settings
- - libgd (optional, image output)
- - check (optional, test suite)
- - autotools (optional, for recreating configure and makefiles)
+ - sqlite3 (library and development files)
+ - libgd (optional, image output)
+ - check (optional, test suite)
+ - pkg-config (optional, for check detection)
+ - autotools (optional, for recreating configure and makefiles)
Compiling the binaries
./configure --prefix=/usr --sysconfdir=/etc && make
- will compile 'vnstat' and 'vnstatd' without requiring additional libraries.
- The optional image output capable binary 'vnstati' will also be compiled if
- the required additional libgd2 library is found to be available. The name
- of the libgd2 package depends on the used distribution and its release. The
- development package for the library is also needed. Some common package
- names are
-
- gd
- gd-devel
- libgd3
- libgd-dev
- libgd2
- libgd2-dev
- libgd2-noxpm
- libgd2-noxpm-dev
+ will compile 'vnstat' and 'vnstatd'. The optional image output capable binary
+ 'vnstati' will also be compiled if the required additional libgd library is
+ found to be available.
An example cgi ('vnstat.cgi') to be used with a http server with the image
output support has been provided in the 'examples' directory. Configuration
take some minutes for the 'vnstat' command to begin showing results.
Monitoring of unwanted interfaces can be stopped with:
- vnstat --delete -i ethunwanted
+ vnstat --remove -i ethunwanted
Installing without root access
+tl;dr: ./configure && make && make install
+
+
Prerequisites
:::::::::::::
- C compiler
- user with access to kernel interface statistics
- usually available by default but may be restricted by security settings
- - graphics/gd (optional, image output)
- - devel/check (optional, test suite)
- - autotools (optional, for recreating configure and makefiles)
+ - databases/sqlite3
+ - graphics/gd (optional, image output)
+ - devel/check (optional, test suite)
+ - devel/pkg-config (optional, for check detection)
+ - devel/autotools (optional, for recreating configure and makefiles)
Compiling the binaries
will compile 'vnstat' and 'vnstatd' without requiring additional libraries.
The optional image output capable binary 'vnstati' will also be compiled if
- the required additional libgd2 library is found to be available. In
- BSD ports libgd2 is usually 'graphics/gd'.
+ the required additional libgd2 library is found to be available.
An example cgi ('vnstat.cgi') to be used with a http server with the image
output support has been provided in the 'examples' directory. Configuration
command to begin showing results. Monitoring of unwanted interfaces
can be stopped with:
- vnstat --delete -i ethunwanted
+ vnstat --remove -i ethunwanted
Installing without root access
stable release or get the current development version from git.
Stable version
- 1. ``wget http://humdi.net/vnstat/vnstat-latest.tar.gz``
+ 1. `wget http://humdi.net/vnstat/vnstat-latest.tar.gz`
2. optional steps for verifying the file signature
- 1. ``wget http://humdi.net/vnstat/vnstat-latest.tar.gz.asc``
- 2. ``gpg --keyserver pgp.mit.edu --recv-key 0xDAFE84E63D140114``
- 3. ``gpg --verify vnstat-latest.tar.gz.asc vnstat-latest.tar.gz``
+ 1. `wget http://humdi.net/vnstat/vnstat-latest.tar.gz.asc`
+ 2. `gpg --keyserver pgp.mit.edu --recv-key 0xDAFE84E63D140114`
+ 3. `gpg --verify vnstat-latest.tar.gz.asc vnstat-latest.tar.gz`
4. the signature is correct if the output shows "Good signature from Teemu Toivola"
- 3. ``tar zxvf vnstat-latest.tar.gz``
- 4. ``cd vnstat-*``
+ 3. `tar zxvf vnstat-latest.tar.gz`
+ 4. `cd vnstat-*`
-Development version (not recommended currently, documentation not up to date)
- 1. ``git clone https://github.com/vergoh/vnstat``
- 2. ``cd vnstat``
+Development version
+ 1. `git clone https://github.com/vergoh/vnstat`
+ 2. `cd vnstat`
In both cases, continue with instructions from the INSTALL or INSTALL_BSD file
depending on used operating system. Instructions for upgrading from a previous
* decide if some outputs should be removed
* `--exportdb` has now a different format which already breaks compatibility, `--json` and `--xml` still available
* documentation
- * needs to be updated to match 2.0 feature set and dependency requirements
* especially feature comparison with 1.x versions is needed as some features have been left out
* remember what else has been forgotten from this list
printf(" vnStat %s by Teemu Toivola <tst at iki dot fi>\n\n", getversion());
printf(" Query:\n");
- printf(" -q, --query query database\n");
+ printf(" -q, --query query database\n");
printf(" -5, --fiveminutes show 5 minutes\n");
printf(" -h, --hours show hours\n");
printf(" -hl, --hourslist show hours list\n");
- printf(" -d, --days show days\n");
- printf(" -m, --months show months\n");
- printf(" -y, --years show years\n");
- printf(" -t, --top show top days\n");
- printf(" -s, --short use short output\n");
+ printf(" -d, --days show days\n");
+ printf(" -m, --months show months\n");
+ printf(" -y, --years show years\n");
+ printf(" -t, --top show top days\n");
+ printf(" -s, --short use short output\n");
printf(" -ru, --rateunit swap configured rate unit\n");
printf(" --oneline show simple parseable format\n");
printf(" --exportdb dump database in text format\n");