89. Mikrotik Monitoring Traffic on interface by SMS and Email alert




You can contact me: plus.google.com/+PhallaCCMT; youtube.com/phallaccmt; facebook.com/Phalla.CCMT; twitter.com/PhallaCCMT and Phalla.CCMT@gmail.com

Download Script:

:local CurDate [/system clock get date] 
:local CurTime [/system clock get time] 
:local DSpeed "10Mbps"
:local StatusTraffic "Download"
:local OnInterface "Bridge-LAN"

#WriteDown2Log
:log info "$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface"

#SMS
/tool sms send phone-number="077272270" port=usb2 message="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface.


Alert by Phalla.......................................!"

#Email
/tool e-mail send to="phalla.ccmt@gmail.com" subject="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate" body="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface. 




Alert by Phalla...........................................!"


Upload Script:

:local CurDate [/system clock get date] 
:local CurTime [/system clock get time] 
:local DSpeed "10Mbps"
:local StatusTraffic "Upload"
:local OnInterface "Bridge-LAN"

#WriteDown2Log
:log info "$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface"

#SMS
/tool sms send phone-number="077272270" port=usb2 message="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface.


Alert by Phalla.......................................!"

#Email
/tool e-mail send to="phalla.ccmt@gmail.com" subject="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate" body="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate on interface $OnInterface. 




Alert by Phalla...........................................!"


Previous
Next Post »

3 comments

Write comments
Unknown
AUTHOR
January 24, 2017 at 3:44 AM delete

Hi Guys,

I have tried this script. It emails me but it only writes

"Speed is more then at" on the subject line. Then its blank.

Could you identify why?

Thanks.

Reply
avatar
January 25, 2017 at 1:46 AM delete

Hi Guys,

I tried to get this to work, however, I only receive an email with subject "speed is more than at". No body or anything else.

Any help on this would be really great!

Thanks.

Reply
avatar
Kevin Freels
AUTHOR
June 23, 2019 at 5:00 AM delete

I don't use this, but it looks to me that the problem is that the entire thing is in quotes but is using variables. A variable inside the quotation marks would only show exactly what is written. So it appears it should look more like this:
#Email
/tool e-mail send to="phalla.ccmt@gmail.com" subject="$StatusTraffic speed is more than";$DSpeed;"at";$CurTime $CurDate body="$StatusTraffic speed is more than" $DSpeedat "at" $CurTime $CurDate "on interface" $OnInterface

But it's been a decade since I coded anything at all. lol there may need to be commas or semicolons in there to separate the quotes from the input data. And that's just my best guess. I just ran across this browsing for something else entirely and thought I could at least get you pointed in the right direction since it appears that the author isn't responding.

Reply
avatar