huigezi' 发表于 2013-12-9 00:27:27

ROS检测各CPE的CCQ 并发送邮件提醒脚本









以下是主ROS运行的脚本:
:do {
:local cuccq "设置低于这个数字的CCQ数值"
:local user "目的网桥的帐号"
:local pass "目的网桥密码"
:local mail "发送的QQ邮箱地址"
#以下是目的网桥的IP地址
:local ip152 "10.10.15.2"
:local ip153 "10.10.15.3"
:local ip132 "10.10.13.2"
:local ip142 "10.10.14.2"
/tool fetch address=$ip152 keep-result=yes user=$user password=$pass mode=ftp \
src-path="15.2.txt" dst-path="15.2.txt" port=21
/tool fetch address=$ip153 keep-result=yes user=$user password=$pass mode=ftp \
src-path="15.3.txt" dst-path="15.3.txt" port=21
/tool fetch address=$ip132 keep-result=yes user=$user password=$pass mode=ftp \
src-path="13.2.txt" dst-path="13.2.txt" port=21
/tool fetch address=$ip142 keep-result=yes user=$user password=$pass mode=ftp \
src-path="14.2.txt" dst-path="14.2.txt" port=21
:local con152 contents]
:put $con152
:local con153 contents]
:put $con153
:local con132 contents]
:put $con132
:local con142 contents]
:put $con142
:if ([:pick $con152 0 [:find $con152 "/"]]<=$cuccq || \
[:pick $con152 ([:find $con152 "/"]+1) ([:find $con152 "/"]+4)]<=$cuccq) do={
/tool e-mail send to=$mail subject=("15.2"."\B5\C4CCQ\B9\FD\B5\CD\C7\EB\B2\E9\BF\B4") file="15.2.txt"
}
:if ([:pick $con153 0 [:find $con153 "/"]]<=$cuccq || \
[:pick $con153 ([:find $con153 "/"]+1) ([:find $con153 "/"]+4)]<=$cuccq) do={
/tool e-mail send to=$mail subject=("15.3"."\B5\C4CCQ\B9\FD\B5\CD\C7\EB\B2\E9\BF\B4") file="15.3.txt"
}
:if ([:pick $con132 0 [:find $con132 "/"]]<=$cuccq || \
[:pick $con132 ([:find $con132 "/"]+1) ([:find $con132 "/"]+4)]<=$cuccq) do={
/tool e-mail send to=$mail subject=("13.2"."\B5\C4CCQ\B9\FD\B5\CD\C7\EB\B2\E9\BF\B4") file="13.2.txt"
}
:if ([:pick $con142 0 [:find $con142 "/"]]<=$cuccq || \
[:pick $con142 ([:find $con142 "/"]+1) ([:find $con142 "/"]+4)]<=$cuccq) do={
/tool e-mail send to=$mail subject=("14.2"."\B5\C4CCQ\B9\FD\B5\CD\C7\EB\B2\E9\BF\B4") file="14.2.txt"
}}
}


以下是ROS 网桥运行的脚本:

:do {
:local filename "13.2.txt"
:put $filename
:local txccq [/interface wireless registration-table get \
tx-ccq]
:local rxccq [/interface wireless registration-table get \
rx-ccq]
:local ccq ($txccq."/".$rxccq)
:put $ccq
:local con contents]
:put $con;
:if ($con!=$ccq) do={/file set contents=$ccq}
}



没啥大的作用,只是我这个人比较懒 懒得去查看各网桥之间的参数
不掉线 不卡我是不会去看的

所以无聊搞个脚本来发送邮件提醒下 太低了我才登录看看

310785922 发表于 2013-12-9 08:05:35

:):):):):):):):):):):):):)

3533155 发表于 2013-12-9 19:29:03

嘿嘿 有高手,顺便发了一下5X 6X可以用自动发网关到邮箱的。

luwei370 发表于 2015-6-30 16:49:13

能不能给小弟发一个当WAN口流量大于10M自动发邮件的脚本,网上找了好久只有一个试了2个没试出来,上面这个脚本我也看不太懂,不懂语言:')

setuup 发表于 2015-7-9 22:57:43

        抱歉,您的 铜板 不足,无法下载
页: [1]
查看完整版本: ROS检测各CPE的CCQ 并发送邮件提醒脚本