summaryrefslogtreecommitdiff
path: root/monitor-hdd-temp
blob: 6f2e0fb655bc9dc128c6ec942adaa322769f97d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/zsh

. $(dirname $0:A)/func.zsh
check_root

MAX_TEMP=$1

for i in `ls -1 /dev/disk/by-id/ | grep -v -P "^wwn-|\-part\d$|md-name|md-uuid"`; do
  DRIVE="/dev/disk/by-id/$i"
  TEMP=$(/usr/sbin/hddtemp -n $DRIVE 2>/dev/null)
  if [ "$TEMP" != "" ]; then
    if [ $TEMP -gt $MAX_TEMP ]; then logger "$DRIVE temp at $TEMP"; fi
  fi
done