WCS Helper: Server Skill
Your server's caretaker — quietly monitors health, tells you only when something needs your attention.
What It Does
| Problem | How It Helps |
|---|
| Memory running high | Shows which processes are eating RAM, tells you how to fix |
| Disk full |
Finds what's taking up space, cleans it up |
| Too many background processes | Finds and removes stuck/zombie processes |
| Server slow | Diagnoses the root cause |
Default behavior: no alerts unless something needs action. No noise.
One-Command Health Check
CODEBLOCK0
Output looks like:
CODEBLOCK1
Status colors: ✅ OK / ⚠️ Warning / 🚨 Alert
Quick Fix Commands
Run these when something is wrong:
CODEBLOCK2
Rule: Preview mode (no --execute) never changes anything. Safe to run.
When to Use
| Situation | Command |
|---|
| Server feels slow | INLINECODE1 — see what's wrong |
| "Disk full" warning |
auto-fix.sh --preview disk →
auto-fix.sh --execute disk |
| Too many processes |
auto-fix.sh --preview zombie →
auto-fix.sh --execute zombie |
| Just checking in |
health-check.sh --summary — 1-line status |
Alerts (Optional)
Enable automatic alerts to Feishu when issues are found:
CODEBLOCK3
Without a cron, the skill runs on demand only. Add it to get automatic alerts.
What Gets Alerted
Only these trigger a push:
- - Memory above 50% with leaky processes
- Disk above 90% full
- Zombie/stuck processes detected
- Cron job failures
Everything else is logged only, no push.
Architecture
CODEBLOCK4
- -
health-check.sh: No changes, just reports. Run anytime. - INLINECODE8 : With
--preview = safe, shows what would happen. With --execute = applies changes.
Troubleshooting
"Permission denied"
Use
sudo: INLINECODE12
"Command not found"
The skill is installed at
~/.openclaw/skills/wcs-helper-server-skill/. Use the full path or
cd there first.
"Nothing happens when I run --execute"
Preview mode (
--preview) is default. You need
--execute to apply changes.
"Alerts not coming through"
- 1. Check Feishu is connected: INLINECODE17
- Verify the cron is running: INLINECODE18
- Test manually: INLINECODE19
Self-Test
Verify the skill is working:
CODEBLOCK5
Expected: Step 1 shows a status table. Step 2 shows what would be cleaned. Step 3 sends a Feishu card.
Uninstall
CODEBLOCK6
No system changes remain after uninstall.
WCS Helper: 服务器技能
你的服务器管家——静默监控运行状况,只在需要你关注时发出提醒。
功能说明
| 问题 | 解决方案 |
|---|
| 内存占用过高 | 显示哪些进程在消耗内存,并告知修复方法 |
| 磁盘空间不足 |
查找占用空间的文件,进行清理 |
| 后台进程过多 | 查找并清除卡死/僵尸进程 |
| 服务器运行缓慢 | 诊断根本原因 |
默认行为: 无需操作时不发出警报,保持静默。
一键健康检查
bash
完整诊断报告
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/health-check.sh
输出示例:
=== 系统负载 ===
负载:1.2(4核)— 正常
=== 内存 ===
内存:已使用67% — 正常
可用:2.1 GB
=== 磁盘 ===
磁盘:已使用43% — 正常
最大占用:/var/log(4.2 GB)
状态颜色: ✅ 正常 / ⚠️ 警告 / 🚨 警报
快速修复命令
出现问题时运行以下命令:
bash
预览修复效果(安全模式 — 显示将要更改的内容)
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --preview all
实际执行内存修复(重启内存占用高的进程)
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --execute memory
清理磁盘空间
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --execute disk
移除卡死进程
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --execute zombie
规则: 预览模式(不带 --execute)不会更改任何内容,可安全运行。
使用场景
| 情况 | 命令 |
|---|
| 服务器感觉变慢 | health-check.sh — 查看问题所在 |
| 磁盘空间不足警告 |
auto-fix.sh --preview disk → auto-fix.sh --execute disk |
| 进程过多 | auto-fix.sh --preview zombie → auto-fix.sh --execute zombie |
| 例行检查 | health-check.sh --summary — 单行状态显示 |
警报(可选)
启用自动向飞书发送问题警报:
bash
添加到 crontab — 每30分钟检查一次,必要时发出警报
运行:crontab -e(然后粘贴以下行)
每30分钟:健康检查 + 发现问题时发送飞书警报
/30 * sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh all 2>&1 | tee -a /var/log/server-alerts.log
每天凌晨2点:完整预览(安全模式 — 不实际更改)
0 2
* sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --preview all >> /var/log/server-auto-fix.log 2>&1
不设置 cron 时,技能仅按需运行。添加后可获得自动警报。
触发警报的条件
只有以下情况会触发推送:
- - 内存超过50%且存在内存泄漏进程
- 磁盘使用超过90%
- 检测到僵尸/卡死进程
- Cron任务执行失败
其他情况仅记录日志,不进行推送。
架构说明
health-check.sh — 只读诊断(始终安全)
auto-fix.sh — 更改系统状态(需要 --execute 参数才能生效)
- - health-check.sh:不进行任何更改,仅报告信息。可随时运行。
- auto-fix.sh:使用 --preview 参数时安全,显示将要执行的操作。使用 --execute 参数时实际应用更改。
故障排除
权限不足
使用 sudo:sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/health-check.sh
命令未找到
技能安装在 ~/.openclaw/skills/wcs-helper-server-skill/ 目录下。请使用完整路径或先 cd 到该目录。
运行 --execute 时没有任何反应
预览模式(--preview)为默认模式。需要使用 --execute 参数才能应用更改。
未收到警报
- 1. 检查飞书是否已连接:openclaw status
- 验证 cron 是否在运行:crontab -l | grep server-skill
- 手动测试:CRON_MODE=1 bash auto-fix.sh --execute memory
自检
验证技能是否正常工作:
bash
1. 健康检查(在此服务器上应始终无需 sudo 即可运行)
bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/health-check.sh --summary
2. 预览模式(应显示当前状态)
sudo bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --preview all
3. 通知测试(发送飞书卡片)
DISABLE
NOTIFY=0 CRONMODE=1 bash ~/.openclaw/skills/wcs-helper-server-skill/scripts/auto-fix.sh --preview memory
预期结果:步骤1显示状态表格。步骤2显示将要清理的内容。步骤3发送飞书卡片。
卸载
bash
从 crontab 中移除
crontab -e # 删除包含 wcs-helper-server-skill 的行
删除技能文件
rm -rf ~/.openclaw/skills/wcs-helper-server-skill
卸载后不会残留任何系统更改。