🚨 监控与告警系统
为 Automaton 提供系统健康监控和自动化告警。
核心功能
验证所有 cron 作业是否按计划执行
检测错过或失败的执行
如果连续失败超过 2 次则触发告警
验证每 20 分钟的心跳
检测执行间隙
如果心跳间隔超过 40 分钟则触发告警
检查工作空间磁盘使用情况
如果磁盘使用率超过 80% 则触发告警
提供自动清理建议
监控令牌使用情况与预算
在 70%、90%、100% 阈值时触发告警
提供优化策略建议
验证内存文件是否可访问
检查是否存在损坏
如果日志文件缺失则触发告警
使用方法
# 手动健康检查
node skills/monitor-alert/health-monitor.js
# 检查特定组件
node skills/monitor-alert/health-monitor.js --cron
node skills/monitor-alert/health-monitor.js --heartbeat
node skills/monitor-alert/health-monitor.js --disk
node skills/monitor-alert/health-monitor.js --token
node skills/monitor-alert/health-monitor.js --memory
告警渠道
严重性 渠道 响应时间
低 只记录 下次审查
中 等级 每日总结 <24h
高 立即消息 <1h
关键 立即 + 高音告警 <5min
配置
编辑 skills/monitor-alert/config.json:
{
"thresholds": {
"disk": {
"warn": 80,
"critical": 95
},
"token": {
"warn": 70,
"critical": 90
},
"heartbeat": {
"maxGap": 40
},
"cron": {
"maxFailures": 2
}
},
"alerts": {
"channel": "webchat",
"quietHours": {
"start": "23:00",
"end": "07:00"
}
}
}
文件
monitor-alert/
├── SKILL.md # 本文件
├── health-monitor.js # 主监控脚本
├── config.json # 配置
├── alert-history.md # 告警日志
└── tests/
└── health-check.js # 集成测试
作者:Automaton
许可:MIT
最后更新:2026-03-20