磁盘监控

DiskMon

by BytesAgain

Watch disk space in real time and alert before storage runs low. Use when monitoring usage, finding large dirs, preventing disk-full events.

4.2k数据与存储未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/ckchzh/diskmon

文档

DiskMon

A sysops toolkit for scanning, monitoring, reporting, alerting, tracking top usage, checking health, fixing issues, cleaning up, backing up, restoring, logging, benchmarking, and comparing disk-related operations — all from the command line with full history tracking.

Commands

CommandDescription
diskmon scan <input>Record and review disk scan entries (run without args to see recent)
diskmon monitor <input>Record and review monitoring entries
diskmon report <input>Record and review report entries
diskmon alert <input>Record and review alert entries
diskmon top <input>Record and review top-usage entries
diskmon usage <input>Record and review usage entries
diskmon check <input>Record and review health check entries
diskmon fix <input>Record and review fix entries
diskmon cleanup <input>Record and review cleanup entries
diskmon backup <input>Record and review backup entries
diskmon restore <input>Record and review restore entries
diskmon log <input>Record and review log entries
diskmon benchmark <input>Record and review benchmark entries
diskmon compare <input>Record and review comparison entries
diskmon statsShow summary statistics across all log files
diskmon export <fmt>Export all data in JSON, CSV, or TXT format
diskmon search <term>Search across all logged entries
diskmon recentShow the 20 most recent activity entries
diskmon statusHealth check — version, data dir, entry count, disk usage
diskmon helpShow usage info and all available commands
diskmon versionPrint version string

Each data command (scan, monitor, report, etc.) works in two modes:

  • With arguments: Logs the input with a timestamp and saves to the corresponding .log file
  • Without arguments: Displays the 20 most recent entries from that command's log

Data Storage

All data is stored locally in ~/.local/share/diskmon/. Each command writes to its own log file (e.g., scan.log, monitor.log, alert.log). A unified history.log tracks all activity across commands with timestamps.

  • Log format: YYYY-MM-DD HH:MM|<input>
  • History format: MM-DD HH:MM <command>: <input>
  • No external database or network access required

Requirements

  • Bash 4+ (uses set -euo pipefail)
  • Standard POSIX utilities: date, wc, du, head, tail, grep, basename, cat
  • No root privileges needed
  • No API keys or external dependencies

When to Use

  1. Tracking disk space trends over time — Use diskmon monitor and diskmon usage to log periodic disk space readings across servers, building a historical record you can search and export
  2. Setting up alert documentation — Use diskmon alert to record threshold breaches and disk-full warnings, creating a searchable incident history
  3. Documenting cleanup and maintenance — Use diskmon cleanup and diskmon fix to keep timestamped logs of what was cleaned, freed, or repaired on which systems
  4. Benchmarking storage performance — Use diskmon benchmark and diskmon compare to log I/O test results and compare performance across different disks or configurations
  5. Generating audit-ready exports — Use diskmon export json to produce a structured file of all logged monitoring activity for capacity planning, compliance reviews, or team handoff

Examples

Log a scan and review history

bash
# Record a scan result
diskmon scan "/dev/sda1: 78% used, 45GB free"

# View recent scan entries
diskmon scan

Monitor, alert, and report workflow

bash
# Log a monitoring observation
diskmon monitor "web-server-01 /var at 91% — nearing threshold"

# Log an alert
diskmon alert "CRITICAL: /data at 98% on prod-db-02"

# Generate a report entry
diskmon report "Weekly disk report: 3 servers above 85% threshold"

# Search across all entries
diskmon search "prod-db"

Cleanup and fix tracking

bash
# Log a cleanup action
diskmon cleanup "Purged 15GB of old logs from /var/log on app-server-03"

# Log a fix
diskmon fix "Extended /home LVM volume by 20GB on dev-server"

# View recent activity
diskmon recent

Export and statistics

bash
# Summary stats across all log files
diskmon stats

# Export everything as JSON
diskmon export json

# Export as CSV for spreadsheet analysis
diskmon export csv

# Health check
diskmon status

Backup, restore, and benchmark

bash
# Log a backup
diskmon backup "Snapshot of /data volume taken at 03:00 UTC"

# Log a restore test
diskmon restore "Verified restore of /etc from snapshot-2025-03-15"

# Log a benchmark result
diskmon benchmark "Sequential write: 480 MB/s on /dev/nvme0n1"

# Compare two benchmark runs
diskmon compare "nvme0n1 vs sda: 480 MB/s vs 210 MB/s sequential write"

How It Works

DiskMon uses a simple case-dispatch architecture in a single Bash script. Each command maps to a log file under ~/.local/share/diskmon/. When called with arguments, the input is appended with a timestamp. When called without arguments, the last 20 lines of that log are displayed. The stats command aggregates entry counts across all logs, export serializes everything into JSON, CSV, or plain text, and search greps across all log files for a given term.

Support


Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

相关 Skills

资深架构师

by alirezarezvani

Universal
热门

适合系统设计评审、ADR记录和扩展性规划,分析依赖与耦合,权衡单体或微服务、数据库与技术栈选型,并输出Mermaid、PlantUML、ASCII架构图。

搞系统设计、技术选型和扩展规划时,用它能更快理清架构决策与依赖关系,还能直接产出 Mermaid/PlantUML 图,方案讨论效率很高。

数据与存储
未扫描11.5k

迁移架构师

by alirezarezvani

Universal
热门

为数据库、API 与基础设施迁移制定分阶段零停机方案,提前校验兼容性与风险,生成回滚策略、验证关卡和时间线,适合复杂系统平滑切换。

做数据库与存储迁移时,用它统一梳理表结构和数据搬迁流程,架构视角更完整,复杂迁移也更稳。

数据与存储
未扫描11.5k

资深数据工程师

by alirezarezvani

Universal
热门

聚焦生产级数据工程,覆盖 ETL/ELT、批处理与流式管道、数据建模、Airflow/dbt/Spark 优化和数据质量治理,适合设计数据架构、搭建现代数据栈与排查性能问题。

复杂数据管道、ETL/ELT 和治理难题交给它,凭 Spark、Airflow、dbt 等现代数据栈经验,能更稳地搭起可扩展的数据基础设施。

数据与存储
未扫描11.5k

相关 MCP 服务

by Anthropic

热门

PostgreSQL 是让 Claude 直接查询和管理你的数据库的 MCP 服务器。

这个服务器解决了开发者需要手动编写 SQL 查询的痛点,特别适合数据分析师或后端开发者快速探索数据库结构。不过,由于是参考实现,生产环境使用前务必评估安全风险,别指望它能处理复杂事务。

数据与存储
83.9k

SQLite 数据库

编辑精选

by Anthropic

热门

SQLite 是让 AI 直接查询本地数据库进行数据分析的 MCP 服务器。

这个服务器解决了 AI 无法直接访问 SQLite 数据库的问题,适合需要快速分析本地数据集的开发者。不过,作为参考实现,它可能缺乏生产级的安全特性,建议在受控环境中使用。

数据与存储
83.9k

by Firecrawl

热门

Firecrawl 是让 AI 直接抓取网页并提取结构化数据的 MCP 服务器。

它解决了手动写爬虫的麻烦,让 Claude 能直接访问动态网页内容。最适合需要实时数据的研究者或开发者,比如监控竞品价格或抓取新闻。但要注意,它依赖第三方 API,可能涉及隐私和成本问题。

数据与存储
6.1k

评论