风一样的男孩 发表于 2013-6-17 09:51:12

ROS统计PPPOE用户在线数量脚本

#最大循环次数
:global rmaxlimit 10080
:global r 0
:global rn
:global rs
:global ravg
:global rmax
:if ([:len $ravg] = 0) do={
:set ravg 0
:global rn 0
:global rs 0
:global rmax 0}
:if ($rs = $rmaxlimit) do={
:global rn $ravg
:global rs 1}
:foreach b in= do={:set r ($r+1)}
:if ($rmax < $r) do={:set rmax $r}
:set rs ($rs+1)
:set rn ($rn+$r)
:global ravg ($rn / $rs)
:log warning ("当前在线" . $r . "人,最高在线" . $rmax . "人,平均在线" . $ravg . "人,第" . $rs . "次统计.")
页: [1]
查看完整版本: ROS统计PPPOE用户在线数量脚本