CentOS安装vnstat监控流量并配置vnstat PHP frontend
分类:linux日期:2013-05-31 - 10:06:13作者:老谢
wget https://acelnmp.googlecode.com/files/vnstat-1.10.tar.gz tar xvzf vnstat-1.10.tar.gz cd vnstat-1.10/ make && make install /usr/bin/vnstat -u -i eth0 vim /etc/cron.d/vnstat 0-55/5 * * * * root vnstat -u -i eth0 0-55/5 * * * * root vnstat --dumpdb -i eth0 >/var/lib/vnstat/vnstat_dump_eth0 wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz tar -zxf vnstat_php_frontend-1.5.1.tar.gz mv vnstat_php_frontend-1.5.1.tar.gz vnstat |
把vnstat放到网站根目录下,然后就可以通过你的域名/vnstat进行访问
编辑vnstat/config.php
error_reporting(E_ALL | E_NOTICE); $locale = 'en_US.UTF-8'; $language = 'en'; $iface_list = array('venet0'); $iface_title['venet0'] = 'Internal'; //$iface_title['sixxs'] = 'SixXS IPv6'; $vnstat_bin = '/usr/bin/vnstat'; $data_dir = '/var/lib/vnstat/'; $graph_format='png'; define('GRAPH_FONT',dirname(__FILE__).'/VeraBd.ttf'); define('SVG_FONT', 'Verdana'); define('DEFAULT_COLORSCHEME', 'light'); |
好了么?