Hi @Glorious1 , sure, please see below. Sorry, the forum does not allow me to upload an attachment as I am a new user here. Meanwhile, I found a better way to avoid “spinpid.zsh” script failure without changes to “err.diagnostics” function:
- replace “/usr/sbin/smartctl -a” with “/usr/sbin/smartctl -A” (capital A) to read attributes only in “DRIVES_check_adjust” function; and
- comment out “while read…” until “done <<<…” around the following search string “WARNING - Drive %-4s” - to remove the initial drives check – I sense that your “spincheck.zsh” script is better suited for the job and Truenas has sufficient functionality under Data Protection → “Periodic S.M.A.R.T. Tests” to detect failing drives.
Just in case it is relevant: I am running Truenas Community v. 25.04.1 on Supermicro X11SSL-F with one CPU, FANA is a CPU fan and FAN1-4 are case fans in Fractal Design Node 804.
spinpid.zsh Version 2025-06-01
****** SETTINGS ******
Number of fan zones: 2
CPU cooled by fan zone 1; Peripheral (drives) by zone 0
CPU fans min/max duty cycle: 20/100
PER fans min/max duty cycle: 20/100
CPU fans - measured RPMs at 30% and 100% duty cycle: 500/1400
PER fans - measured RPMs at 30% and 100% duty cycle: 500/1400
Drive temperature setpoint (C): 34.8
Number of warmest drives to include in mean: 5
Kp=4, Kd=45
Drive check interval (main cycle; minutes): 5
CPU check interval (seconds): 5
CPU reference temperature (C): 50
CPU scalar: 5
Reading fan duty from board
Key to drive status symbols: * spinning; _ standby; ? unknown
Now in err.diagnostics function
From: "My Server" <nobody@nowhere.com>
To: <you@domain.com>
Subject: spinpid.zsh reports ERROR
On server 'My Server' on Sunday, Jun 15, 16:41:54,
the script ./spinpid.zsh encountered an
error with status "64". It attempted to set fans
to Full mode for safety and then exited.
Last command: /usr/sbin/smartctl -a -n standby "/dev/$LINE" > /tmp/spin_smart
Error message (if any): err.diagnostics:4: bad math expression: operand expected at end of string
err.diagnostics:4: bad math expression: operand expected at end of string
Current variable values follow:
Tarray (raw array of disk temps): --
Tarr2 (array sorted and reduced to NUMKEEP): --
Tmax: --
Tsum: --
Tmean: 0.0
ERRc: 0
PD: 0.0
DUTY_PER: 50
CPU_TEMP: --
DUTY_CPU: 50
Attempting to set fans to Full mode and 100% duty for safety. Bye-bye