applescript – Check that a network Mac is powered on (to start backing it up)

I have recently installed in my home’s basement near my router an old iMac on High Sierra to be a server helping the other macs. This server is always on and running. It performs certain current tasks (like backing up) at all times except when the subject other mac is shut down. I therefore want the server to know whether or not the other mac is ON. I use both computers’ Mail to issue, read, or implement a mail or mail action (triggering an applescript).

The above is quite complicated to set up but it works. However, using Mail does not appear to be robust. From time to time, Mail simply forgets to do the job.

Is there a more clever and more robust way of doing the same ?

any suggestion ?

TIA