Installation
Apt-get Install Vnstat
Configure to Auto-start
UPDATE-RC.D Vnstat Enable
Start
/etc/init.d/vnstat start
Vnstat Basic Use Commands
Vnstat-i eth0-l #实时流量情况
Vnstat-i eth0-h #按小时查询流量情况
Vnstat-i eth0-d #按天数查询流量情况
Vnstat-i eth0-m #按月数查询流量情况
Vnstat-i eth0-w #按周数查询流量情况
Vnstat-i eth0-t #查询TOP10流量情况
PHP Traffic page, the implementation of the principle is too simple, direct call command display to the Web page, it is also very good, not every command.
1<style>2H1{text-align:Center;/*AUTHOR:NINGCI Dev date:2017-04-27 22:21*/}3*{background-color:#color: #fff;}4PRE{MARGIN:10PX;PADDING:10PX;BORDER:1PX Solid#00f; color: #f6c608;}5</style>6 TimeNetwork Status!78<pre>9<?PHPTen Echo system("Vnstat-i eth0-d"); One?> A</pre> - -<pre> the<?PHP - Echo system("Vnstat-i eth0-h"); -?> -</pre> + - +<pre> A<?PHP at Echo system("Vnstat-i eth0-m"); -?> -</pre>
Simple to use, directly into Apache, and then access, the content displayed is also useful, daily, monthly, hourly usage.
Later, there is time to do landscaping, plus an email notification and other functions.
Vnstat traffic stats and comes with a small PHP page to view traffic