Page 1 of 1

WOL PC while it's down

Posted: Fri Jul 12, 2019 1:14 pm
by plase509
Hello, i have a little server with mikrotik hap ac lite as main router. in our server we have NAS and a little pc for cameras. The problem is: when power goes down for a while, UPS dies and whole server gets down. when it powers up next time, pc does not powers up automatically as well as NAS, but NAS doesnt have this possibility yet (D-Link DNS-323) it has on different firmware. Pc has WOL as well as mikrotik. but the thing is, we dont know when the power gets down next time so i need some sort of scrit that will check every, say, 10 min. for a pc if its up and rinning and if it's not to WOL it. Is there any sort of information to how can i do that? I think I can write a script, it is not problem but i do not know what to use to check if pc is down or not. Thanks!

Re: WOL PC while it's down  [SOLVED]

Posted: Fri Jul 12, 2019 1:53 pm
by cdiedrich
I'd say /tool netwatch is your friend.
It does exactly what you need, just fill in scripts for up/down that will fire on these events.

But it might get tricky b/c the script is only fired once, not every time the target gets checked.
So you might add another netwatch item which monitors your UPS. Once that goes down, it disables the netwatch item for the server.
Once the UPS is back online, the server netwatch item will be enabled again. Now checks the server, detects that it's down and triggers the WoL script.
I'd suggest to start that up script with a delay of a minute or so, just to make sure the server definitely has AC power again.

-Chris

Re: WOL PC while it's down

Posted: Fri Jul 12, 2019 8:01 pm
by plase509
Yea, that is what i was looking for! I setup netwatch for pc and it did work as i need, did not checked it for a real power loss yet, i will respond later for power loss situation as well! Thank you!