This poll script runs hddtemp with a list of all drives as arguments and reads the output. hddtemp scans each drive's SMART status serially, which scales poorly with a large number of drives.
In lieu of a patch to the actual hddtemp project, optionally use GNU parallel when available to parallelize the call to hddtemp.
In testing a machine with 58 drives I went from a runtime of about 5 seconds per run to 0.5s, a performance improvement of 10x.
Previously, this script was only able to find 26 drives (sda-sdz) due to the use of globbing.
A better strategy for detecting drives would be to use lsblk on systems that support it, failing over to globbing.
This patch adds support both for lsblk and a more comprehensive glob solution with find that will at least catch 26^2 drives.
hddtemp gives inconsistent values in it's current state, after some debugging I was able to resolve the issue by passing -w to the hddtemp command, this will wake-up the drive if it is in a sleep state to gather information.
I had some issues with the netcat / daemon implementation of the module.
netcat was stallingor sometimes netcat did not return the full output of hddtemp.
Running hddtemp directly without running it as a daemon is much more stable for me.
This new version also does not give any stdout output when hddtemp is not installed or when no disks can be found.
Running the script manually on a server does give stderr output for easy debugging.