Error: Unable to open database directory "/var/lib/vnstat": No such file or directory The vnStat daemon should have created this directory when started. Check that it is is configured and running. See also "man vnstatd".
所以,要你自己来创建。创建后,不带参数执行会报错(不是“抱错”)。如下:
1 2 3 4 5 6 7
#./vnstat No database found, nothing to do. Use --help for help. A new database can be created with the following command: ./vnstat --create -i eth0 Replace 'eth0' with the interface that should be monitored. The following interfaces are currently available: lo eth0 (100 Mbit)
上面的信息提示了要用–create来创建某个网卡的数据库,好,创建:
1 2 3 4
# ./vnstat --create -i eth0 Creating database for interface "eth0"... Info: -A new database has been created. Restart the vnStat daemon if it is currently running in order to start monitoring "eth0".