Template Telegram – 1
:local CHID "ChatID"; # MANDATORY
:local ThreadID "ThreadID"; #OPTIONAL JIKA GROUP TOPIC
:local BotID "Token"; # MANDATORY
:local ServiceStatus "[Service.Status]"; # MANDATORY
:local Device "[Device.Name]";
:local Service "[Probe.Name]";
:local IP "[Device.FirstAddress]";
:local message "";
# Membuat pesan berdasarkan status service
:if ($ServiceStatus = "up") do={
:set message ("Name: $Device %0AIP: <code>$IP</code> %0AService: $Service %0AStatus: UP 🟢")
/delay 2s;
/tool fetch url="https://api.telegram.org/bot$BotID/sendmessage?chat_id=$CHID&message_thread_id=$ThreadID&text=$message&parse_mode=HTML" keep-result=no;
} else={
:set message ("Name: $Device %0AIP: <code>$IP</code> %0AService: $Service %0AStatus: DOWN 🔴")
/tool fetch url="https://api.telegram.org/bot$BotID/sendmessage?chat_id=$CHID&message_thread_id=$ThreadID&text=$message&parse_mode=HTML" keep-result=no;
}
Contoh hasil / Output di Telegram
On Up
Name: ROUTER-PLASTIK
IP: 192.168.1.1
Service: ping
Status: UP 🟢
On Down
Name: ROUTER-PLASTIK
IP: 192.168.1.1
Service: ping
Status: DOWN 🔴