Skip to main content

Intelligent UPS Monitoring & Shutdown Orchestration for NUT

Project description

⚡ Eneru

UPS monitoring and shutdown orchestration for NUT

License: MIT Python 3.9+ NUT Compatible codecov Documentation PyPI

Eneru Architecture

A Python-based UPS monitoring daemon that watches UPS status via Network UPS Tools (NUT) and executes configurable shutdown sequences during power events.

DocumentationGetting StartedConfigurationChangelog


Why Eneru?

Most UPS shutdown solutions handle a single system. Eneru handles multiple systems:

Challenge Eneru Solution
Multiple servers need coordinated shutdown ✅ Orchestrated multi-server shutdown via SSH
VMs and containers need graceful stop ✅ Libvirt VM and Docker/Podman container handling
Network mounts hang during power loss ✅ Timeout-protected unmounting
No visibility during power events ✅ Notifications via 100+ services
Different systems need different commands ✅ Per-server custom shutdown commands
Hypervisors need VM shutdown before host ✅ Pre-shutdown actions (Proxmox, ESXi, XCP-ng, libvirt)
Battery estimates are unreliable ✅ Multi-vector shutdown triggers
Network down during outage ✅ Non-blocking notifications with persistent retry

Use cases

Homelabs, virtualization hosts (Proxmox, ESXi, libvirt), Docker/Podman container hosts, NAS systems (Synology, QNAP, TrueNAS), multi-server environments on a single UPS, and mixed physical/virtual setups.


Quick start

Installation

PyPI:

pip install eneru[notifications]

Debian/Ubuntu:

curl -fsSL https://m4r1k.github.io/Eneru/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/eneru.gpg
echo "deb [arch=all signed-by=/usr/share/keyrings/eneru.gpg] https://m4r1k.github.io/Eneru/deb stable main" | sudo tee /etc/apt/sources.list.d/eneru.list
sudo apt update && sudo apt install eneru

RHEL/Fedora:

sudo dnf install -y epel-release
sudo curl -o /etc/yum.repos.d/eneru.repo https://m4r1k.github.io/Eneru/rpm/eneru.repo
sudo dnf install eneru

Configuration

# Edit configuration
sudo nano /etc/ups-monitor/config.yaml

# Validate and start
sudo python3 /opt/ups-monitor/eneru.py --validate-config
sudo systemctl enable --now eneru.service

Minimal Config

ups:
  name: "UPS@192.168.1.100"

triggers:
  low_battery_threshold: 20
  critical_runtime_threshold: 600

local_shutdown:
  enabled: true

See the full documentation for complete configuration options.


Features

  • Multiple shutdown triggers: battery %, runtime, depletion rate, time on battery, FSD flag
  • Orchestrated shutdown of VMs, containers, remote servers, filesystems, and the local system
  • Notifications to 100+ services (Discord, Slack, Telegram, ntfy, email) via Apprise, with non-blocking persistent retry
  • Power quality monitoring: voltage, AVR, bypass, and overload detection
  • Dry-run mode for safe configuration testing
  • Unit tests, integration tests across 7 Linux distros, and E2E tests with real NUT/SSH/Docker services on every commit

Why a systemd daemon? (No Docker)

Eneru runs as a systemd daemon, not a container. It shuts down Docker/Podman containers during power events, so running inside a container would mean getting killed during its own shutdown sequence.

See the documentation for the full explanation.


The name

Eneru from One Piece

Named after Eneru (エネル) from One Piece, the self-proclaimed God of Skypiea who ate the Goro Goro no Mi (Rumble-Rumble Fruit) and can control electricity. When the power from the grid fails, this tool takes over and shuts everything down safely. Unlimited power... management!


Documentation

Full documentation at eneru.readthedocs.io:


License

MIT License - See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eneru-4.11.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eneru-4.11-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file eneru-4.11.tar.gz.

File metadata

  • Download URL: eneru-4.11.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eneru-4.11.tar.gz
Algorithm Hash digest
SHA256 9f0a625e55e5724abd183e0059bd2a6e4f099bc95d25e0d9bd02f96a3aeee9ba
MD5 f4bf7d698460fcabe837d09824bb67e1
BLAKE2b-256 7e58d5624ff82ec0d89db6862302524f7d70e87ffa01ae79951376bd67b42fee

See more details on using hashes here.

Provenance

The following attestation bundles were made for eneru-4.11.tar.gz:

Publisher: pypi.yml on m4r1k/Eneru

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eneru-4.11-py3-none-any.whl.

File metadata

  • Download URL: eneru-4.11-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for eneru-4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5e0f49bcd6301c515be4e0aa098bf7a40ca69484f6b8d028c785ee232d62e1
MD5 3c9a2b200784114fad5c74afdf235c66
BLAKE2b-256 a1221689b2954d7af9bc5a43768ef487ff947e3af41fded44d671f8ccf16cf2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for eneru-4.11-py3-none-any.whl:

Publisher: pypi.yml on m4r1k/Eneru

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page