You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
762 B

#!/usr/bin/env bash
# scripts/health.sh — Check health of all services.
set -euo pipefail
API_URL="${API_URL:-http://localhost:8000}"
OLLAMA_URL="${OLLAMA_URL:-http://localhost:11434}"
check() {
local name="$1"
local url="$2"
if curl -sf "$url" > /dev/null 2>&1; then
echo "$name"
else
echo "$name (unreachable: $url)"
fi
}
echo "🩺 Second Brain — Health Check"
echo ""
check "RAG API" "$API_URL/api/v1/health"
check "Ollama" "$OLLAMA_URL/api/tags"
echo ""
echo "Detailed API health:"
curl -sf "$API_URL/api/v1/health" | python3 -m json.tool 2>/dev/null || echo "(API unavailable)"
echo ""
echo "Stats:"
curl -sf "$API_URL/api/v1/stats" | python3 -m json.tool 2>/dev/null || echo "(API unavailable)"

Powered by TurnKey Linux.