!!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!! This script has now been replaced with a MUCH simplier but also MUCH faster script using "smartctl" instead of SNMP.
It can be found here: https://github.com/wallacebrf/SMART-to-InfluxDB-Logger
This script using SNMP took 1 minute and 22 seconds to execute on a Synology NAS with 9x HDDs and no NVME drives. The new version using smartctl takes seconds.