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:

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



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>"
   echo "  <value>2</value>"
 echo "  <ValueLookup>prtg.standardlookups.yesno.stateyesok</ValueLookup>"
 echo " </result>"
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.