fix: HTTP-Check HEAD statt GET, 15s Timeout, User-Agent

This commit is contained in:
root 2026-03-11 21:17:25 +07:00
parent 63a429c592
commit bb0b9892b6

View file

@ -107,9 +107,10 @@ def check_all() -> list[str]:
if names:
alerts.append(f"⚠️ Keine Logs seit 35+ Min: {', '.join(names)}")
_headers = {"User-Agent": "Mozilla/5.0 (Hausmeister-Bot/1.0 health-check)"}
for check in HTTP_HEALTH_CHECKS:
try:
r = requests.get(check["url"], timeout=10, allow_redirects=True)
r = requests.head(check["url"], timeout=15, allow_redirects=True, headers=_headers)
if r.status_code >= 400:
alerts.append(f"🔴 {check['name']} antwortet mit HTTP {r.status_code}")
except requests.RequestException as e: