This commit adds a comprehensive UPS monitoring and management system for the Proxmox cluster with automated shutdown orchestration and monthly battery health testing. Features: - NUT (Network UPS Tools) configuration for INNO TECH USB UPS - Automated cluster shutdown on power failure (3-minute grace period) - Monthly automated battery testing with health evaluation - Email notifications via PVE::Notify system - WinNUT monitoring client for Windows VM 201 Components added: - config/: NUT configuration files (ups.conf, upsd.conf, upsmon.conf, etc.) - scripts/ups-shutdown-cluster.sh: Orchestrated cluster shutdown - scripts/ups-monthly-test.sh: Monthly battery test with email reports - scripts/upssched-cmd: Event handler for UPS state changes - docs/: Complete installation and usage documentation Key findings: - UPS battery.charge reporting has 10-40 second delay after test start - Test must monitor voltage drop (1.5-2V) and charge drop (9-27%) - Battery health evaluation: EXCELLENT/GOOD/FAIR/POOR based on discharge rate - Email notifications use Handlebars templates without Unicode emojis for compatibility Configuration: - UPS: INNO TECH (Voltronic protocol, vendor 0665:5161) - Primary node: pvemini (10.0.20.201) with USB connection - Monthly test: cron 0 0 1 * * /opt/scripts/ups-monthly-test.sh - Shutdown timer: 180 seconds on battery before cluster shutdown Documentation includes complete installation guides for NUT server, WinNUT client, and troubleshooting procedures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1.0 KiB
Bash
33 lines
1.0 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Script apelat de upssched pentru a gestiona evenimentele UPS
|
|
#
|
|
|
|
LOGFILE=/var/log/ups-events.log
|
|
|
|
log_event() {
|
|
echo "[2025-10-06 20:03:38] $1" >> $LOGFILE
|
|
}
|
|
|
|
case $1 in
|
|
onbatt)
|
|
log_event "UPS EVENT: Pe baterie de 3 minute - Începe shutdown orchestrat"
|
|
logger -t upssched-cmd "UPS on battery for 3 minutes - starting orchestrated shutdown"
|
|
/usr/local/bin/ups-shutdown-cluster.sh &
|
|
;;
|
|
lowbatt)
|
|
log_event "UPS EVENT: BATERIE SCĂZUTĂ - Shutdown IMEDIAT"
|
|
logger -t upssched-cmd "UPS LOW BATTERY - immediate shutdown"
|
|
/usr/local/bin/ups-shutdown-cluster.sh &
|
|
;;
|
|
commbad)
|
|
log_event "UPS EVENT: Comunicație pierdută cu UPS de 30 secunde"
|
|
logger -t upssched-cmd "Lost communication with UPS for 30 seconds"
|
|
# Nu facem shutdown automat pentru pierdere comunicație
|
|
;;
|
|
*)
|
|
log_event "UPS EVENT: Eveniment necunoscut - $1"
|
|
logger -t upssched-cmd "Unknown UPS event: $1"
|
|
;;
|
|
esac
|