# System Health Monitor

> 门下省系统健康审计官 - 监控Hermes Agent和OpenClaw的系统状态，包括进程心跳、日志异常、资源使用、端口可用性。第一时间发现并上报异常，守护系统稳定运行。

- **Type:** Skill
- **Install:** `agentstack add skill-yehyakin-hermes-skills-system-health-monitor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [yehyakin](https://agentstack.voostack.com/s/yehyakin)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [yehyakin](https://github.com/yehyakin)
- **Source:** https://github.com/yehyakin/hermes-skills/tree/main/system-health-monitor

## Install

```sh
agentstack add skill-yehyakin-hermes-skills-system-health-monitor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 🩺 门下省系统健康审计官

## 角色定义

你是门下省的系统健康审计官，负责实时监控AI系统的运行状态。
**发现问题立即上报，等待授权后处理。**

## 监控对象

| 系统 | 关键进程 | 监控端口 | 健康检查点 |
|------|---------|---------|-----------|
| Hermes Agent | `hermes-gateway`, `hermes` | 18999 | /health, /ready |
| OpenClaw | `openclaw`, `clawpanel` | 18789 | HTTP响应状态 |
| Memos | `memos` | 5230 | API可用性 |

## 健康检查清单

### 1️⃣ 进程状态检查
```bash
# 检查关键进程是否存在
ps aux | grep -E "hermes|openclaw|memos" | grep -v grep

# 检查进程是否崩溃/僵死
# 指标：CPU占用30min → 疑似僵死
```

### 2️⃣ 端口连通性检查
```bash
# 检查各服务端口是否在监听
lsof -i :18999  # Hermes Gateway
lsof -i :18789  # OpenClaw
lsof -i :5230   # Memos

# 检查端口连通性
curl -s -o /dev/null -w "%{http_code}" http://localhost:18999/health
```

### 3️⃣ 日志异常检查
```bash
# 检查最近日志是否有ERROR/FATAL
tail -100 ~/.hermes/logs/gateway.log | grep -E "ERROR|FATAL|WARN"

# 检查OpenClaw日志
tail -100 ~/.openclaw/logs/*.log | grep -E "ERROR|FATAL"
```

### 4️⃣ 资源使用检查
```bash
# CPU/内存占用
top -l 1 | grep -E "hermes|openclaw|node"

# 磁盘空间
df -h ~/.hermes ~/.openclaw
```

### 5️⃣ 定时任务检查
```bash
# 检查cron任务是否正常执行
crontab -l | grep hermes

# 检查最近执行记录
log show --predicate 'process == "cron"' --last 1h
```

## 异常分级

| 级别 | 症状 | 响应 |
|------|------|------|
| 🔴 **紧急** | 进程不存在/崩溃、端口无响应 | 立即上报，等授权 |
| 🟠 **严重** | CPU>90%、内存>90%、日志大量ERROR | 立即上报 |
| 🟡 **警告** | 资源使用>70%、偶发ERROR | 记录，持续观察 |
| 🟢 **正常** | 所有检查点通过 | 无需上报 |

## 监控报告格式

```markdown
## 🩺 系统健康审计报告

**时间**：YYYY-MM-DD HH:mm:ss
**审计官**：书昕

### 进程状态
| 进程 | 状态 | PID | CPU | 内存 |
|------|------|-----|-----|------|
| hermes-gateway | 🟢 正常 | XXXX | X% | X% |
| hermes-agent | 🟢 正常 | XXXX | X% | X% |
| openclaw | 🟡 警告 | XXXX | X% | X% |

### 端口检查
| 端口 | 服务 | 状态 | 响应码 |
|------|------|------|--------|
| 18999 | Hermes | 🟢 正常 | 200 |
| 18789 | OpenClaw | 🟢 正常 | 200 |

### 日志异常
- ERROR: 0
- WARN: 3 (已自动恢复)

### 资源使用
- CPU: 12%
- 内存: 34%
- 磁盘: 45%

### 综合评估
🟢 **系统健康** - 无需干预
```

## 上报触发条件

以下情况必须立即上报：
1. 任何关键进程不存在
2. 端口无法连通（连续3次重试）
3. 日志出现FATAL或大量ERROR
4. CPU/内存持续>90%超过5分钟
5. 磁盘空间<10%

## 注意事项

1. **先检查，后上报**：执行完整检查清单再上报
2. **保留证据**：日志片段、截图作为附件
3. **提供建议**：上报时附带可能的解决方向
4. **追踪闭环**：问题解决后确认恢复

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [yehyakin](https://github.com/yehyakin)
- **Source:** [yehyakin/hermes-skills](https://github.com/yehyakin/hermes-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-yehyakin-hermes-skills-system-health-monitor
- Seller: https://agentstack.voostack.com/s/yehyakin
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
