← back to Nas Setup

patches/disk-space-canary-add-nas.md

40 lines

# Patch: add the NAS to disk-space-canary

Apply this **after** the NAS is mounted (so it doesn't log `UNKNOWN` every run).

File: `~/.claude/skills/disk-space-canary/run.sh`

Find the block that probes each unit:

```bash
MAC2=$(probe_unit "Mac2"     df -k /System/Volumes/Data)
MAC1=$(probe_unit "Mac1"     ssh -o ConnectTimeout=8 mac1 df -k /System/Volumes/Data)
KAM=$( probe_unit "Kamatera" ssh -o ConnectTimeout=8 my-server df -k /)
HEN=$( probe_unit "Henry"    df -k /Volumes/Henry)
```

Add two NAS lines (one per share — point at the actual mount names):

```bash
NAS4=$(probe_unit "NAS-Archive" df -k /Volumes/DW-Archive)   # 4TB share
NAS2=$(probe_unit "NAS-Backups" df -k /Volumes/DW-Backups)   # 2TB share
```

Then add them to the RESULTS aggregation a few lines down. Change:

```bash
RESULTS=$(printf '%s\n%s\n%s\n%s\n' "$MAC2" "$MAC1" "$KAM" "$HEN" | jq -s '.')
```

to:

```bash
RESULTS=$(printf '%s\n%s\n%s\n%s\n%s\n%s\n' "$MAC2" "$MAC1" "$KAM" "$HEN" "$NAS4" "$NAS2" | jq -s '.')
```

That's it — the verdict/transition-alert logic already loops over `RESULTS`, so the NAS
shares get WARN<12% / CRITICAL<7% treatment automatically with no other changes.

> The canary returns `UNKNOWN` (no alert) for any unreachable mount, so a brief NAS
> reboot won't spam you — only a worsening *transition* alerts.