Fix Uptime Kuma check: SSH to pve173 instead of local pct exec

This commit is contained in:
2026-03-17 01:32:26 -04:00
parent 393de540ee
commit cd05366c78
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -43,6 +43,6 @@ POS-only daily news briefing for the **Epson TM-m30** receipt printer (`192.168.
### Open threads ### 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 - [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 - [ ] 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 - [ ] Investigate why CT 166 intermittently cannot reach CT 120 (`192.168.0.157:80`) — check Proxmox firewall rules on the bridge
+4 -3
View File
@@ -293,10 +293,11 @@ def get_financial_snapshot():
def get_uptime_kuma_status(): def get_uptime_kuma_status():
try: try:
res = os.popen( res = os.popen(
"pct exec 147 -- sqlite3 /app/uptime-kuma/data/kuma.db " "ssh -o StrictHostKeyChecking=no pve173 "
"\"SELECT name FROM monitor WHERE active = 1 AND id IN " "\"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 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() ).read().strip()
if res: if res:
return res.replace("\n", ", ") return res.replace("\n", ", ")