diff options
author | Patrick Simianer <p@simianer.de> | 2016-04-14 17:30:37 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-04-14 17:30:37 +0200 |
commit | 7ac1ebbe0fb4df09698de0ac196df4b131894ce9 (patch) | |
tree | 141536d040c0932b0c308dda4f05e39a77ca28cd | |
parent | 3c1b8d5c8947bf0aa3e929c21f59eaf06aba33af (diff) |
more general monitor_soft_raid
-rwxr-xr-x | monitor_soft_raid | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor_soft_raid b/monitor_soft_raid index fc86d3a..1dc7da4 100755 --- a/monitor_soft_raid +++ b/monitor_soft_raid @@ -1,6 +1,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 != "[UUUU]" ]]; then logger "[mdstat warning] $S"; fi +if [[ $STATUS != $T ]]; then logger "[mdstat warning] $S"; fi |