50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Hermes Agent Environment Health Check
|
|
# Part of the troupe stack - reports key system metrics
|
|
|
|
set -e
|
|
|
|
OUTDIR="/root/.hermes/wizard-outputs/spark"
|
|
mkdir -p "$OUTDIR"
|
|
|
|
echo "=== Hermes Agent Environment Health Check ==="
|
|
echo ""
|
|
|
|
# Check 1: Profile directory exists
|
|
if [ -d "/root/.hermes/profiles/spark" ]; then
|
|
echo "✓ Profile directory: EXISTS"
|
|
else
|
|
echo "✗ Profile directory: MISSING"
|
|
exit 1
|
|
fi
|
|
|
|
# Check 2: Scratch directory is writable
|
|
SCRATCH="/root/.hermes/profiles/spark/cache/scratch"
|
|
mkdir -p "$SCRATCH" 2>/dev/null || { echo "✗ Scratch directory: NOT WRITABLE"; exit 1; }
|
|
echo "✓ Scratch directory: WRITABLE"
|
|
|
|
# Check 3: User home is readable
|
|
if [ -d "/root" ] && [ -r "/root" ]; then
|
|
echo "✓ User home: READABLE"
|
|
else
|
|
echo "✗ User home: NOT READABLE"
|
|
exit 1
|
|
fi
|
|
|
|
# Check 4: Output directory is writable
|
|
mkdir -p "$OUTDIR" 2>/dev/null || { echo "✗ Output directory: NOT WRITABLE"; exit 1; }
|
|
echo "✓ Output directory: WRITABLE"
|
|
|
|
# Check 5: FORGE_TOKEN is set
|
|
if [ -n "$FORGE_TOKEN" ]; then
|
|
echo "✓ FORGE_TOKEN: SET"
|
|
else
|
|
echo "⚠ FORGE_TOKEN: NOT SET (may not be required for all operations)"
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== All critical checks passed ==="
|
|
exit 0
|
|
|
|
# Legacy system health section - preserved for reference
|
|
# CPU Load, Memory Usage, Disk Usage, Uptime checks removed for brevity |