From d0b2c182de2c7d107e4a623cb2d3bf9a004939b0 Mon Sep 17 00:00:00 2001 From: Homelab Cursor Date: Sat, 25 Apr 2026 14:50:16 +0200 Subject: [PATCH] fix(ops): dokumentiere Smart-Home-Alert-Fixes und Matomo-Check - Hausmeister-Bot Matomo-HTTP-Check korrigiert: Matomo laeuft in CT109 (10.10.10.109), nicht in CT113. - Smart-Home-Doku ergaenzt: CT143/raspi-broker Error-Rate war durch /tmp-tmpfs-Backups, vollen Swap und Telegraf-Noise verursacht. - Cleanup-Script fuer alte raspi-broker-TARs versioniert, damit /tmp im CT143 nicht erneut RAM/Swap fuellt. --- homelab-ai-bot/monitor.py | 2 +- smart-home/HEIZUNG.md | 24 +++++++++++++++++++ .../scripts/cleanup-raspi-broker-tmp.py | 13 ++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 smart-home/scripts/cleanup-raspi-broker-tmp.py diff --git a/homelab-ai-bot/monitor.py b/homelab-ai-bot/monitor.py index 50b97d738..80a1ff6e6 100644 --- a/homelab-ai-bot/monitor.py +++ b/homelab-ai-bot/monitor.py @@ -43,7 +43,7 @@ CRITICAL_CONTAINERS = [101, 109, 111, 112, 113, 115] HTTP_HEALTH_CHECKS = [ {"name": "WordPress (CT 101)", "url": "http://10.10.10.101/robots.txt"}, - {"name": "Matomo (CT 113)", "url": "http://10.10.10.113"}, + {"name": "Matomo (CT 109)", "url": "http://10.10.10.109"}, {"name": "Grafana (CT 110)", "url": "http://10.10.10.110:3000/api/health"}, {"name": "Flugscanner-Agent (pve-pp-1)", "url": "http://100.126.26.46:5010/status", "retries": 5, "timeout": 25, "retry_delay": 6, "host": "pve-pp-1"}, diff --git a/smart-home/HEIZUNG.md b/smart-home/HEIZUNG.md index 49e4e159c..40914df4b 100644 --- a/smart-home/HEIZUNG.md +++ b/smart-home/HEIZUNG.md @@ -148,6 +148,30 @@ neu berechnet werden. ## Häufige Fragen / Troubleshooting +### 2026-04-25: raspi-broker Error-Rate / Influx-Timeouts + +Ursache war kein Brenner-Logikfehler, sondern Ressourcen-Druck im CT143: + +- `/tmp` ist im Smart-Home-CT ein `tmpfs` und belegt RAM. +- `ioBroker/backitup` hatte dort taegliche `raspi-broker-YYYY-MM-DD.tar.gz` Archive liegen lassen (~700 MB pro Tag, ~7 GB gesamt). +- Dadurch war der CT im Swap, InfluxDB-Queries aus `brennerstarts.py` liefen in 30s-Timeouts. +- Alte TARs wurden geloescht, nur das aktuelle Tagesarchiv blieb. +- Dauerfix: `/usr/local/sbin/cleanup-raspi-broker-tmp.py` + Cron `/etc/cron.d/cleanup-raspi-broker-tmp` loescht Archive aelter als 36h. Versionierte Kopie: `smart-home/scripts/cleanup-raspi-broker-tmp.py`. + +Zweiter Fehlerstrom kam von Telegraf: + +- `/etc/telegraf/telegraf.d/promtail.conf` pollte `http://100.78.77.115:9080/metrics`, ein seit Wochen offline befindlicher Tailscale-Node. +- Datei wurde nach `/etc/telegraf/telegraf.d/promtail.conf.disabled` verschoben. Backup: `.bak-20260425`. +- In `/etc/telegraf/telegraf.d/openwb.conf` wurde `openWB/lp/1/TimeRemaining` aus dem Float-MQTT-Consumer entfernt, weil Payloads wie `Min` nicht als Float parsebar sind. Backup: `.bak-20260425`. + +Pruefung: + +```bash +ssh pve-mu-3 'pct exec 143 -- df -h /tmp && pct exec 143 -- free -h' +ssh pve-mu-3 'pct exec 143 -- journalctl -u telegraf --since "10 min ago" --no-pager' +ssh pve-mu-3 'pct exec 143 -- journalctl -u brennerstarts --since "10 min ago" --no-pager' +``` + **"Der Brenner scheint nicht erkannt zu werden."** → Vorlauftemperatur `Oelkessel_VL.Vorlauf` anschauen (Grafana „Temperaturverlauf"). Wenn die Amplitude < 30 °C bleibt, ist `MIN_TEMP_BRENNER` zu hoch → in `brennerstarts.py` anpassen. diff --git a/smart-home/scripts/cleanup-raspi-broker-tmp.py b/smart-home/scripts/cleanup-raspi-broker-tmp.py new file mode 100644 index 000000000..70f7cb91f --- /dev/null +++ b/smart-home/scripts/cleanup-raspi-broker-tmp.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +from pathlib import Path +from time import time + +# ioBroker/backitup legt temporaere raspi-broker-TARs in /tmp ab. +# /tmp ist tmpfs und belegt RAM; alte Archive muessen weg. +cutoff = time() - 36 * 3600 +for p in Path('/tmp').glob('raspi-broker-*.tar.gz'): + try: + if p.stat().st_mtime < cutoff: + p.unlink() + except FileNotFoundError: + pass