Repository navigation
Add a disk-health example task, written in Python - #16
Merged
Merged
Conversation
A third example task that reads every disk's SMART data once an hour and alerts on a failed health check, reallocated or unreadable sectors, an SSD near the end of its rated life, NVMe warnings and overheating. A disk that is spun down is left asleep and skipped, and problems are reported under Unraid's name for the disk. It is written in Python inside check.sh, so the examples also show that pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A third example task,
disk-health, next topool-healthanddaily-digest. Once an hour it reads the SMART data of every disk and stays quiet when all is well. It alerts on:How it behaves
smartctl -n standby, so a spun-down disk is skipped and only looked at when a check finds it awake.hostcall for all disks, plus one for Unraid's disk list.parity (model, serial): 8 reallocated sectors; a disk without a slot is named by its device.smartctlis quiet; a failedhostcall is reported.It is written in Python inside
check.sh(exec python3 - <<'PY'), so the examples now also show that pattern, which the base instructions point to.Existing installs
Examples are copied only on a first start, so an existing install does not get this one by itself.
docs/tasks.mdsays to ask Claude to copy it from/usr/local/share/berthward/task-examples/disk-health.Testing
tests/run.sh: seven new checks with made-up SMART data (healthy disks and a sleeping disk are quiet; failing SATA, SSD and NVMe disks are reported one line each under Unraid's name; no disks, nosmartctl, a failedhostcall, a disk that does not answer). All 496 pass./run disk-health.