Page 1 of 1
Netwatch to disable a static route
Posted: Tue Jul 15, 2008 7:49 am
by pacmanfan
Hi,
I need a script that will use netwatch to check the status of a gateway every 30 seconds, and disable a static route if the gateway is unreachable. Every 30 seconds it should check again, and re-enable the route if the gateway is reachable again. This is for connection failover from cable to DSL. I'll be glad to pay for a script like this if it hasn't been done before. Any help is appreciated!
Thanks!
Re: Netwatch to disable a static route
Posted: Tue Jul 15, 2008 8:10 am
by mrz
It's easy. Add scheduler tp run every 30 seconds and add script similar to this one
:if ([/ping xx.xx.xx.xx count=3] = 3) do={
<enable gateway here>
} else={
<disable gateway here>
}
Re: Netwatch to disable a static route
Posted: Tue Jul 15, 2008 8:33 am
by ashish
Hi MRZ,
I need script for following event.
if received byte per second=1 Mbps of ether1, than the router shoud send mesage to customer.
I know the How to send sms but confused to write script.
Re: Netwatch to disable a static route
Posted: Tue Jul 15, 2008 9:25 am
by mrz
/interface monitor-traffic ether1 once do={
:if ($"received-bits-per-second" = 1000000) do={
< send sms>
}
}
f received byte per second=1 Mbps of ether1
So you need mega BITS or BYTES? If bytes then you will also have to convert received-bits-per-second to bytes nad then compare
Re: Netwatch to disable a static route
Posted: Sat Jul 26, 2008 1:56 pm
by dragan
It's easy. Add scheduler tp run every 30 seconds and add script similar to this one
:if ([/ping xx.xx.xx.xx count=3] = 3) do={
<enable gateway here>
} else={
<disable gateway here>
}
if possible can anyone show me step by step with photos because its very difficult for me to achive that but i dont want ping gateway to control the link example ping http://www.google.com(74.125.39.104) Every 30 seconds it should check again , and re-enable the route if the second gateway if the http://www.google.com(74.125.39.104) isreachable again
Re: Netwatch to disable a static route
Posted: Tue Feb 23, 2021 9:17 am
by kcavery001
/interface monitor-traffic ether1 once do={
:if ($"received-bits-per-second" = 1000000) do={
< send sms>
}
}
f received byte per second=1 Mbps of ether1
So you need mega BITS or BYTES? If bytes then you will also have to convert received-bits-per-second to bytes nad then compare
Sir what if ISP has high ping and/or slow internet connection and not totally down. how to send also notification via sms sir?