Files
hx-ki.com2/hxki_brain_fullcheck.sh
2026-03-06 15:22:40 +00:00

119 lines
2.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# HXKI · BRAIN FULLCHECK
# ZEIGT ALLES. KEINE SPEICHERDATEIEN. NUR TERMINAL.
# Prüft:
# - Container
# - Netzwerke
# - Ports
# - Postgres
# - ChromaDB
# - Ollama
# - n8n
# - NATS
# - Workspace
set -euo pipefail
echo "=== HXKI · BRAIN FULLCHECK ==="
echo
# --------------------------
# 1) Containerstatus
# --------------------------
echo "[1] Container laufen / fehlen:"
REQUIRED=(
"hxki-brain-ollama"
"hxki-brain-chroma"
"hxki-brain-postgres"
"hxki-brain-n8n"
"hxki-nats-nbg"
"hxki-node-exporter"
)
running=$(docker ps --format '{{.Names}}')
all=$(docker ps -a --format '{{.Names}}')
for c in "${REQUIRED[@]}"; do
if ! grep -Fxq "$c" <<< "$all"; then
echo " FEHLT: $c"
continue
fi
if grep -Fxq "$c" <<< "$running"; then
echo " OK RUN: $c"
else
echo " STOPPED: $c"
fi
done
echo
# --------------------------
# 2) Netzwerkverdrahtung
# --------------------------
echo "[2] Netzwerk hxki-internal:"
netlist=$(docker network inspect hxki-internal --format '{{range $id,$c := .Containers}}{{ $c.Name }}{{"\n"}}{{end}}' || true)
for c in "${REQUIRED[@]}"; do
if grep -Fxq "$c" <<< "$netlist"; then
echo " OK NET: $c"
else
echo " NO NET: $c"
fi
done
echo
# --------------------------
# 3) Workspace-Struktur
# --------------------------
echo "[3] Workspace:"
WS="/data/HXKI_WORKSPACE"
if [[ ! -d "$WS" ]]; then
echo " FEHLT: $WS"
else
echo " OK: $WS"
for d in incoming events outgoing router; do
if [[ -d "$WS/$d" ]]; then
echo " OK: $WS/$d"
else
echo " FEHLT: $WS/$d"
fi
done
fi
echo
# --------------------------
# 4) Postgres Health
# --------------------------
echo "[4] Postgres:"
docker exec hxki-brain-postgres pg_isready -U postgres || echo " FEHLT: pg_isready"
echo
# --------------------------
# 5) ChromaDB Health
# --------------------------
echo "[5] Chroma:"
docker exec hxki-brain-chroma ls /chroma || echo " KEIN /chroma"
echo
# --------------------------
# 6) Ollama Health
# --------------------------
echo "[6] Ollama:"
curl -s http://localhost:11434/api/tags || echo " OLLAMA NICHT ERREICHBAR"
echo
# --------------------------
# 7) NATS Health
# --------------------------
echo "[7] NATS:"
curl -s localhost:8222/varz || echo " NATS NICHT ERREICHBAR"
echo
# --------------------------
# 8) n8n Reachability
# --------------------------
echo "[8] n8n:"
curl -s localhost:5678 || echo " n8n NICHT ERREICHBAR"
echo
echo "=== ENDE FULLCHECK ==="