Monitoring PPPoE via Telegram

Опубликовано: 19 Июль 2026
на канале: Ridwan Techno
544
10

Greetings, welcome back to Ridwan on the Ridwan Techno channel. This time, I'll try installing a Mikrotik script to monitor PPPoE users via Telegram. Can you watch the video?

#mikrotik
#pppoemikrotik
#router

script

#Router ON
:delay 2

:local name "$user"

:local bot "Chatbot"
:local chat "chatid"

:local ips [/ppp active get [find name=$nama] address]
:local caller [/ppp active get [find name=$nama] caller-id]
:local service [/ppp active get [find name=$nama] service]

:local profile [/ppp secret get [find name=$nama] profile]
:local lastdisc [/ppp secret get [find name=$nama] last-disconnect-reason]

:local active [/ppp active print count-only]
:local totalCustomers [/ppp secret print count-only]
:local totalInactive ($totalCustomers - $active)

:local datetime ("%F0%9F%93%85 Date: $[/system clock get date] %0A%F0%9F%95%92 Clock: $[/system clock get time]")

:local message ("%E2%9C%85 Router ON%0A$datetime%0A%F0%9F%91%A4 User: $name%0A%F0%9F%93%A6 Profile: $profile%0A%F0%9F%8C%90 Client IP: $ips%0A%F0%9F%96%A5%EF%B8%8F Caller ID: $caller%0A%F0%9F%9B%A0%EF%B8%8F Service: $service%0A%E2%9A%A0%EF%B8%8F Last Disconnect: $lastdisc%0A%F0%9F%93%8A Total Active: $active Client%0A%F0%9F%93%89 Total Inactive: $totalInactive Client%0A%F0%9F%93%8B Total Client: $totalCustomer Client")

/tool ​​fetch check-certificate=no http-method=post http-data=("chat_id=".$chat."&text=".$message) url=("https://api.telegram.org/bot".$bot."/sendMessage") keep-result=no



#Router OFF
:delay 2

:local name "$user"

:local bot "catbot"
:local chat "catid"

:local lastcall $"caller-id"
:if ([:len $lastcall] = 0) do={ :set lastcall "-" }

:local profile "-"
:local lastdisc "-"
:local lastlogout "-"

:local secID [/ppp secret find name=$name]
:if ($secID != "") do={
:set profile [/ppp secret get $secID profile]
:set lastdisc [/ppp secret get $secID last-disconnect-reason]
:set lastlogout [/ppp secret get $secID last-logged-out]
}

:local active [/ppp active print count-only]
:local totalCustomers [/ppp secret print count-only]
:local totalInactive ($totalCustomers - $active)

:local datetime ("%F0%9F%93%85 Date: $[/system clock get date] %0A%F0%9F%95%92 Clock: $[/system clock get time]")

:local message ("%F0%9F%94%B4 Router OFF%0A$datetime%0A%F0%9F%91%A4 User: $name%0A%F0%9F%93%A6 Profile: $profile%0A%F0%9F%96%A5%EF%B8%8F Last Caller: $lastcall%0A%E2%9A%A0%EF%B8%8F Reason: $lastdisc%0A%E2%8F%B1%EF%B8%8F Last Logout: $lastlogout%0A%F0%9F%93%8A Total Active: $active Client%0A%F0%9F%93%89 Total Inactive: $totalInactive Client%0A%F0%9F%93%8B Total Client: $totalCustomer Client")

/tool ​​fetch check-certificate=no http-method=post http-data=("chat_id=".$chat."&text=".$message) url=("https://api.telegram.org/bot".$bot."/sendMessage") keep-result=no