File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ email=""
19
19
# FreeBSD 11.0 1100512
20
20
# FreeBSD 11.1 1101505
21
21
# FreeBSD 12.2 1202000
22
+ #
23
+ # If a scrub runs longer than 24 hours, we have two additional tokens to parse in the
24
+ # zpool status scan line output ("'x' days"):
25
+ #
26
+ # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
27
+ # scan: scrub repaired 0B in 1 days 11:56:46 with 0 errors on Wed Dec 9 06:07:04 2020
28
+ #
29
+ # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
30
+ # scan: scrub repaired 0B in 00:09:11 with 0 errors on Sun Dec 13 17:31:24 2020
22
31
23
32
fbsd_relver=$( uname -K)
24
33
@@ -101,8 +110,15 @@ for pool in $pools; do
101
110
scrubErrors=" N/A"
102
111
scrubAge=" N/A"
103
112
if [ " $( zpool status " $pool " | grep " scan" | awk ' {print $2}' ) " = " scrub" ]; then
104
- scrubRepBytes= " $( zpool status " $pool " | grep " scan " | awk ' {print $4} ' ) "
113
+ parseLong=0
105
114
if [ " $fbsd_relver " -gt 1101000 ] && [ " $fbsd_relver " -lt 1200000 ]; then
115
+ parseLong=$(( parseLong+ 1 ))
116
+ fi
117
+ if [ " $( zpool status " $pool " | grep " scan" | awk ' {print $7}' ) " = " days" ]; then
118
+ parseLong=$(( parseLong+ 1 ))
119
+ fi
120
+ scrubRepBytes=" $( zpool status " $pool " | grep " scan" | awk ' {print $4}' ) "
121
+ if [ $parseLong -gt 0 ]; then
106
122
scrubErrors=" $( zpool status " $pool " | grep " scan" | awk ' {print $10}' ) "
107
123
scrubDate=" $( zpool status " $pool " | grep " scan" | awk ' {print $17"-"$14"-"$15"_"$16}' ) "
108
124
else
You can’t perform that action at this time.
0 commit comments