-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemperatures-isilon
executable file
·29 lines (24 loc) · 1.08 KB
/
temperatures-isilon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
find /dev/disk/by-vdev/ -type l | sort | grep -v part |
while read dev; do
if echo "$dev" | grep -q '/hd'; then
type=ata
else
type=auto
fi
# echo " smartctl -d $type -a $dev 2>&1 | grep Temperature_Celsius"
smartctl -d $type -a $dev 2>&1 | grep Temperature_Celsius | \
while read line; do
# 194 Temperature_Celsius 0x0022 048 054 000 Old_age Always - 48 (Lifetime Min/Max 0/23)
# 194 Temperature_Celsius 0x0022 034 055 000 Old_age Always - 34 (0 23 0 0)
set -- `echo "$line"`
shift ; shift ; shift ; shift ; shift ; shift ; shift ; shift ; shift
set -- `echo "$*" | sed -e 's@/@ @' -e 's@(@@' -e 's@)@@'`
tmp1=`echo "$1"`
tmp2=`echo "$2"`
tmp3=`echo "$3"`
[ -z "$tmp2" -o "$tmp2" = "0" ] && tmp2=" "
[ -z "$tmp3" -o "$tmp3" = "0" ] && tmp3=" "
printf "$(basename $dev): +$tmp1°C (low = %-2s°C, high = %-2s°C)\n" "+$tmp2" "+$tmp3"
done
done