85. Mikrotik Monitoring Host by Netwatch with email alert



Script:

--- Up---Script:---------------------------------------------------------------------------------------

:local EmailAdd "phalla.ccmt@gmail.com"
:local CurDate [/system clock get date] 
:local CurTime [/system clock get time] 
:local HostName "GooGle DNS"
:local HostIP "8.8.8.8"

:log info "$HostName $HostIP is UP"
:log info "Email is sent to phalla.ccmt@gmail.com"

 /tool e-mail send to="$EmailAdd" subject="Host \"$HostName\" is UP at $CurTime $CurDate" body="Host \"$HostName($HostIP)\" is up at $CurTime. 


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

------ DOWN---Script:-----------------------------------------------------------------------------

:local EmailAdd "phalla.ccmt@gmail.com"
:local CurDate [/system clock get date] 
:local CurTime [/system clock get time] 
:local HostName "GooGle DNS"
:local HostIP "8.8.8.8"

:log info "$HostName $HostIP is Down"
:log info "Email is sent to phalla.ccmt@gmail.com"

 /tool e-mail send to="$EmailAdd" subject="Host \"$HostName\" is DOWN at $CurTime $CurDate" body="Host \"$HostName($HostIP)\" is down at $CurTime. 


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


Note:
Gmail Server: 173.194.77.108
Gmail Port: 587



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

Previous
Next Post »

2 comments

Write comments
Unknown
AUTHOR
July 1, 2018 at 5:10 PM delete

Nice post....But what will be the script for frequent email (10-15mints) if down only and one email if up.

Reply
avatar
Murshalin
AUTHOR
March 4, 2019 at 1:08 AM delete

Hi.... How to send link status mail to multiple mail id?

Reply
avatar