← 返回 Skills 市场
newageinvestments25-byte

Disk Guardian

作者 New Age Investments · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
116
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install disk-guardian
功能描述
Run S.M.A.R.T. diagnostics on all drives, parse health indicators, maintain a history log, and flag drives showing early failure patterns. Generates health s...
使用说明 (SKILL.md)

disk-guardian

S.M.A.R.T. drive health scanner for macOS and Linux.

Scripts

All scripts are in scripts/. Run them in sequence or pipe them together:

cd ~/.openclaw/workspace/skills/disk-guardian/scripts

# Full pipeline (may need sudo on Linux):
python3 scan_drives.py | python3 parse_smart.py | python3 report.py

# With sudo (required on many Linux systems):
python3 scan_drives.py --sudo | python3 parse_smart.py | python3 report.py

# Save report to file:
python3 scan_drives.py | python3 parse_smart.py | python3 report.py --output ~/disk-report.md

# Record scan to history and get trend analysis:
python3 scan_drives.py | python3 parse_smart.py | python3 history.py --record

Data is stored in ~/.openclaw/workspace/disk-guardian/ by default. Use --data-dir to override on any script.

Workflow

  1. Run scan_drives.py — detects drives and runs smartctl -a on each. Outputs JSON.
  2. Pipe to parse_smart.py — extracts health attributes, assesses status (Good/Warning/Critical).
  3. Pipe to report.py — generates markdown report with risk rankings and recommendations.
  4. Optionally pipe to history.py --record to log the scan and get trend alerts.

Prerequisites

smartctl must be installed:

  • macOS: brew install smartmontools
  • Linux: sudo apt install smartmontools or sudo dnf install smartmontools

If smartctl is missing, scan_drives.py will output the install command and exit gracefully.

Script Details

scan_drives.py

  • macOS: uses diskutil list to find whole disks, then smartctl -a /dev/diskN
  • Linux: uses lsblk to find block devices, then smartctl -a /dev/sdX
  • --sudo: prepend sudo to smartctl commands (needed on Linux without udev rules)
  • Outputs JSON: {os, smartctl_path, drives_found, scan_results: [{device, smartctl_output|error}]}

parse_smart.py

  • Detects drive type: NVMe, SSD, or HDD
  • SATA/SSD: parses attribute table, extracts Reallocated Sector Count, Current Pending Sector, Uncorrectable Errors, Temperature, Power-On Hours, Read Error Rate, Seek Error Rate, and more
  • NVMe: parses health log for Available Spare, Percentage Used, Media Errors, Unsafe Shutdowns, Critical Warning
  • Assigns health_status: Good / Warning / Critical
  • --input FILE: read from file instead of stdin
  • --raw FILE --device NAME: parse a single raw smartctl text dump

history.py

  • --record: append current scan to ~/.openclaw/workspace/disk-guardian/history.json
  • --trends: analyze stored history for concerning patterns (rising reallocated sectors, climbing temps, declining NVMe spare)
  • --list [--limit N]: show last N entries per device
  • --data-dir PATH: use alternate storage location
  • --device /dev/diskN: filter output to one device

report.py

  • Generates markdown with drive inventory table, per-drive status, risk ranking with scores, human-readable flag explanations, trend alerts, and recommendations
  • Risk ranking accounts for health status, flag severity, trend alerts, and drive age (power-on hours)
  • --output FILE: save report to file instead of printing
  • --trends FILE: load pre-computed trend JSON

SMART Attribute Reference

See references/smart-attributes.md for plain-English explanations of the 10 most critical SMART attributes and NVMe health indicators. Read it when explaining specific attributes to the user or when triaging a flagged drive.

Edge Cases

  • smartctl not installed: scan_drives.py prints install instructions and exits with code 2
  • Permission denied: Output includes hint to use --sudo; on Linux, add user to disk group as permanent fix
  • Virtual drives (VMware, loop devices): smartctl will return errors; these are captured and included in error entries
  • NVMe vs SATA: drive type auto-detected; NVMe uses health log fields instead of attribute table
  • Corrupt history: history.py backs up the file and starts fresh automatically
安全使用建议
This skill appears to do what it says: local S.M.A.R.T. scans, parsing, reporting, and a local history. Before installing/running: 1) Ensure you have python3 and smartctl (smartmontools) installed; the scripts run smartctl and may need sudo on Linux. 2) The scripts will probe block devices and write history to ~/.openclaw/workspace/disk-guardian (use --data-dir to change); review or run the code manually if you want to inspect behavior first. 3) Running with --sudo will run smartctl as root — only do this if you trust the code; consider running a single scan and reviewing the parsed JSON before recording history. 4) If you have privacy concerns, inspect history.json contents (it stores model/serial, temperatures, flags, timestamps) and choose an alternate data-dir or remove history after use.
功能分析
Type: OpenClaw Skill Name: disk-guardian Version: 1.0.0 The disk-guardian skill bundle is a legitimate utility designed to perform S.M.A.R.T. disk diagnostics and trend analysis on macOS and Linux. The scripts (scan_drives.py, parse_smart.py, history.py, and report.py) use standard system commands like smartctl, diskutil, and lsblk to gather hardware health data and store it locally in the user's workspace. No evidence of data exfiltration, network activity, or malicious intent was found; the code follows secure practices for subprocess execution and handles sensitive hardware access transparently.
能力评估
Purpose & Capability
Name/description match the included scripts: scan_drives.py runs smartctl, parse_smart.py parses outputs, report.py generates markdown, and history.py records trends. No extraneous credentials, unrelated binaries, or surprising capabilities are requested.
Instruction Scope
SKILL.md instructions stay on scope: detect drives, run smartctl, parse results, generate reports, and optionally record history under ~/.openclaw/workspace/disk-guardian. The scripts may require sudo for smartctl on Linux and expect python3 on PATH (python requirement is implied but not explicitly listed). No instructions to read unrelated system files or transmit data externally.
Install Mechanism
No install spec; this is an instruction + script bundle. The only external prerequisite is smartctl (smartmontools) which the README documents; the skill does not download/extract code from external URLs or install packages automatically.
Credentials
The skill requests no environment variables or external credentials. It writes and reads a history file under the user's home (~/.openclaw/workspace/disk-guardian) which is proportional to its stated purpose. It may suggest adding a user to a 'disk' group or using sudo for permissions — expected for disk access.
Persistence & Privilege
always:false and normal autonomous invocation defaults. The skill stores history only in its own data directory under the user's home and does not modify other skills or system-wide agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install disk-guardian
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /disk-guardian 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: S.M.A.R.T. drive health scanner for macOS and Linux. Scans drives, parses health indicators, maintains history, flags early failure patterns.
元数据
Slug disk-guardian
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Disk Guardian 是什么?

Run S.M.A.R.T. diagnostics on all drives, parse health indicators, maintain a history log, and flag drives showing early failure patterns. Generates health s... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 116 次。

如何安装 Disk Guardian?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install disk-guardian」即可一键安装,无需额外配置。

Disk Guardian 是免费的吗?

是的,Disk Guardian 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Disk Guardian 支持哪些平台?

Disk Guardian 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Disk Guardian?

由 New Age Investments(@newageinvestments25-byte)开发并维护,当前版本 v1.0.0。

💬 留言讨论