Turn a server disk-usage monitoring file (input.json with a "readings" array of {host, minute, usedPercent}) into disk-alerts.csv listing hosts whose current disk usage is at warning or critical level. Use whenever asked for disk alerts, disk-full reports, or an ops alert list from input.json readings, even if the CSV name isn't mentioned.
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-bdec841b)
---
name: disk-alerts
description: Turn a server disk-usage monitoring file (input.json with a "readings" array of {host, minute, usedPercent}) into disk-alerts.csv listing hosts whose current disk usage is at warning or critical level. Use whenever asked for disk alerts, disk-full reports, or an ops alert list from input.json readings, even if the CSV name isn't mentioned.
---
# Disk alerts
Read `input.json` in the working folder and write `disk-alerts.csv` in the same folder. You can't run code, so follow these steps by hand and be careful.
## Rules
1. **Use only each host's current reading.** Group readings by `host`. The current reading is the one with the **largest `minute`**. Readings may arrive out of time order, so don't just take the last one in the list. If a host has two readings with the same largest minute, use the later one in the list. Earlier readings are ignored. A host that was at 95% but later dropped to 61% gets no alert, and a host that rose later is judged by the later value.
2. **Classify the current `usedPercent`:**
- 90 or higher: `critical`
- 80 to 89: `warning`
- below 80: no alert, so leave the host out
3. **Sort rows** by `used_percent` from highest to lowest. Break ties by `host` in ascending order, comparing character by character (e.g. `app-02` before `ci-05`). Critical rows therefore always come before warning rows.
4. **Write the file** with exactly this header and one row per alerted host:
```
host,level,used_percent
```
Each row is `host,level,used_percent`, where `used_percent` is the current reading as a plain integer with no `%` sign. Use `\n` line endings, no blank lines, no quotes or extra spaces, and a newline after the last row. If no host qualifies, write only the header line.
## Procedure
1. Read `input.json`.
2. Go through the readings and note, per host, the highest minute seen and its usedPercent. Hosts are matched by exact string.
3. Apply the thresholds, sort, and write `disk-alerts.csv`.
4. Re-check: every host appears at most once, each value comes from that host's highest-minute reading, and the order is correct.
## Worked check
Readings: web-03 (min 0: 72, min 5: 86), db-01 (min 0: 93, min 10: 84), cache-02 (min 5: 80), log-04 (min 5: 79).
Current values: web-03 86, db-01 84, cache-02 80, log-04 79 (no alert). Output:
```
host,level,used_percent
web-03,warning,86
db-01,warning,84
cache-02,warning,80
```