Community discussions

MikroTik App
 
ukzerosniper
Member Candidate
Member Candidate
Topic Author
Posts: 129
Joined: Tue Jul 23, 2013 9:20 pm

Email alert for traffic on specific port

Tue Jan 24, 2017 11:39 pm

Hi Guys,

I am trying to create a script I can run in the traffic monitor tool to email me when it detects traffic on a specific interface.

We have some fast but unreliable units in the field at the moment, when the units die, they need to be physically rebooted to bring them back online. The trouble is that because OSPF is carrying the traffic via an alternative route, it can sometimes take a while to detect the outage. Until the manufacturer replaces all our hardware in the next coming weeks, we need to be alerted when the links die ASAP.

I have created this script, which is working, however, I would like to add in the current traffic rate on the interface. Could someone help me add that part in?

Its when setting the ifspeed variable that I am getting stuck, I just don't know how to get the "desired interface speed".
:local ifspeed "GET_DESIRED_INTERFACE_SPEED"

Any help you may provide would be gratefully received.
:local sysname [/system identity get name]
:local CurDate [/system clock get date] 
:local CurTime [/system clock get time] 
:local Interface "Interface_Name"
:local LinkName "Link_Description"
:local ifspeed "GET_DESIRED_INTERFACE_SPEED"

#Email
/tool e-mail send to="YourEmail@email.com" subject="$StatusTraffic speed is more then $DSpeed at $CurTime $CurDate" body="Device : $sysname 
Date : $CurDate 
Time : $CurTime 

$LinkName has become active and traffic is currently flowing over $Interface at a rate of $ifspeed"
Thanks Guys!
 
ukzerosniper
Member Candidate
Member Candidate
Topic Author
Posts: 129
Joined: Tue Jul 23, 2013 9:20 pm

Re: Email alert for traffic on specific port

Sat Jan 28, 2017 10:55 pm

Bump. Can anyone help?

Who is online

Users browsing this forum: No registered users and 84 guests