From 48d0a2e2b055d863d69efaf79da34ba050dc98e0 Mon Sep 17 00:00:00 2001 From: Ken-ichi Mito Date: Tue, 5 May 2015 01:02:49 +0900 Subject: [PATCH] fix - remove error message, fetch correct count source * redirect error message of `ls` to /dev/null * fetch mismatch_cnt to get correct count * https://www.kernel.org/doc/Documentation/md.txt * sync_completed: the number of sectors that have been completed * mismatch_cnt: the number of errors that are found --- plugins/disk/raid-mismatch-count | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/disk/raid-mismatch-count b/plugins/disk/raid-mismatch-count index 9b84b50f..b53dc9c8 100755 --- a/plugins/disk/raid-mismatch-count +++ b/plugins/disk/raid-mismatch-count @@ -24,7 +24,7 @@ # #%# capabilities=autoconf -targets=`ls /sys/devices/virtual/block/*/md/mismatch_cnt | cut -d/ -f6` +targets=`ls /sys/devices/virtual/block/*/md/mismatch_cnt 2> /dev/null | cut -d/ -f6` returnval=$? if [ "x$1" = "xautoconf" ]; then @@ -55,5 +55,5 @@ __EOF__ fi for target in $targets; do - echo $target.value $(cat /sys/devices/virtual/block/$target/md/sync_completed) + echo $target.value $(cat /sys/devices/virtual/block/$target/md/mismatch_cnt) done