Skip to content

Instantly share code, notes, and snippets.

@jab416171
Created October 20, 2015 20:11
Show Gist options
  • Save jab416171/c356edec5d8b3a88e8f0 to your computer and use it in GitHub Desktop.
Save jab416171/c356edec5d8b3a88e8f0 to your computer and use it in GitHub Desktop.
#! /bin/sh
for i in $(sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) if (match($i, '/da/')) print $i }')
do
echo $i `smartctl -a /dev/$i | awk '/Temperature_Celsius/{DevTemp=$10;} /Serial Number:/{DevSerNum=$3}; /Device Model:/{DevName=$3} END { print DevTemp,DevSerNum,DevName }'`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment