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
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
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}
}
}