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.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Disk Alerts?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-disk-alerts-1778585e)
---
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.