Révision 48d0a2e2
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 | ||
|---|---|---|
| 24 | 24 |
# #%# capabilities=autoconf |
| 25 | 25 |
|
| 26 | 26 |
|
| 27 |
targets=`ls /sys/devices/virtual/block/*/md/mismatch_cnt | cut -d/ -f6` |
|
| 27 |
targets=`ls /sys/devices/virtual/block/*/md/mismatch_cnt 2> /dev/null | cut -d/ -f6`
|
|
| 28 | 28 |
returnval=$? |
| 29 | 29 |
|
| 30 | 30 |
if [ "x$1" = "xautoconf" ]; then |
| ... | ... | |
| 55 | 55 |
fi |
| 56 | 56 |
|
| 57 | 57 |
for target in $targets; do |
| 58 |
echo $target.value $(cat /sys/devices/virtual/block/$target/md/sync_completed)
|
|
| 58 |
echo $target.value $(cat /sys/devices/virtual/block/$target/md/mismatch_cnt)
|
|
| 59 | 59 |
done |
Formats disponibles : Unified diff