I am running an Ubuntu workstation with apache2 on it. I want to be able to submit a shutdown command remotely to Ubuntu from another machine when the other system senses a power failure (while still on battery).
How can I do this?
The apache2 Ubuntu is running on a laptop, isn't it? So when the laptop have its battery lower than a fixed value, you want to be notified so you can shut it down?
So you have three steps:
batmon and notify-osd.ssh user@ip 'command to send'