Skip to content
Back to skills

Disk Alerts

ASecurity

Use this skill when the user wants a list of disk-full alerts for servers from monitoring readings (host, minute, usedPercent in input.json), such as warning/critical disk usage per host written to disk-alerts.csv. Not for CPU/memory alerts or general disk cleanup.

  • 24 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 6, 2026
devops

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill disk-alerts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Disk Alerts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Disk Alerts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-disk-alerts-1778585e/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-disk-alerts-1778585e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: disk-alerts
description: "Use this skill when the user wants a list of disk-full alerts for servers from monitoring readings (host, minute, usedPercent in input.json), such as warning/critical disk usage per host written to disk-alerts.csv. Not for CPU/memory alerts or general disk cleanup."
---

# Disk alerts

Turn disk-usage readings into a CSV of hosts that need attention, using each host's latest reading.

## Input
- `input.json` in the working folder: `{"readings": [{"host": string, "minute": int, "usedPercent": int 0-100}, ...]}`.
- Readings are in arrival order, which may not be time order. Do not rely on position.
- If `input.json` is missing or has no `readings` array, stop and tell the user; do not guess.

## Steps
1. Read `input.json`.
2. Group readings by `host` (exact, case-sensitive string match).
3. For each host pick the **latest** reading: the one with the greatest `minute`. If two readings of a host share the greatest minute, use the one appearing later in the file. Ignore all earlier readings, even if they were higher.
4. Classify that latest `usedPercent` (P):
   - P >= 90 → `critical`
   - 80 <= P <= 89 → `warning`
   - P < 80 (including 0) → no alert; omit the host.
   - Out-of-range values are not expected; apply the same formulas literally (e.g. 100 is critical, negative is no alert).
5. Sort alerts: `used_percent` descending; ties by `host` ascending (plain character-code order, e.g. `app-02` before `ci-05`). Critical hosts naturally come first.
6. Write `disk-alerts.csv` beside `input.json` (overwrite if present).

## Output format
- First line exactly `host,level,used_percent`.
- One line per alert: `host,level,used_percent` with the integer as-is, no quotes, no spaces.
- Newline `\n` after each line, including the last.
- If no host alerts, the file contains only the header line.

## Worked example
Readings: web-03@0=72, db-01@0=93, cache-02@5=80, web-03@5=86, log-04@5=79, db-01@10=84.
Latest: web-03=86, db-01=84, cache-02=80, log-04=79 (no alert).
```csv
host,level,used_percent
web-03,warning,86
db-01,warning,84
cache-02,warning,80
```
Note db-01's earlier 93 is ignored because its latest reading is 84.

## Checks before finishing
- Each host appears at most once.
- Every row's value matches that host's greatest-minute reading.
- Re-read the written file to confirm the header and ordering.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.