SPB Git

spb/api-ka

Public

API-KA — plateforme centrale : collecte quotidienne des 8 services KA, historisation append-only et API publique sur www.api-ka.com

758 B · 29 lines shellscript
1#!/usr/bin/env bash2# ============================================3# Projet   : API-KA4# Fichier  : scripts/healthcheck.sh5# Node     : m3u96b6# Author   : Simon-Pierre Boucher7# Contact  : contact@spboucher.ai8# Date     : 2026-08-169# ============================================10# Vérification de santé utilisée par systemd / monitoring.11# Exit 0 si l'API répond et que la base est OK, exit 1 sinon.1213set -uo pipefail1415URL="http://127.0.0.1:${API_PORT:-8000}/health"1617RESPONSE="$(curl -fsS --max-time 10 "$URL" 2>/dev/null)" || {18    echo "❌ API-KA injoignable sur $URL"19    exit 120}2122if echo "$RESPONSE" | grep -q '"database": *"ok"'; then23    echo "✅ API-KA en bonne santé ($URL)"24    exit 025fi2627echo "❌ API-KA dégradée : $RESPONSE"28exit 129
Files · 247c60048efdf8a03f475ea02b4e1f2acf887d0d
Menu

Theme