- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
33 lines
918 B
Bash
Executable File
33 lines
918 B
Bash
Executable File
#!/bin/bash
|
|
# Quick health check for a single translator service
|
|
# Usage: ./scripts/health-check.sh [IP]
|
|
# Example: ./scripts/health-check.sh 192.168.11.240
|
|
|
|
IP="${1:-192.168.11.240}"
|
|
|
|
echo "Health check for $IP..."
|
|
|
|
# Health endpoint
|
|
HEALTH=$(curl -s -m 3 http://$IP:9545/health 2>/dev/null)
|
|
|
|
if [ -z "$HEALTH" ]; then
|
|
echo "❌ Service not responding"
|
|
exit 1
|
|
fi
|
|
|
|
echo "$HEALTH" | jq '.' 2>/dev/null || echo "$HEALTH"
|
|
|
|
# Check upstream status
|
|
UPSTREAM_HEALTHY=$(echo "$HEALTH" | grep -o '"healthyCount":[0-9]*' | grep -o '[0-9]*')
|
|
UPSTREAM_TOTAL=$(echo "$HEALTH" | grep -o '"totalCount":[0-9]*' | grep -o '[0-9]*')
|
|
|
|
if [ "$UPSTREAM_HEALTHY" = "$UPSTREAM_TOTAL" ] && [ -n "$UPSTREAM_HEALTHY" ]; then
|
|
echo ""
|
|
echo "✅ All upstream nodes healthy ($UPSTREAM_HEALTHY/$UPSTREAM_TOTAL)"
|
|
exit 0
|
|
else
|
|
echo ""
|
|
echo "⚠️ Upstream status: $UPSTREAM_HEALTHY/$UPSTREAM_TOTAL healthy"
|
|
exit 1
|
|
fi
|