49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Hermes Profile Health Checker - verifies spark profile structure.
|
|
Exit 0 = healthy, 1 = issues found, 2 = critical missing
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
PROFILE_DIR = Path("/root/.hermes/profiles/spark")
|
|
EXPECTED_DIRS = ["skills", "plugins", "cron", "memories"]
|
|
|
|
def check_profile():
|
|
issues = []
|
|
|
|
# Check profile dir exists
|
|
if not PROFILE_DIR.exists():
|
|
print("CRITICAL: Profile directory missing")
|
|
return 2
|
|
|
|
# Check config.yaml
|
|
config = PROFILE_DIR / "config.yaml"
|
|
if not config.exists():
|
|
issues.append("config.yaml missing")
|
|
else:
|
|
print(f"OK: {config}")
|
|
|
|
# Check expected directories
|
|
for dirname in EXPECTED_DIRS:
|
|
dirpath = PROFILE_DIR / dirname
|
|
if not dirpath.exists():
|
|
issues.append(f"{dirname}/ missing")
|
|
else:
|
|
print(f"OK: {dirpath}/")
|
|
|
|
# Check magic file
|
|
magic = PROFILE_DIR / ".hermes_profile"
|
|
if magic.exists():
|
|
print(f"OK: {magic}")
|
|
|
|
if issues:
|
|
print("\nIssues:")
|
|
for i in issues:
|
|
print(f" - {i}")
|
|
return 1
|
|
|
|
print("\nProfile is healthy")
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(check_profile()) |