Check if RTO and send to Telegram - Mikrotik Script RouterOS

Mikrotik script to check RTO on the routing path and send info directly to Telegram

just adjust "WAN-1" in the script with the name of each routing-table and for ip can be changed for example to

for telegram please learn how to make the boot yourself

:if ([/ping routing-table=WAN-1 count=5] = 0) do={
:local datetime1 [/system clock get date]
:local datetime2 [/system clock get time]
:log error "RTO pada jam [ $datetime2 ] tanggal [ $datetime1 ]"
/tool fetch url="\?chat_id=xxxx&text= ->> Jalur WAN-1 RTO pada jam [ $datetime2 ] tanggal [ $datetime1 ] " keep-result=no