summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-04-14 17:30:37 +0200
committerPatrick Simianer <p@simianer.de>2016-04-14 17:30:37 +0200
commit7ac1ebbe0fb4df09698de0ac196df4b131894ce9 (patch)
tree141536d040c0932b0c308dda4f05e39a77ca28cd
parent3c1b8d5c8947bf0aa3e929c21f59eaf06aba33af (diff)
more general monitor_soft_raid
-rwxr-xr-xmonitor_soft_raid3
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