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 8.8.8.8

for telegram please learn how to make the boot yourself

:if ([/ping 1.1.1.1 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="https://api.telegram.org/botxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendMessage\?chat_id=xxxx&text= ->> Jalur WAN-1 RTO pada jam [ $datetime2 ] tanggal [ $datetime1 ] " keep-result=no
}
Credit: www.o-om.com