Lines Matching +full:i +full:- +full:drive
7 smart: Show SMART temperature and error stats (specific to drive type)
8 smartx: Show SMART extended drive stats (specific to drive type).
9 temp: Show SMART drive temperature in celsius (all drives).
11 r_proc: Show SMART read GBytes processed over drive lifetime (SAS).
12 w_proc: Show SMART write GBytes processed over drive lifetime (SAS).
15 nonmed: Show SMART non-medium errors (SAS).
17 hours_on: Show number of hours drive powered on (all drives).
27 smart_test: Show SMART self-test results summary.
28 test_type: Show SMART self-test type (short, long... ).
29 test_status: Show SMART self-test status.
30 test_progress: Show SMART self-test percentage done.
31 test_ended: Show when the last SMART self-test ended (if supported).
46 # is chosen quasi-sequentially (based off our PID). This allows us to return
53 num_files=$(find "$dir" -maxdepth 1 -type f | wc -l)
55 i=0
56 find "$dir" -type f -printf '%f\n' | while read -r file ; do
57 if [ "$mod" = "$i" ] ; then
61 i=$((i+1))
67 if [ "$1" = "-h" ] ; then
68 echo "$helpstr" | grep "$script:" | tr -s '\t' | cut -f 2-
75 if [ ! -b "$VDEV_UPATH" ]; then
81 if [ -b "$somepath" ] && PATH="/usr/sbin:$PATH" command -v smartctl > /dev/null || [ -n "$samples" ] ; then
82 if [ -n "$samples" ] ; then
89 raw_out=$(sudo smartctl -a "$somepath")
92 # What kind of drive are we? Look for the right line in smartctl:
107 /Non-medium error count/{print "nonmed="$4}
112 /Drive Temperature:/{print "temp="$4}
114 /SMART Health Status:/{printf "health="; for(i=4;i<=NF-1;i++){printf "%s_", $i}; printf "%s\n", $i}
132 /SMART overall-health self-assessment test result:/{print "health="$6}
139 /SMART overall-health self-assessment test result:/{print "health="$6}
140 /Power On Hours:/{gsub("[^0-9]","",$4); print "hours_on="$4}
147 # SMART self-test info
148 /Self-test execution status:/{progress=tolower($4)} # SAS
149 /SMART Self-test log/{test_seen=1} # SAS
150 /SMART Extended Self-test Log/{test_seen=1} # SATA
164 hours=int($(NF-4))
166 hours=int($(NF-1))
169 progress=(100-int($(NF-2)))"%"
171 # When we int()-ify "hours", it converts stuff like "NOW" and "-" into
185 total_hours_ago=(hours_on-hours)
199 type=$(echo "$out" | grep '^type=' | cut -d '=' -f 2)
204 if [ -z "$type" ]; then
211 # Print temperature plus common predictors of drive failure
237 with_vals=$(echo "$out" | grep -E "$scripts")
238 if [ -n "$with_vals" ]; then
241 grep -v -E "$(echo "$with_vals" |
242 awk -F "=" '{print $1}')" | awk '{print $0"="}')
247 if [ -n "$without_vals" ]; then