Wake On Lan (WOL) on DST-Nat (Or device offline)

Hello.
I would like my router to run a script if the DST-nat destination IP is either offline.

How would I determine this?

Is there a way I could ping the dst-nat IP, and if failed, execute a script?

What would be an example script?

Ultimately i either wat to do a /tool wol MAC:ADDRESS or /system ssh-exec address=xxxxx(a different host) user=xxxx command=“wake-up-machine MAC:ADDRESS”


i have already set up ssh keys to enable the ssh-exec command to work properly.

All i need help with is the wake up while if offline script for my dst-nat firewall hosts.

can you advise me?