This Docker image is designed to monitor the status of an Uninterruptible Power Supply (UPS) using the Network UPS Tools (NUT) and automatically shutdown the host machine in case of power failure or if the battery falls below certain thresholds. Perfect for Raspberry Pi.
// momentum
// why it's here
- Active: last commit today
// how to help
// readme
UPS Auto Shutdown
Description
UPS Auto Shutdown is a Python script that uses the PyNUTClient library to monitor the status of an uninterruptible power supply (UPS) via a NUT (Network UPS Tools) server. It triggers actions like system shutdown or sending notifications when the UPS battery is low, the load is too high, or the main power is lost.
The script supports alerts via email and Apprise for sending notifications to multiple platforms.
Features
- Monitors UPS battery and load status.
- Triggers a safe shutdown when the battery is low or the runtime is short.
- Sends alert notifications via email and Apprise.
- Supports dry-run mode to test without executing an actual shutdown.
- Customizable via environment variables or command-line arguments. Command-line arguments take priority over environment variables.
Requirements
- Python 3.x
- Running NUT server accessible from the script
- Python libraries:
PyNUTClientapprise
Installation
- Clone the repository:
git clone https://github.com/naonak/ups-auto-shutdown.git
cd ups-auto-shutdown