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.
Code: Select all
: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"