feat(power): complete Phase 7 Power Resilience & UPS Automation deployment and verification

This commit is contained in:
2026-11-02 21:58:49 -05:00
parent 7ca3d5acb8
commit d3e2e1f291
8 changed files with 216 additions and 40 deletions

23
scripts/test_nut_alert.py Normal file
View File

@@ -0,0 +1,23 @@
import paramiko
import json
def main():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('14.4.4.44', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
payload = json.dumps({
"title": "NUT Master Notification Pipeline Verified",
"message": "Direct alert link verified: 14.4.4.44 -> Gotify VIP (http://140.44.4.70:8090) -> Discord #ups-power channel.",
"priority": 5
})
curl_cmd = f"curl -s -X POST \"http://140.44.4.70:8090/message?token=A4uN4fEmErGeNcYtOkEn\" -H \"Content-Type: application/json\" -d '{payload}'"
stdin, stdout, stderr = ssh.exec_command(curl_cmd)
res = stdout.read().decode()
print("GOTIFY RESPONSE:", res)
ssh.close()
if __name__ == '__main__':
main()