This commit is contained in:
vvzvlad 2024-08-13 18:55:03 +03:00
parent 60427c950a
commit 592cdd2b40

View File

@ -92,7 +92,7 @@ def main():
shutdown_status = run_command('shutdown --show')
if (state == "on-battery") and (time_on_battery > TIME_THRESHOLD) and ("No scheduled shutdown" in shutdown_status):
if (state == "on-battery") and (time_on_battery < TIME_THRESHOLD) and ("No scheduled shutdown" in shutdown_status):
print("UPS is failing, shutting down in 60 seconds...", flush=True)
send_email(f"{socket.gethostname()}@vvzvlad.xyz", "UPS is failing, shutting down in 60 seconds...",
f"Proxmox node '{socket.gethostname()}': UPS is failing, shutting down in 60 seconds...",