找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 9052|回复: 4

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

[复制链接]
发表于 2013-12-9 00:27:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
1.jpg

2.jpg

3.jpg

4.jpg

以下是主ros运行的脚本:
  1. :do {
  2. :local cuccq "设置低于这个数字的CCQ数值"
  3. :local user "目的网桥的帐号"
  4. :local pass "目的网桥密码"
  5. :local mail "发送的QQ邮箱地址"
  6. #以下是目的网桥的IP地址
  7. :local ip152 "10.10.15.2"
  8. :local ip153 "10.10.15.3"
  9. :local ip132 "10.10.13.2"
  10. :local ip142 "10.10.14.2"
  11. /tool fetch address=$ip152 keep-result=yes user=$user password=$pass mode=ftp \
  12. src-path="15.2.txt" dst-path="15.2.txt" port=21
  13. /tool fetch address=$ip153 keep-result=yes user=$user password=$pass mode=ftp \
  14. src-path="15.3.txt" dst-path="15.3.txt" port=21
  15. /tool fetch address=$ip132 keep-result=yes user=$user password=$pass mode=ftp \
  16. src-path="13.2.txt" dst-path="13.2.txt" port=21
  17. /tool fetch address=$ip142 keep-result=yes user=$user password=$pass mode=ftp \
  18. src-path="14.2.txt" dst-path="14.2.txt" port=21
  19. :local con152 [/file get [/file find name="15.2.txt"] contents]
  20. :put $con152
  21. :local con153 [/file get [/file find name="15.3.txt"] contents]
  22. :put $con153
  23. :local con132 [/file get [/file find name="13.2.txt"] contents]
  24. :put $con132
  25. :local con142 [/file get [/file find name="14.2.txt"] contents]
  26. :put $con142
  27. :if ([:pick $con152 0 [:find $con152 "/"]]<=$cuccq || \
  28. [:pick $con152 ([:find $con152 "/"]+1) ([:find $con152 "/"]+4)]<=$cuccq) do={
  29. /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"
  30. }
  31. :if ([:pick $con153 0 [:find $con153 "/"]]<=$cuccq || \
  32. [:pick $con153 ([:find $con153 "/"]+1) ([:find $con153 "/"]+4)]<=$cuccq) do={
  33. /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"
  34. }
  35. :if ([:pick $con132 0 [:find $con132 "/"]]<=$cuccq || \
  36. [:pick $con132 ([:find $con132 "/"]+1) ([:find $con132 "/"]+4)]<=$cuccq) do={
  37. /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"
  38. }
  39. :if ([:pick $con142 0 [:find $con142 "/"]]<=$cuccq || \
  40. [:pick $con142 ([:find $con142 "/"]+1) ([:find $con142 "/"]+4)]<=$cuccq) do={
  41. /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"
  42. }}
  43. }
复制代码



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

  1. :do {
  2. :local filename "13.2.txt"
  3. :put $filename
  4. :local txccq [/interface wireless registration-table get \
  5. [/interface wireless registration-table find] tx-ccq]
  6. :local rxccq [/interface wireless registration-table get \
  7. [/interface wireless registration-table find] rx-ccq]
  8. :local ccq ($txccq."/".$rxccq)
  9. :put $ccq
  10. :local con [/file get [/file find name=$filename] contents]
  11. :put $con;
  12. :if ($con!=$ccq) do={/file set [find name=$filename] contents=$ccq}
  13. }
复制代码



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

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

routeros
发表于 2013-12-9 08:05:35 | 显示全部楼层
:):):):):):):):):):)
routeros
回复

使用道具 举报

发表于 2013-12-9 19:29:03 | 显示全部楼层
嘿嘿 有高手,顺便发了一下5X 6X可以用自动发网关到邮箱的。
routeros
回复

使用道具 举报

发表于 2015-6-30 16:49:13 | 显示全部楼层
能不能给小弟发一个当WAN口流量大于10M自动发邮件的脚本,网上找了好久只有一个试了2个没试出来,上面这个脚本我也看不太懂,不懂语言
routeros
回复

使用道具 举报

发表于 2015-7-9 22:57:43 | 显示全部楼层
        抱歉,您的 铜板 不足,无法下载
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-10 18:56 , Processed in 0.132623 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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