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

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 11384|回复: 6

[交流] RouteROS软路由监控脚本,断线报警,线路恢复自动解除报警

[复制链接]
发表于 2007-7-8 10:40:05 | 显示全部楼层 |阅读模式

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

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

x
RouteROS软路由监控脚本,断线报警,线路恢复自动解除报警:
在/system script里添加脚本
name=你要监控的ip
内容如下
:set i 0
:while ($i=0) do={:beep length=2s frequency=2755;:delay 5;:set a abc;
:foreach i in=[/tool netwatch find host=你要监控的ip]
do={:set a [/tool netwatch get $i status]};:put $a;:if($a=up) do={:set i 1}}

然后再在/tool netwatch里添加监控
host=你要监控的ip
在down里填写
/system script run 你要监控的ip
:set shendown1 [/system clock get date]
:set shendown2 [/system clock get time]
:set shendown ("你要监控的ip down " . $shendown1 . " " . $shendown2)
:log warning $shendown
ROS软路由小包策略:
/ ip firewall mangle
add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440 comment="" disabled=no
add chain=forwar* *2*=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yes comment="" disabled=no
add chain=forward connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=yes comment="" disabled=no
add chain=forward connection-mark=!p2p_conn action=mark-packet new-packet-mark=general passthrough=yes comment="" disabled=no
add chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small passthrough=yes comment="" disabled=no
add chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big passthrough=yes comment="" disabled=no
/ queue tree
add name="p2p1" parent=wan packet-mark=p2p limit-at=600000 queue=default priority=8 max-limit=800000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="p2p2" parent=lan packet-mark=p2p limit-at=800000 queue=default priority=8 max-limit=600000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="ClassA" parent=lan packet-mark="" limit-at=0 queue=default priority=8 max-limit=100000000 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="ClassB" parent=ClassA packet-mark="" limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="Leaf1" parent=ClassA packet-mark=general limit-at=0 queue=default priority=7 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="Leaf2" parent=ClassB packet-mark=small limit-at=0 queue=default priority=5 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
add name="Leaf3" parent=ClassB packet-mark=big limit-at=0 queue=default priority=6 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
发表于 2007-7-10 03:06:56 | 显示全部楼层
路过
发表于 2007-7-13 00:31:38 | 显示全部楼层
脚本越来越牛了 感谢
发表于 2007-7-13 15:02:17 | 显示全部楼层
支持一下,开始那个脚本我看不懂,还要加强学习
发表于 2007-7-13 17:51:32 | 显示全部楼层
可用于3.X的ADSL断线报警(改自2.9.x版本)
:global pppzt
/interface pppoe-client monitor pppoe-out1 once do={

:if ($status != "connected") do={
  :beep length=2s frequency=1000;:delay 3
  :beep length=2s frequency=1000;:delay 3
  :beep length=2s frequency=1000;:delay 3
  :log info "〖ADSL 断线〗"
   }
}

计划任务间隔时间最好是在10秒
发表于 2007-7-14 15:34:18 | 显示全部楼层
看下,学习下,谢谢
发表于 2007-7-15 23:34:46 | 显示全部楼层
支持楼主  辛苦了  谢谢
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

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

GMT+8, 2025-6-17 02:44 , Processed in 2.245088 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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