I have the Mikrotik Wireless Wire Cube Pro (https://mikrotik.com/product/wireless_wire_cube_pro) and wanted to make a script which I run on one of the devices which checks whether it can communicate with the other one. Then if it can, it will send it a textual message, say 'hello world'. This will then be displayed in the terminal window of the second device. I tried doing it with a http post request but get a 501 error. Could anyone help? What I have so far is the below:
/system script
add name=send-message source="
:local targetIP 192.168.88.3;
:local messageToSend \"Hello, world!\";
:if ([/ping $targetIP count=1] = 0) do={
:log info \"Target IP ($targetIP) is not reachable.\"
} else={
:log info \"Target IP ($targetIP) is reachable. Sending message...\"
/tool mac-telnet send message=\$messageToSend
}
"
/system scheduler
add name=check-and-send interval=1m on-event="/system script run send-message"