Exclude an external shelf by explicit config, not by path shape
Testing on a second host showed the internal/external split cannot be inferred: iz-pve1's MD1200 sits behind its own HBA while iz-pve0's internal drives sit behind a SAS expander, so the previous "pci-*-scsi-*" glob matched every drive on one host and none on the other. DISK_EXCLUDE_PATTERN now names the shelf's HBA per host. Also fixes parse_disk_limit, which used awk's for-in over split fields and so returned 0 or 70 from "0/70" depending on iteration order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,7 @@ systemctl enable --now fan_speed.service
|
||||
| `HDD_LIMIT_CAP` / `SSD_LIMIT_CAP` | `60` / `70` | Ceiling on what a drive may claim |
|
||||
| `TREND_SAMPLES` | `90` | Window length, in passes |
|
||||
| `TREND_RISE_ALARM` | `8` | Degrees of climb that alarms |
|
||||
| `DISK_EXCLUDE_PATTERN` | *(empty)* | by-path substring to skip, e.g. an external shelf's HBA |
|
||||
| `ALERT_EMAIL` | `Servers@ntfy1.izebra.xyz` | |
|
||||
| `ALERT_COOLDOWN` | `3600` | Seconds between repeats of one alarm |
|
||||
| `SMART_CHECK_INTERVAL` | `3600` | Seconds between SMART sweeps |
|
||||
@@ -145,8 +146,12 @@ trusting them anywhere else.
|
||||
- Kernel device names are not stable — a shelf rescan renamed `sdaa`–`sdai` to
|
||||
`sds`–`sdaa` mid-session. Everything resolves through `/dev/disk/by-path` on every
|
||||
pass; never persist an `sdX`.
|
||||
- `DISK_GLOB` matches internal drives only (`pci-*-scsi-*`). Drives behind a SAS expander
|
||||
are a separate enclosure with separate cooling and are deliberately excluded.
|
||||
- **An external shelf must be excluded by hand.** Set `DISK_EXCLUDE_PATTERN` to its HBA's
|
||||
PCI address in the systemd unit. This cannot be inferred: `iz-pve1`'s MD1200 sits behind
|
||||
its own HBA at `pci-0000:04:00.0`, while `iz-pve0`'s *internal* drives sit behind a SAS
|
||||
expander at `pci-0000:02:00.0` — so "behind an expander" identifies an external
|
||||
enclosure on one host and the internal backplane on the other. `iz-pve1` sets it,
|
||||
`iz-pve0` has no shelf and leaves it empty.
|
||||
- Drive temperature limits are read once at startup. They do not change, and `smartctl -x`
|
||||
is far heavier than the `-A` used on the fast loop.
|
||||
- `smartctl -n standby` throughout, so a sleeping drive is skipped rather than spun up
|
||||
|
||||
Reference in New Issue
Block a user