From c0b1cb64bd201352cc1d61d1f0c8e4df56684d78 Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Fri, 1 Jun 2018 04:21:05 -0500 Subject: [PATCH 1/2] Reporte de badblocks --- scripts/report-basblocks | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/report-basblocks diff --git a/scripts/report-basblocks b/scripts/report-basblocks new file mode 100755 index 0000000..97b768d --- /dev/null +++ b/scripts/report-basblocks @@ -0,0 +1,8 @@ +#!/bin/bash + +OUTPUT_DIR=/output/hwtests + +for DIR in $OUTPUT_DIR/* ; do + [[ $DIR == snapshot ]] && next + echo $DIR +done From c56b9782359f6c49933524d22be75b3def6a7fbb Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Fri, 1 Jun 2018 04:21:11 -0500 Subject: [PATCH 2/2] Reporte de badblocks --- scripts/report-basblocks | 54 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/scripts/report-basblocks b/scripts/report-basblocks index 97b768d..fac3403 100755 --- a/scripts/report-basblocks +++ b/scripts/report-basblocks @@ -1,8 +1,56 @@ #!/bin/bash + +while getopts rq OPT 2>/dev/null ; do + case $OPT in + 'r') + REBUILD=1 + break + ;; + 'q') + QUIET=1 + break + ;; + esac +done + OUTPUT_DIR=/output/hwtests -for DIR in $OUTPUT_DIR/* ; do - [[ $DIR == snapshot ]] && next - echo $DIR +[[ -f scripts.env ]] && source scripts.env + +HEADER='SERVER|DISK|SERIAL|RESULT|COMMENT' + +for SRV_DIR in $OUTPUT_DIR/* ; do + SERVER=`basename $SRV_DIR` + [[ $SERVER == snapshot ]] && continue + SERVERS+=" $SERVER" + #echo $SRV_DIR done + +#echo $SERVERS + +if [[ -n $REBUILD ]] ; then + for SERVER in $SERVERS ; do + SRV_CSV=$OUTPUT_DIR/$SERVER/badblocks.csv + #echo $SRV_CSV + echo $HEADER > $SRV_CSV + DSK_DIR=$OUTPUT_DIR/$SERVER/disk + for CSV in $DSK_DIR/*.badblocks.csv ; do + if [[ -f $CSV ]] ; then + #echo $CSV + cat $CSV >> $SRV_CSV + fi + done + done + exit +fi + +if [[ -z $QUIET ]] ; then + echo $HEADER + for SERVER in $SERVERS ; do + SRV_CSV=$OUTPUT_DIR/$SERVER/badblocks.csv + if [[ -f $SRV_CSV ]] ; then + cat $SRV_CSV | grep -v 'SERVER' + fi + done +fi