LinuxCommandLibrary

vnstatd

TLDR

Start the daemon

$ sudo systemctl start vnstat
copy
Enable at boot
$ sudo systemctl enable vnstat
copy
Run daemon in foreground
$ vnstatd -n
copy
Run with debug output
$ vnstatd -D
copy
Sync database and exit
$ vnstatd --sync
copy

SYNOPSIS

vnstatd [options]

DESCRIPTION

vnstatd is the daemon component of vnStat that collects network traffic statistics. It reads interface counters from the kernel at configured intervals and stores data in a persistent database.
The daemon tracks multiple interfaces simultaneously, recording 5-minute, hourly, daily, monthly, and yearly statistics. It automatically detects new interfaces added to the database without requiring restart.
Resource usage is minimal since vnstatd reads kernel counters rather than capturing packets. Data persists across reboots, making it suitable for long-term bandwidth monitoring.

PARAMETERS

-d, --daemon

Fork to background as daemon.
-n, --nodaemon
Stay in foreground.
-s, --sync
Sync cached data to database and exit.
-D, --debug
Enable debug output.
--config file
Use specified config file.
-p, --pidfile file
Use specified PID file.
--noadd
Don't add new interfaces automatically.
-v, --version
Display version.

CONFIGURATION

Config file: /etc/vnstat.conf
Key settings include monitored interfaces, database location, update interval, and data retention periods.

CAVEATS

Statistics begin from daemon start, not historically. Kernel counter resets (reboots, interface changes) may cause inaccuracies. Database corruption possible on unclean shutdown.

HISTORY

vnstatd is part of vnStat, created by Teemu Toivola for lightweight network traffic monitoring. The project began in 2002 and has become a standard tool for bandwidth monitoring on Linux servers and embedded systems.

SEE ALSO

vnstat(1), vnstati(1), iftop(8), nethogs(8)

Copied to clipboard