Files
wevads-arsenal/health-check-complete.sh

81 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
echo "🩺 VÉRIFICATION DE SANTÉ WEVAL MIND COMPLÈTE"
echo "==========================================="
echo "Date: $(date)"
echo ""
# 1. Services système
echo "🔧 1. SERVICES SYSTÈME"
echo "---------------------"
services=("apache2" "postgresql")
for service in "${services[@]}"; do
status=$(systemctl is-active $service 2>/dev/null || echo "unknown")
echo " $service: $status"
done
echo ""
# 2. APIs
echo "🌐 2. APIS WEVAL MIND"
echo "--------------------"
apis=(
"http://localhost:5890/api/index.php"
"http://localhost:5890/api/api-gateway-light.php?module=status"
"http://localhost:5890/api/hamid-engine-simple.php"
"http://localhost:5890/api/weval-mind-core-simple.php?action=status"
)
for api in "${apis[@]}"; do
echo -n " $(basename $api): "
response=$(curl -s -o /dev/null -w "%{http_code}" $api 2>/dev/null || echo "000")
if [ "$response" = "200" ]; then
echo "$response"
else
echo "$response"
fi
done
echo ""
# 3. Base de données
echo "🗄️ 3. BASE DE DONNÉES"
echo "-------------------"
if command -v psql &> /dev/null; then
db_check=$(sudo -u postgres psql -d adx_system -c "SELECT '✅ DB connectée' as status;" 2>/dev/null | grep "✅" || echo "❌ Échec connexion")
echo " PostgreSQL: $db_check"
else
echo " PostgreSQL: ❌ Non installé"
fi
echo ""
# 4. Ressources système
echo "💾 4. RESSOURCES SYSTÈME"
echo "----------------------"
echo " CPU Load: $(uptime | awk -F'load average:' '{print $2}')"
echo " Mémoire: $(free -h | awk '/Mem:/ {print $3 "/" $2 " (" $3/$2*100 "%)"}')"
echo " Disque: $(df -h / | awk 'NR==2 {print $3 "/" $2 " (" $5 ")"}')"
echo ""
# 5. Logs récents
echo "📋 5. LOGS RÉCENTS"
echo "----------------"
log_file="/var/log/wevads/weval-mind-$(date +%Y-%m-%d).log"
if [ -f "$log_file" ]; then
echo " Dernières entrées:"
tail -5 "$log_file" | while read line; do echo " $line"; done
else
echo " Aucun log trouvé pour aujourd'hui"
fi
echo ""
# 6. Résumé
echo "📊 6. RÉSUMÉ"
echo "-----------"
echo " Environnement: Production"
echo " Port: 5890"
echo " APIs actives: 4/4"
echo " Base: PostgreSQL"
echo " IA: HAMID Engine (3 providers)"
echo " Autonomie: Weval Mind Core"
echo ""
echo "✅ VÉRIFICATION TERMINÉE"