vnStat - a network traffic monitor for Linux and BSD
C Makefile Shell Other
Clone or download
Permalink
Failed to load latest commit information.
cfg increase default data retention durations May 1, 2018
examples minor example file cleanup Feb 13, 2018
man increase default data retention durations May 1, 2018
src show sum of data instead of estimate in lists if end of time range ha… May 4, 2018
tests show sum of data instead of estimate in lists if end of time range ha… May 4, 2018
.gitignore fix potentially unassigned variable use, add check test result files … Apr 12, 2016
.travis.yml add mising no- prefix to parameters Mar 10, 2018
CHANGES update documentation May 1, 2018
COPYING update FSF address in license texts Feb 7, 2017
FAQ update http -> https May 1, 2018
INSTALL update install documentation Mar 15, 2018
INSTALL_BSD update install documentation Mar 15, 2018
Makefile.am extract printcfgfile() from cfg.c to separate file May 1, 2018
Makefile.in extract printcfgfile() from cfg.c to separate file May 1, 2018
README update http -> https May 1, 2018
README.md update http -> https May 1, 2018
UNINSTALL rewrite UNINSTALL Mar 15, 2018
UPGRADE update documentation May 1, 2018
aclocal.m4 refactor function file locations Dec 19, 2016
compile fix cross-compilation detection, resolves #53 Dec 27, 2016
config.guess fix cross-compilation detection, resolves #53 Dec 27, 2016
config.sub fix cross-compilation detection, resolves #53 Dec 27, 2016
configure bump beta version May 1, 2018
configure.ac bump beta version May 1, 2018
depcomp fix cross-compilation detection, resolves #53 Dec 27, 2016
install-sh fix cross-compilation detection, resolves #53 Dec 27, 2016
missing fix typo in version string, provide some setup information after runn… Dec 8, 2015
test-driver fix typo in version string, provide some setup information after runn… Dec 8, 2015

README.md

vnStat

vnStat is a console-based 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.

Traffic statistics are stored on a hourly level for the last 24 hours, on a daily level for the last 30 days and on a monthly level for the last 12 months. Total seen traffic and a top 10 days listing is also provided. Optional png image output is available in systems with the gd library installed.

See the official webpage https://humdi.net/vnstat/ for additional details and output examples.

Getting started

vnStat works best when installed. It's possible to either use the latest stable release or get the current development version from git.

Stable version

  1. wget https://humdi.net/vnstat/vnstat-latest.tar.gz
  2. optional steps for verifying the file signature
    1. wget https://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-*

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 version are included in the UPGRADE file.

Current development status

Unlike version 1.18, the current development version uses a sqlite database for storing data instead of a C structure dump in a file. This change enables having longer-duration statistics with user-configurable data retention durations. Yearly and five-minute resolution statistics are now included.

Overall status
  • beta version
    • possibly more beta than seen with recent 1.x releases
    • has been tested so far mainly in 24/7 running servers
  • vnstatd (daemon) has all features implemented
    • some sanity checks may be missing
  • vnstat (console output) has most features implemented
  • vnstati (image output) has all intended original features implemented
  • 5 minute resolution outputs available in both text and image formats
  • data migration verified to work automatically from 1.x version databases
  • test coverage is better than with 1.x releases
    • some unit conversion issues have been found and fixed
Done
  • vnstatd (daemon)
    • database creation and handling
    • support for multiple interfaces
    • dynamic data buffering, SaveInterval is honored
    • 5 minute, hourly, daily, monthly, yearly and total traffic recorded to database
    • legacy database files are read only during first startup for data import
      • write support is no longer included in code
      • legacy database files aren't removed after first time import to new database
    • full data import from vnStat 1.x database format including reconstructed yearly data
    • legacy database is not kept in memory for each interface during daemon runtime
    • new configuration options for data retention durations
      • features can be disabled
    • old data cleanup
      • executed during startup and then once every hour
    • logging and handling of possible database access errors
      • only fatal errors will cause the daemon to exit directly
  • most vnstat (console output) features
  • all vnstati (image output) features
  • pebibyte and exbibyte support
  • query of time range specific data
  • new MonthRotate configuration option handling
Removed features
  • text format database import
    • most likely better to do directly via sqlite cli or using some script language
  • merge of data from multiple interfaces
  • weekly ouput
  • kernel test
    • provided some use mostly with 2.0 and 2.2 kernels
  • --update / -u and several other database modifiers using vnstat command
  • --exportdb, use --oneline, --json or --xml instead
  • old style (default in versions up to 1.7) summary layout in image output
TODO
  • grep TODO src/* tests/*
  • feature configurability
    • is something still missing?
  • freeze database structure
    • plan ahead and figure out how to migrate data to new structure if necessary?
  • decide if output type parameters should be renamed
    • currently -h results in a graph style output when everything else gives a list
    • -h to output list and have -hg (or similar) for the hourly graph?
  • documentation
    • 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

Contacting the author

email: Teemu Toivola irc: Vergo (IRCNet) git: https://github.com/vergoh/vnstat

Bug reports, improvement ideas, feature requests and pull requests should be sent using the matching features on GitHub as those are harder to miss or forget.