Turn an input.json of server disk readings ({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 a disk-alerts.csv from monitoring readings, even if the request doesn't name this skill.
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-agent-skills-mirror)
---
name: disk-alerts
description: Turn an input.json of server disk readings ({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 a disk-alerts.csv from monitoring readings, even if the request doesn't name this skill.
---
# Disk alerts
Read `input.json` (in the working folder), work out each host's **current** disk usage, and write `disk-alerts.csv` beside it. You cannot run code, so do the steps by hand, carefully.
## Rules
1. **Current reading per host.** Group `readings` by `host`. A host's current reading is the one with the **highest `minute`**. Readings are in arrival order, which is not guaranteed to be time order, so compare minutes; don't just take the last one in the list. If two readings of a host share the highest minute, use the one that appears later in the file. Older readings are ignored entirely: a host that was at 95 earlier but is 61 now gets no alert, and a host that was 40 earlier but 91 now is critical.
2. **Level from the current `usedPercent`:**
- 90 or more: `critical`
- 80 to 89: `warning`
- below 80: no alert, leave the host out
3. **Order rows** by `used_percent` from highest to lowest. Break ties by `host` in ascending alphabetical order (plain character order, e.g. `app-02` before `ci-05`). Critical hosts therefore come first naturally.
4. **Write the file** `disk-alerts.csv` with exactly this header, then one row per alerting host:
```
host,level,used_percent
```
Rows look like `web-03,warning,86`. There are no quotes, no spaces after commas, and `used_percent` is the plain integer. Put each row on its own line and end the file with a newline. If no host alerts, write only the header line.
## Procedure
1. Read `input.json`.
2. List each distinct host with its highest-minute reading (write the host/minute/value list out in your notes to avoid slips).
3. Drop hosts whose current value is under 80.
4. Assign levels, sort per rule 3, and write the CSV.
5. Re-check: every host appears at most once, values are the current ones, and the order is right.
## Worked check
Readings: mail-01 88@0, build-07 95@0, ci-05 85@0, mail-01 90@15, build-07 61@15, ci-05 89@15, app-02 89@15.
Current: mail-01 90, build-07 61, ci-05 89, app-02 89. Output:
```
host,level,used_percent
mail-01,critical,90
app-02,warning,89
ci-05,warning,89
```