Fix issues with SMART monitoring script - #2837
Open
pq2 wants to merge 2 commits into
Open
Conversation
Add automatic -d device type detection for smartctl Some drives (especially USB enclosures) require an explicit -d option (e.g. sat, usbjmicron) for smartctl to communicate with them, since the USB bridge is not always recognized automatically. - Add get_smart_device_option() to probe common -d types (sat, sat,12, sat,16, usbjmicron, usbsunplus, usbcypress) and detect the correct one per drive during setup - Run `update-smart-drivedb` before detection to increase the chance smartctl recognizes the bridge without needing a manual -d option - Store detected options per drive in DRIVE_OPTS associative array and use them for the health check and manual troubleshooting hints - Replace the generic DEVICESCAN line in /etc/smartd.conf with explicit per-drive lines carrying the correct -d option (Direct mode) - Embed the detected DRIVE_OPTS directly into the generated weekly notification script as a static array, assuming USB enclosures don't change between runs (no runtime re-detection, no external file) Signed-off-by: pq2 <github@nhelmschmidt.de>
NVMe drives can have many harmless "Invalid Field in Command" entries in their Error Information Log without any real issue, so the existing check for "No Errors Logged" incorrectly flagged healthy NVMe drives (e.g. Samsung 970 EVO) as unhealthy. - Detect NVMe drives by device name (nvme*) and only check the overall "PASSED" health status for them - Keep the existing combined check (No Errors Logged + PASSED) for SATA/ATA drives unchanged
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.
See commit messages
🤖 AI (if applicable)