I am new to mtik scripting so in advance I`m sorry for my newbie questions.
I made a script that checks the active connections in PPP, and when it detects a connection it sends an email.
Code: Select all
foreach i in=[ppp active find ] do={
local name [ppp active get value-name=name $i];
local ipaddr [ppp active get value-name=caller $i];
:log info "Active PPTP connection with username: $name, IP Address of caller: $ipaddr";
/tool e-mail send to="example@gmail.com" tls=yes body="Active PPTP connection with username: $name, IP Address of caller: $ipaddr" subject="PPTP connection";
}
I thought of scheduling the script to run every minute or so, but then it will send an email everytime with the active connections... which is no good for me.
So I would like to ask for some help on an idea for this, and most likely a bit of coding too.
Thank you again