Sentinel-Hl

PythonUpdated 1 week agoAutomationInfrastructure
View on GitHub
README

Sentinel-Hl is a lightweight service for UPS power management and automatic server recovery. It monitors systems, reacts to power outages, and helps keep infrastructure available with minimal manual intervention.

Server monitoring

Sentinel-Hl monitors configured systems and tracks whether they are online or offline.

When a system stops responding, Sentinel-Hl can send a Wake-on-LAN packet to start it again. This allows the service to recover machines that become unavailable without requiring someone to turn them on manually.

Administrators can also acknowledge a system when it is intentionally offline. This prevents repeated wake-up attempts until the system becomes active again.

UPS power management

Sentinel-Hl can connect to a NUT (Network UPS Tools) server and monitor the UPS status and battery level.

When a power outage occurs, the UPS switches to battery power. Sentinel-Hl keeps checking the remaining charge and waits until it reaches a configured threshold.

At that point, it can safely shut down the monitored systems through SSH. This gives services time to stop cleanly and prevents the systems from losing power when the UPS battery runs out.

Automatic recovery

When normal power returns, Sentinel-Hl waits for the UPS to become stable before starting the recovery process.

It can then wake the configured systems using Wake-on-LAN.

This creates an automatic recovery cycle:

power outage → UPS switches to battery → battery reaches the shutdown threshold → systems shut down → power returns → systems wake up

The system can handle both short and extended outages without requiring manual intervention.

Configuration

Sentinel-Hl uses a YAML configuration file to define the systems it should monitor and the actions it should take.

The configuration controls system monitoring, Wake-on-LAN, UPS checks, battery thresholds, SSH access, and recovery behaviour.

This makes it possible to adapt the service to different server setups without changing the application itself.

Deployment

Sentinel-Hl is written in Python and supports several deployment methods. It can run as a Python package, a standalone script, or a Docker container.

It can also run as a systemd service on Linux. The Docker deployment uses host networking so that Wake-on-LAN packets can reach the local network.

The project focuses on a small but useful part of infrastructure management: monitor the systems, protect them during power failures, and bring them back online when conditions return to normal.UPS power managemen