磁盘空间实时监控与智能告警
简介
自动监控磁盘空间与inode使用率,超限实时告警,预防磁盘占满导致的系统故障
原始描述
Monitors disk space and inode usage on specified paths, alerting when set thresholds are exceeded to prevent disk-full issues.
通过你的 Agent 添加
安装目录:disk-usage-watcher/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Disk Usage Watcher 是一款系统级监控技能,用于持续追踪指定路径的磁盘空间及 inode 使用情况。支持两种触发模式:主动调用(agent 直接执行)与自动巡检(每 15 分钟 cron 任务)。用户可通过 threshold_percent 和 inode_threshold 灵活设定告警阈值(默认 85%),并指定监控路径(默认覆盖所有已挂载分区)。执行后返回结构化数据,包含各挂载点使用率、触发告警详情及整体状态。
显著优点
- 预防性运维:在磁盘占满前主动告警,避免因空间不足导致的服务中断、日志写入失败或数据库崩溃。
- 双维度监控:同时追踪块设备容量(disk space)与文件数量(inode),覆盖两类常见的磁盘耗尽场景。
- 开箱即用:默认监控所有挂载点,无需复杂配置;支持自定义路径,适应容器化、多分区等特殊架构。
- 集成告警:无缝对接
openclaw/notify,告警通道统一,便于接入企业 IM、邮件或 PagerDuty。
潜在缺点与局限性
- 阈值静态化:百分比阈值无法自动适应业务波动(如临时大文件任务),可能产生告警疲劳或漏报。
- 无预测能力:仅反映当前状态,缺乏趋势分析与容量预测(如「按当前增速 3 天后将满载」)。
- 依赖系统命令:底层调用
df 命令,在权限受限的容器或某些沙箱环境中可能执行失败。
- inode 告警噪声:某些场景下 inode 使用率长期偏高但实际无风险(如海量小文件业务),需人工调低敏感度。
适合人群
- SRE / 运维工程师:需保障生产环境磁盘可用性的团队
- DevOps 开发者:在 CI/CD 或容器编排中集成健康检查
- 中小团队自建监控:作为轻量级方案替代 Prometheus Node Exporter 等重型组件
常规风险
- 权限风险:读取所有挂载点需 root 或特定 capability,过度授权可能导致容器逃逸隐患。
- 信息泄露:磁盘路径与容量信息可能暴露系统架构细节,输出日志需脱敏处理。
- 依赖故障级联:若
openclaw/exec 或 openclaw/notify 异常,监控与告警链路同时失效,需设置备用通道。
openclaw/notify,告警通道统一,便于接入企业 IM、邮件或 PagerDuty。- 阈值静态化:百分比阈值无法自动适应业务波动(如临时大文件任务),可能产生告警疲劳或漏报。
- 无预测能力:仅反映当前状态,缺乏趋势分析与容量预测(如「按当前增速 3 天后将满载」)。
- 依赖系统命令:底层调用
df命令,在权限受限的容器或某些沙箱环境中可能执行失败。 - inode 告警噪声:某些场景下 inode 使用率长期偏高但实际无风险(如海量小文件业务),需人工调低敏感度。
适合人群
- SRE / 运维工程师:需保障生产环境磁盘可用性的团队
- DevOps 开发者:在 CI/CD 或容器编排中集成健康检查
- 中小团队自建监控:作为轻量级方案替代 Prometheus Node Exporter 等重型组件
常规风险
- 权限风险:读取所有挂载点需 root 或特定 capability,过度授权可能导致容器逃逸隐患。
- 信息泄露:磁盘路径与容量信息可能暴露系统架构细节,输出日志需脱敏处理。
- 依赖故障级联:若
openclaw/exec 或 openclaw/notify 异常,监控与告警链路同时失效,需设置备用通道。
- 权限风险:读取所有挂载点需 root 或特定 capability,过度授权可能导致容器逃逸隐患。
- 信息泄露:磁盘路径与容量信息可能暴露系统架构细节,输出日志需脱敏处理。
- 依赖故障级联:若
openclaw/exec或openclaw/notify异常,监控与告警链路同时失效,需设置备用通道。
技能正文
Disk Usage Watcher
Description
Monitors disk space and inode usage on specified paths, sending alerts when thresholds are exceeded. Essential for preventing disk-full incidents.
Usage
The agent can call this skill directly or it runs automatically via cron every 15 minutes.
Example Prompts:
- "Check disk space on root partition"
- "Monitor all mount points and alert at 85%"
- "Show me disk usage statistics"
Inputs
threshold_percent: number — Alert when usage exceeds this percentage (default: 85)
inode_threshold: number — Alert when inode usage exceeds this percentage (default: 85)
paths: array — Specific paths to monitor (default: all mounted partitions)
alert_on_failure: boolean — Send alert if check fails (default: true)
Outputs
status: string — "success" or "failure"
details: object — Contains disk_usage array with mount points, usage percentages, and any triggered alerts
Dependencies
openclaw/exec - For running df commands
openclaw/notify - For sending alerts
Testing
openclaw call disk-usage-watcher --params '{"paths": ["/"]}'
threshold_percent: number — Alert when usage exceeds this percentage (default: 85)inode_threshold: number — Alert when inode usage exceeds this percentage (default: 85)paths: array — Specific paths to monitor (default: all mounted partitions)alert_on_failure: boolean — Send alert if check fails (default: true)
Outputs
status: string — "success" or "failure"
details: object — Contains disk_usage array with mount points, usage percentages, and any triggered alerts
Dependencies
openclaw/exec - For running df commands
openclaw/notify - For sending alerts
Testing
openclaw call disk-usage-watcher --params '{"paths": ["/"]}'
status: string — "success" or "failure"details: object — Contains disk_usage array with mount points, usage percentages, and any triggered alertsopenclaw/exec- For running df commandsopenclaw/notify- For sending alerts
Testing
openclaw call disk-usage-watcher --params '{"paths": ["/"]}'
openclaw call disk-usage-watcher --params '{"paths": ["/"]}'
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。