Community discussions

MikroTik App
 
uriel
just joined
Topic Author
Posts: 2
Joined: Mon Aug 21, 2017 1:20 am

wol, ping and mail

Mon Feb 25, 2019 7:59 pm

Hey, please help
I need to write a script that will call WOL, then it will start pinging the computer and when the computer he will reply to ping and he will send an email
 
Kurosudo
just joined
Posts: 21
Joined: Wed Aug 01, 2018 1:21 pm

Re: wol, ping and mail  [SOLVED]

Tue Feb 26, 2019 2:41 pm

:local HOST "IPADDRESSOFYOURPC"
:local MAC "MACADDRESSOFYOURPC"
/tool wol mac=$MAC

# WAIT 2 minutes to boot
:delay 120

:if ([/ping $HOST interval=1 count=15] != 0) do={
	/tool e-mail send to=my@mail.tld subject="$HOST IS ONLINE" body="HOST $HOST IS ONLINE NOW" start-tls=yes
}

Who is online

Users browsing this forum: GoogleOther [Bot], mostfa228 and 55 guests