From 5061c21b94dbc9c6941e147293a0f0c5599c0f50 Mon Sep 17 00:00:00 2001 From: Seth Freiberg Date: Tue, 17 Mar 2026 15:04:16 -0400 Subject: [PATCH] Remove down-site alert from printed briefing --- pos_briefing.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/pos_briefing.py b/pos_briefing.py index dc6aaa3..1d8c95b 100644 --- a/pos_briefing.py +++ b/pos_briefing.py @@ -290,22 +290,6 @@ def get_financial_snapshot(): return None -def get_uptime_kuma_status(): - try: - res = os.popen( - "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);'\"" - ).read().strip() - if res: - return res.replace("\n", ", ") - except: - pass - return None - - def get_reddit_top(): try: r = requests.get( @@ -354,7 +338,7 @@ def shorten_url(long_url): # ── ESC/POS receipt builder ─────────────────────────────────────────────────── -def build_receipt(articles, zfs, reddit, grafana, weather, finance, kuma): +def build_receipt(articles, zfs, reddit, grafana, weather, finance): from escpos.printer import Dummy as EscPosDummy p = EscPosDummy(profile="default") @@ -374,10 +358,6 @@ def build_receipt(articles, zfs, reddit, grafana, weather, finance, kuma): s(align='left', bold=False) if weather: p.text(f"Wx: {weather}\n") - if kuma: - s(align='left', bold=True) - p.text(f"ALERT: {kuma}\n") - s(align='left', bold=False) if zfs: p.text(f"ZFS: {zfs['alloc']}/{zfs['size']} ({zfs['cap']}) {zfs['health']}\n") if grafana: @@ -445,13 +425,12 @@ def main(): grafana = get_grafana_metrics() weather = get_weather() finance = get_financial_snapshot() - kuma = get_uptime_kuma_status() if not items: print("[!] No unread articles — printing dashboard only.") articles = summarize_news(items, count=5, length="30-50 words") if items else [] - raw = build_receipt(articles, zfs, reddit, grafana, weather, finance, kuma) + raw = build_receipt(articles, zfs, reddit, grafana, weather, finance) print_receipt(raw) if articles: