Added I/O error state support for prd_raid script

With the I/O error state, is possible to show all schools with this issue on
a single summary, making it easy to diagnose disk errors.
Signed-off-by: default avatarVINICIUS KWIECIEN RUOSO <vkr07@c3sl.ufpr.br>
parent 55dfee96
......@@ -13,6 +13,7 @@ function prd_raid_www()
MISSINGPART="false"
MISSINGDISK="false"
NOINFO="false"
IOERROR="false"
grep -q "OUT_OF_RAID" <<< "$PVALUE" && OUT="true"
grep -q "SYNCHRONIZING_RAID" <<< "$PVALUE" && SYNC="true"
......@@ -20,16 +21,18 @@ function prd_raid_www()
grep -q "[1-9]_MISSING" <<< "$PVALUE" && MISSINGPART="true"
grep -q "sd[a,b]_MISSING" <<< "$PVALUE" && MISSINGDISK="true"
grep -q "NOINFO" <<< "$PVALUE" && NOINFO="true"
grep -q "IOERROR" <<< "$PVALUE" && IOERROR="true"
PSTATETYPE="prd_raid_out.st:$OUT prd_raid_sync.st:$SYNC"
PSTATETYPE="$PSTATETYPE prd_raid_faulty.st:$FAULTY"
PSTATETYPE="$PSTATETYPE prd_raid_misspart.st:$MISSINGPART"
PSTATETYPE="$PSTATETYPE prd_raid_noinfo.st:$NOINFO"
PSTATETYPE="$PSTATETYPE prd_raid_missdisk.st:$MISSINGDISK"
PSTATETYPE="$PSTATETYPE prd_raid_ioerror.st:$IOERROR"
if [[ $OUT == "true" || $SYNC == "true" || $FAULTY == "true" || \
$MISSINGPART == "true" || $MISSINGDISK == "true" || \
$NOINFO == "true" ]]; then
$NOINFO == "true" || $IOERROR == "true" ]]; then
PSTATUS=red
fi
......
function getstateinfo()
{
STITLE="Disco com I/O ERROR"
SDESCRIPTION="Escolas com disco com erro de leitura"
SDEFCOLUMNS="ID,NRE,Cidade,Escola,Status,RAID"
SSUMARY="%d escolas com discos com I/O ERROR"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment