PRTG Advanced SSH Sensor for Monitoring the SMART Values of Independent Hard Drives On Linux

I have a github repository with updated versions of these PRTG sensors at: https://github.com/andygajetzki/prtg-sensors

Create a new sensor in /var/prtg/scriptsxml with the following contents:

#!/bin/sh

SMARTCTL="/usr/sbin/smartctl"

echo "<prtg>"
for DEVICE in `$SMARTCTL --scan-open | grep -o "^/dev/[a-z]*"`; do 
 echo " <result>"
 echo "  <channel>SMART OK: $DEVICE</channel>"
 $SMARTCTL -H $DEVICE > /dev/null 2>&1
 if [ "$?" -eq 0 ]; then
   echo "  <value>1</value>"
 else
   echo "  <value>2</value>"
 fi;
 echo "  <ValueLookup>prtg.standardlookups.yesno.stateyesok</ValueLookup>"
 echo " </result>"
done;
echo "</prtg>"

Ensure you have smartmontools installed on your system. smartctl is used to scan for available devices and returns the status of SMART on devices it discovers.