Community discussions

MikroTik App
 
MasVin22
just joined
Topic Author
Posts: 1
Joined: Mon Sep 04, 2023 1:44 pm

PPPOE Notification Cannot run in ROSv7.xx

Mon Sep 04, 2023 2:03 pm

Hello friends.. I have a network with topology :
RB1009 (ROS v7.10.9)<> CSS 24 Port <> OLT GPON <> Client Modem PPPoE. I need to run notification in my RB1009 to give me a notif when client pppoe is up or down, when i try to input my script on My other device (RB951 with ROS v6.48.1) this script is run to send me notification with bot telegram to my group telegram. But, when i run to my RB1009 this script cannot run. I don't know why, i feel this is bug or my script is broken ?
Script Notification :
======================================================================================
SCRIPT ON UP
:local nama "$user";
:local btslocate "BTS-XXX";
:local olttype "XXX TYPE";
:local oltip "IP : 172.25.XX.XX";
:local profil "XXX";
:local ips [/ppp active get [find where service=pppoe name=$nama] address];
:local up [/ppp active get [find where service=pppoe name=$nama] uptime];
:local caller [/ppp active get [find where service=pppoe name=$nama] caller-id];
:local active [/ppp active print count-only];
:local datetime "Tanggal : $[/system clock get date] %0AJam : $[/system clock get time]";
:local lastlogout [/ppp secret get [find where service=pppoe name=$user] last-logged-out];
:local lastcall [/ppp secret get [find where service=pppoe name=$user] caller-id];
/tool fetch url="https://api.telegram.org/bot(ID Bot Telegram)/sendMessage\?chat_id=(Chat ID)&text=\E2\9C\85 PPPOE LOGIN %0ALokasi BTS : $btslocate %0AOLT Type : $olttype %0A$oltip %0A$datetime%0AUsername: $user %0APassword : somepassword %0AProfile Langganan : $profil %0AIP Client PPPoE : $ips %0ACaller ID: $caller% 0AUptime: $up %0ATotal Active Client PPPoE : $active Client %0ALast Logout : $lastlogout %0ALast Caller ID: $lastcall" mode=http keep-result=no;

##############
SCRIPT ON DOWN
:local nama "$user";
:local btslocate "BTS-XXX";
:local olttype "XXX TYPE";
:local oltip "IP : 172.25.XX.XX";
:local profil "XXX";
:local lastlogout [/ppp secret get [find where service=pppoe name=$user] last-logged-out];
:local lastcall [/ppp secret get [find where service=pppoe name=$user] caller-id];
:local active [/ppp active print count-only];
:local datetime "Tanggal : $[/system clock get date] %0AJam : $[/system clock get time]";
/tool fetch url="https://api.telegram.org/bot(ID Bot Telegram)/sendMessage\?chat_id=(Chat ID)&text=\E2\9D\8CPPPOE-LOGOUT %0ALokasi BTS : $btslocate %0AOLT Type : $olttype %0A$oltip %0A$datetime%0AUsername : $user %0APassword : somepassword %0AProfile Langganan : $profil %0ALast Logout: $lastlogout %0ALast Caller ID: $lastcall %0ATotal active: $active Client" keep-result=no;

======================================================================================


I hope someone can help me about this, thanks for everyone..

Who is online

Users browsing this forum: No registered users and 9 guests