Bring script headers onto the template and close safeguard gaps
Headers claimed protections the code never had, and several destructive paths had no guard against a collapsed config value.
This commit is contained in:
@@ -19,6 +19,26 @@
|
||||
# from master.conf if dynamix.cfg is not found.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# OPERATIONAL MODEL
|
||||
# ==============================================================================================
|
||||
#
|
||||
# 1. Validate smartctl is present (platform_require_cmd)
|
||||
# 2. Resolve temperature thresholds — dynamix.cfg first, master.conf as fallback
|
||||
# 3. Enumerate drives, skipping anything in SMART_IGNORE_DRIVES
|
||||
# 4. Per drive, read live SMART attributes and evaluate:
|
||||
# overall status FAILED → critical
|
||||
# Reallocated_Sector_Ct > 0 → concerning
|
||||
# Current_Pending_Sector > 0 → concerning
|
||||
# Offline_Uncorrectable > 0 → critical
|
||||
# Temperature_Celsius vs warn/crit thresholds
|
||||
# Power_On_Hours → informational only
|
||||
# NVMe drives expose different attribute names — detected and mapped automatically.
|
||||
# 5. Report; notify only when something crosses a threshold. Silent when all pass.
|
||||
#
|
||||
# Read-only throughout — this queries attributes the drive already maintains and never
|
||||
# starts a self-test. Running one is smart_long_test.sh's job.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# DESIGN PRINCIPLES
|
||||
# ==============================================================================================
|
||||
#
|
||||
@@ -55,8 +75,9 @@
|
||||
# Reads hot/max/hotssd/maxssd from dynamix.cfg so smart_health.sh and unRAID's
|
||||
# dashboard use the same thresholds. Falls back to master.conf values if not found.
|
||||
#
|
||||
# Notifications Validated
|
||||
# platform_require_cmd confirms smartctl and notify script are present before use.
|
||||
# smartctl Validated
|
||||
# platform_require_cmd confirms smartctl is present before any drive is queried. The
|
||||
# notify script is validated separately by the platform adapter.
|
||||
#
|
||||
# ==============================================================================================
|
||||
# CONFIGURATION
|
||||
|
||||
Reference in New Issue
Block a user