← 返回命令列表

Linux command

vnstatd 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Start the daemon

sudo systemctl start vnstat

Enable at boot

sudo systemctl enable vnstat

Run daemon in foreground

vnstatd -n

Run with debug output

vnstatd -D

Sync database and exit

vnstatd --sync

说明

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.

参数

-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.

FAQ

What is the vnstatd command used for?

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.

How do I run a basic vnstatd example?

Run `sudo systemctl start vnstat` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --daemon do in vnstatd?

Fork to background as daemon.