From cd05366c78ffc9cb316fefdb89af771e7ac836de Mon Sep 17 00:00:00 2001 From: Seth Freiberg Date: Tue, 17 Mar 2026 01:32:26 -0400 Subject: [PATCH] Fix Uptime Kuma check: SSH to pve173 instead of local pct exec --- SESSION.md | 2 +- pos_briefing.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/SESSION.md b/SESSION.md index 3d4f2b1..d1b0f30 100644 --- a/SESSION.md +++ b/SESSION.md @@ -43,6 +43,6 @@ POS-only daily news briefing for the **Epson TM-m30** receipt printer (`192.168. ### Open threads - [x] Update crontab to point to `/root/bin/POS-Automation/pos_briefing.py` — runs at 4:58 AM and 3:00 PM daily -- [ ] Uptime Kuma check (`pct exec 147`) always returns None inside a CT — consider querying the Kuma HTTP status API instead +- [x] Uptime Kuma check — Kuma is v1 (no REST API). Fixed by SSHing to `pve173` and running `pct exec 147` from there. Key auth already configured. - [ ] ETH-USD yfinance occasionally fails with NoneType — add per-ticker exception handling - [ ] Investigate why CT 166 intermittently cannot reach CT 120 (`192.168.0.157:80`) — check Proxmox firewall rules on the bridge diff --git a/pos_briefing.py b/pos_briefing.py index 7098790..dc6aaa3 100644 --- a/pos_briefing.py +++ b/pos_briefing.py @@ -293,10 +293,11 @@ def get_financial_snapshot(): def get_uptime_kuma_status(): try: res = os.popen( - "pct exec 147 -- sqlite3 /app/uptime-kuma/data/kuma.db " - "\"SELECT name FROM monitor WHERE active = 1 AND id IN " + "ssh -o StrictHostKeyChecking=no pve173 " + "\"pct exec 147 -- sqlite3 /app/uptime-kuma/data/kuma.db " + "'SELECT name FROM monitor WHERE active = 1 AND id IN " "(SELECT monitor_id FROM heartbeat WHERE id IN " - "(SELECT MAX(id) FROM heartbeat GROUP BY monitor_id) AND status = 0);\"" + "(SELECT MAX(id) FROM heartbeat GROUP BY monitor_id) AND status = 0);'\"" ).read().strip() if res: return res.replace("\n", ", ")