mirror of
https://github.com/byReqz/stocheck.git
synced 2024-11-22 14:41:15 +00:00
added treshhold
This commit is contained in:
parent
61b676d414
commit
581c50a954
28
stocheck.sh
28
stocheck.sh
@ -87,7 +87,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H /dev/sd$x | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H /dev/sd$x | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -97,7 +97,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------------"
|
echo "-------------------------------------------------"
|
||||||
else
|
else
|
||||||
@ -128,7 +128,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H /dev/nvme$x | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H /dev/nvme$x | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -138,7 +138,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
fi
|
fi
|
||||||
@ -180,7 +180,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H -d 3ware,p$x /dev/twe0 | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H -d 3ware,p$x /dev/twe0 | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -190,7 +190,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
else
|
else
|
||||||
@ -219,7 +219,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H -d 3ware,p$x /dev/twa0 | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H -d 3ware,p$x /dev/twa0 | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -229,7 +229,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
else
|
else
|
||||||
@ -258,7 +258,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H -d 3ware,p$x /dev/twl0 | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H -d 3ware,p$x /dev/twl0 | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -268,7 +268,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
else
|
else
|
||||||
@ -308,7 +308,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H -d sat /dev/sg$x | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H -d sat /dev/sg$x | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -318,7 +318,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
else
|
else
|
||||||
@ -360,7 +360,7 @@ while [ -z "$1" ]; do
|
|||||||
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
|
||||||
smartctl -H -d sat+megaraid,$x /dev/sda | grep -e "SMART overall-health self-assessment test result:"
|
smartctl -H -d sat+megaraid,$x /dev/sda | grep -e "SMART overall-health self-assessment test result:"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
echo -e "\e[4mAttribute\e[0m \e[4mValue (Raw)\e[0m \e[4mWorst\e[0m \e[4mThresh\e[0m \e[4mType\e[0m \e[4mUpdated\e[0m \e[4mFailed\e[0m"
|
||||||
for ((z=1;z<=argsm;z++)); do
|
for ((z=1;z<=argsm;z++)); do
|
||||||
arg=$(echo "$argsl" | sed -n "$z"p)
|
arg=$(echo "$argsl" | sed -n "$z"p)
|
||||||
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
value=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 4)
|
||||||
@ -370,7 +370,7 @@ while [ -z "$1" ]; do
|
|||||||
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
updated=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 8)
|
||||||
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
failed=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 9)
|
||||||
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
raw=$(echo "$argse" | grep -e "$arg" | xargs | cut -d ' ' -f 10)
|
||||||
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf " $type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
printf "%-25s %s " "$arg" "$value" && printf "%-10s %s " "($raw)" "$worst" && printf "%-14s %s " " $thresh" "$type" && printf "%-10s %s " " $updated" "$failed" && printf "\n"
|
||||||
done
|
done
|
||||||
echo "-------------------------------------------------"
|
echo "-------------------------------------------------"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user