Community discussions

MikroTik App
 
Byron
just joined
Topic Author
Posts: 20
Joined: Sun Jan 09, 2022 6:46 pm

Wireless rain fade failover script

Sun Jan 09, 2022 6:49 pm

Hi there

Im fairly new to Mikrotik. Long story short.... I need a way to monitor a wireless link's signal (If possible) and once it hits a threshold to run a script.

Any idea on how I can do this if I can do it.

Thanks
 
Rugx
Member Candidate
Member Candidate
Posts: 123
Joined: Thu Jan 02, 2020 1:44 pm

Re: Wireless rain fade failover script

Tue Jan 11, 2022 10:28 am

Yeah, it can be done. You should look within the wireless registration-tables signal strength, as you can "get" that variable and work with it.
{
:local "ss";
:set $ss [/interface wireless registration-table get 0 signal-strength];
:set $ss [:pick $ss 0 [:find $ss "dBm"]];
:put $ss;
}
This is if there is only 1 entry and you don't have to choose between multiple clients within the registration table, if there are multiple entries, some additional shenanigans will be required to choose the specific client.
Once you've got it as a number, you can create a loop with "while+if" statements to execute a script if a given "threshold" is met, for example:
{
:local "ss";
:while (true) do={
:set $ss [/interface wireless registration-table get 0 signal-strength];
:set $ss [:pick "$ss" 0 [:find "$ss" "dBm"]];
:delay 1;
:if ($ss > -50) do={:put "Shrek2"} else={/system script run yolo}
}
}

Who is online

Users browsing this forum: erlinden, fenix24865, ips, Ralfu and 14 guests