Install
openclaw skills install @fish1981bimmer/ops-maintenance运维助手 v3.3.10 - 本地/远程/集群监控 (健康检查、日志分析、性能监控、批量操作、密码过期检查、告警通知、定时巡检、Docker健康、SSL证书、安全审计、网络诊断)
openclaw skills install @fish1981bimmer/ops-maintenance专业的运维助手,支持单服务器和多服务器集群监控。
/ops-maintenance network # 网络诊断(ping/dns/port)
/ops-maintenance network <host> # 指定主机检测
/ops-maintenance report # 集群状态摘要报告
/ops-maintenance audit # 查看审计日志统计
/ops-maintenance docker # Docker容器健康检查
/ops-maintenance ssl # SSL证书检查
/ops-maintenance security # 安全配置审计
/ops-maintenance user@host password # 远程服务器密码过期检查
/ops-maintenance health # 本地
/ops-maintenance user@host health # 远程 SSH
/ops-maintenance logs [关键词] # 本地
/ops-maintenance user@host logs error # 远程
/ops-maintenance perf
/ops-maintenance ports [端口] # 本地
/ops-maintenance user@host ports 80 # 远程
/ops-maintenance process [名称] # 本地
/ops-maintenance user@host process nginx # 远程
/ops-maintenance disk # 本地
/ops-maintenance user@host disk # 远程
/ops-maintenance password # 检查所有配置服务器的密码过期状态
在 ~/.ssh/config 中配置:
Host myserver
HostName 192.168.1.100
User root
Port 22
IdentityFile ~/.ssh/id_rsa
user@192.168.1.100 health
root@server.com:2222 disk
返回 Markdown 格式结果,包含:
### 🔐 密码过期检查 (本地)
| 用户 | 上次修改 | 过期日期 | 最大天数 | 状态 |
|------|----------|----------|----------|------|
| root | 2024-01-15 | 2024-07-15 | 180 | ✅ 有效 |
| admin | 2024-02-01 | never | 90 | ⚠️ 永不过期 |
| user1 | 2023-11-01 | 2024-01-01 | 60 | ❌ 已过期 |
/ops-maintenance cluster # 查看所有服务器状态
/ops-maintenance cluster @production # 按标签筛选
# 直接添加多个 IP
/ops-maintenance batch-add 192.168.1.100 192.168.1.101 192.168.1.102
# 带端口
/ops-maintenance batch-add 192.168.1.100:2222 192.168.1.101:22
# 带用户
/ops-maintenance batch-add root@192.168.1.100 admin@192.168.1.101
# 完整格式
/ops-maintenance batch-add user@host:port user2@host2:port
# CSV 格式 (多行)
/ops-maintenance import-servers <<EOF
192.168.1.100,22,root,web-1,production;web
192.168.1.101,22,admin,db-1,production;database
EOF
# JSON 格式
/ops-maintenance import-servers [{"host":"192.168.1.100","name":"web-1","tags":["prod"]}]
/ops-maintenance add-server 192.168.1.100 --name web1 --tags production,web
/ops-maintenance remove-server 192.168.1.100
/ops-maintenance exec "df -h" @production # 在 production 组执行
/ops-maintenance exec "uptime" all # 在所有服务器执行
~/.config/ops-maintenance/servers.json~/.config/ops-maintenance/.key[
{
"host": "192.168.1.100",
"user": "root",
"name": "web-1",
"tags": ["production", "web"]
},
{
"host": "192.168.1.101",
"user": "admin",
"name": "db-1",
"tags": ["production", "database"]
}
]
/ops-maintenance alert rules # 查看告警规则
/ops-maintenance alert list # 查看活跃告警
/ops-maintenance alert stats # 查看告警统计
/ops-maintenance alert silence <ruleId> <server> [分钟] # 静默告警
/ops-maintenance alert cleanup [天数] # 清理旧告警
/ops-maintenance alert notify email '{"smtpHost":"smtp.qq.com","smtpPort":465,"smtpUser":"xxx","smtpPass":"授权码","from":"xxx","to":["收件人"]}'
/ops-maintenance alert notify feishu '{"webhook":"https://...", "secret":"..."}'
/ops-maintenance alert notify webhook '{"url":"https://..."}'
/ops-maintenance patrol list # 查看巡检任务
/ops-maintenance patrol run # 执行巡检
/ops-maintenance patrol start # 启动定时巡检
/ops-maintenance patrol stop # 停止定时巡检
# 设置语言
export LANG=en_US.UTF-8 # 英文
export LANG=zh_CN.UTF-8 # 中文(默认)
# 运行所有测试
npm test
# 运行核心功能测试(快速)
npm test -- test/core.test.ts
# 运行特定测试
npm test -- --testNamePattern="健康检查"
src-new/
├── core/ # 核心业务逻辑
│ ├── usecases/ # 用例实现
│ └── domain/ # 领域模型
├── infrastructure/ # 基础设施
│ ├── ssh/ # SSH客户端
│ ├── cache/ # 缓存实现
│ └── monitoring/ # 监控策略
├── presentation/ # 表现层
│ └── cli/ # CLI接口
└── config/ # 配置管理
用户命令 → CLI解析 → UseCase → Infrastructure → 外部系统
↓
缓存层
core/usecases/创建新的UseCaseinfrastructure/实现必要的适配器presentation/cli/添加CLI命令container.ts注册依赖# 启用详细日志
DEBUG=* npm start
# 测试单个功能
node run.js health
# 检查配置
cat ~/.config/ops-maintenance/servers.json
提供详细的错误信息: