ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 11151|回复: 2

[交流] ROS软路由 端口的流量值赋值给变量

[复制链接]
发表于 2010-11-19 02:09:58 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
如何将外网端口的流量值赋值给一个变量
local a
不知道脚本的格式是怎么样,没有系统学习过ROS软路由,在这里请大家指教!
发表于 2010-11-21 17:34:45 | 显示全部楼层
只能路过了
发表于 2010-11-22 06:17:58 | 显示全部楼层
/system script add name="record" source={
  :global tmp
  :global tx
  :global rx
  :foreach i in [/inte**ce find] do={
    /inte**ce monitor-traffic $i once do={
      :set tx ($sent-bits-per-second/1048576)
      :set rx ($received-bits-per-second/1048576)
      :if ([/system scheduler get record run-count]=1) do={
        :global ttx
        :set ttx $tx
        :global trx
        :set trx $rx
        }
      :if ($tx>$ttx) do={
        /tool e-mail send
          to=example@example.com
          subject="Script message"
          body=("The transmission traffic on " .
          [/inte**ce get $i name] . " got up to " . $tx . "Mbps")
        :set ttx $tx
        }
      :if ($rx>$trx) do={
        /tool e-mail send
          to=example@example.com
          subject="Script message"
          body=("The receiving traffic on " .
          [/inte**ce get $i name] . " got up to " . $rx . "Mbps")
        :set trx $rx
        }
      }
    }
  }

注意:
:set tx ($sent-bits-per-second/1048576)
  :set rx ($received-bits-per-second/1048576)
可以告诉我这两句赋值给TX和RX,($sent-bits-per-second/1048576)括号里面是什么?流量?这两句放在Schedule运行时出错
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2024-5-6 19:37 , Processed in 0.112032 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表