安装
1
2
3
4
|
tar zxvf vnstat-1.11.tar.gz cd
vnstat-1.11 make && make install |
执行 vnstatd -d 即可启动服务
官网提供vnstatd的自启动脚本:
http://humdi.net/vnstat/init.d/redhat/vnstat,放到/etc/init.d目录下。
1
2
3
4
5
6
|
cd /etc/init.d chmod +x vnstat chkconfig --add vnstat chkconfig vnstat on service vnstat restart |
监控eth0的实时数据
1
|
vnstat -l
-i eth0 -ru |
监控示例