summaryrefslogtreecommitdiff
path: root/monitor-soft-raid
blob: 1dc7da4bfbcaac43316e081e627738b832f0fc72 (plain)
1
2
3
4
5
6
7
#!/bin/zsh

T="[$(printf 'U%.0s' {1..$1})]"
S=$(awk '/^md/ {printf "%s: ", $1}; /blocks/ {print $NF}' </proc/mdstat)
STATUS=$(echo $S | cut -d" " -f2)
if [[ $STATUS != $T ]]; then logger "[mdstat warning] $S"; fi