Use full path to rate and pass -b option to show the speeds in bits/s rather than byte/s in conformance with the traffic graph metric which is bits/s.

This commit is contained in:
Ermal 2010-05-13 19:32:49 +00:00
parent f83fa94292
commit ef021ff780

View File

@ -30,7 +30,7 @@ $intip = explode (".", $intip);
//use class A subnet to make sure we capture all traffic on specified interface
$intsubnet = $intip[0] . ".0.0.0/8";
exec("rate -i {$real_interface} -nlq 1 -Aa 10 -c {$intsubnet} | awk '{ printf \"%s:%s:%s:%s:%s\\n\", $1, $2, $5, $8, $11 }'", $listedIPs);
exec("/usr/local/bin/rate -i {$real_interface} -nlq 1 -Aba 20 -c {$intsubnet} | awk '{ printf \"%s:%s:%s:%s:%s\\n\", $1, $2, $5, $8, $11 }'", $listedIPs);
unset($bandwidthinfo);
unset($receivebytesarray);