12.03.2018, 13:11
(09.03.2018, 13:41)edgars Wrote: Hi guys,
here is a Scheduled script for Mikrotik RouterOS (v6.41.2) which will monitor WiFi registration table and if one of both MACs appear it will send 1 to grp address 1/1/1 on LogicMachine (192.168.1.13) via HTTP POST command. If both of MACs disappear from the list, it will send 0 to 1/1/1.
You can adjust Scheduled script run interval and list of MAC addresses. Or you can send different POST commands for different MAC addresses.
Code:{
:local exists [/int wire reg find mac-address="78:02:F8:7A:96:01"];
:local exists2 [/int wire reg find mac-address="B0:E2:35:CD:46:48"];
:if ($exists!="" or $exists2!="") do={
/tool fetch url="http://remote:11111111@192.168.1.13/scada-remote" http-data="m=json&r=grp&fn=write&alias=1/1/1&value=1" http-method=post;
} else={
/tool fetch url="http://remote:11111111@192.168.1.13/scada-remote" http-data="m=json&r=grp&fn=write&alias=1/1/1&value=0" http-method=post;
}
}
Here is detailed example.
This script only works if you don't use capsman i think.