0

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?

Zanna
  • 72,312
StuL
  • 1

1 Answers1

0

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:

  1. Monitoring battery and detecting the value (trigger)
    • You can use APCUPSD for monitoring and sending notification using email
    • you'll need postfix or any MTA local server/sender
  2. Send the notification
    • you can use email triggered by the point 1 using monitoring software such as webmin for example or the monitoring software features, or use a script with batmon and notify-osd.
  3. issue the command
    • If the command is manual a simple SSH command would be enough: ssh user@ip 'command to send'
    • The command to send could be a script in the user local directory.
Zanna
  • 72,312