安装:
1 |
# yum install vnsta |
如果没有为网卡生成数据库,会提示你建立:
1 2 3 4 5 6 7 8 9 10 11 |
# 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: eth0 lo |
生成相应网卡的数据库:
1 2 3 4 5 |
# 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". |
等十分钟后可用vnstat命令查询流量统计