1
0
mirror of https://github.com/byReqz/stocheck.git synced 2025-07-06 10:50:49 +00:00

Compare commits

..

4 Commits

Author SHA1 Message Date
4da3b2cf33 updated hash after commit 2021-10-21 13:58:31 +00:00
d743d483f9 up nvme drive loop to 24 instead of 4 2021-10-21 15:57:50 +02:00
29b85bf8ed adapt to changes in lsblk 2021-10-04 16:21:27 +02:00
c91efb37cc add : 2021-09-07 10:29:50 +02:00
2 changed files with 6 additions and 6 deletions

2
hash
View File

@ -1 +1 @@
5a6dbf02666862f837df7f8bf250db08 1032b0335e08ca002e284fd787c63f01

View File

@ -36,24 +36,24 @@ while [ -z "$1" ]; do
fi fi
if [[ "$raidts" == "unmounted" ]];then if [[ "$raidts" == "unmounted" ]];then
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3) raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4) raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 5)
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4) raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ") raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mFS:\033[0m "$raidfs"" echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mFS:\033[0m "$raidfs""
echo -e "\033[1mMembers:\033[0m "$raiddrives"" echo -e "\033[1mMembers:\033[0m "$raiddrives""
echo -e "\033[1mState:\033[0m "$raidts" \033[1mP-UUID\033[0m "$raiduuid"" echo -e "\033[1mState:\033[0m "$raidts" \033[1mP-UUID:\033[0m "$raiduuid""
echo -e "" echo -e ""
else else
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3) raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
raidper=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 6) raidper=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 6)
raidmp=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 7) raidmp=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 7)
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 4) raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 5)
raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4) raidstate=$(echo "$mdadmconf" | grep -e "$raid" | cut -d " " -f 4)
raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ") raiddrives=$(echo "$mdadmconf" | grep -e "$raid" | cut -c 6- | grep -o -E "sd[a-z][0-9]|nvme[0-9]n[0-9]p[0-9]" | tr "\n" " ")
echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mSize:\033[0m "$raidts" \033[1m%:\033[0m "$raidper"" echo -e "\033[1mArray:\033[0m "$raid" \033[1mType:\033[0m "$raidstate" \033[1mSize:\033[0m "$raidts" \033[1m%:\033[0m "$raidper""
echo -e "\033[1mMembers:\033[0m "$raiddrives"" echo -e "\033[1mMembers:\033[0m "$raiddrives""
echo -e "\033[1mState:\033[0m "mounted" \033[1mFilesystem:\033[0m "$raidfs" \033[1mMountpoint:\033[0m "$raidmp"" echo -e "\033[1mState:\033[0m "mounted" \033[1mFilesystem:\033[0m "$raidfs" \033[1mMountpoint:\033[0m "$raidmp""
echo -e "\033[1mP-UUID\033[0m "$raiduuid"" echo -e "\033[1mP-UUID:\033[0m "$raiduuid""
echo -e "" echo -e ""
fi fi
done done
@ -109,7 +109,7 @@ while [ -z "$1" ]; do
fi fi
if [[ -n $(ls /dev | grep nvme) ]];then if [[ -n $(ls /dev | grep nvme) ]];then
echo "=== nvme drive check: ($(ls -l /sys/block | grep nvme | wc -l) found) ===" echo "=== nvme drive check: ($(ls -l /sys/block | grep nvme | wc -l) found) ==="
for x in {0..4};do for x in {0..24};do
scan=$(smartctl --scan) scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/nvme$x) ]] && [[ -n $(ls /sys/block | grep nvme"$x") ]];then if [[ -n $(echo $scan | grep /dev/nvme$x) ]] && [[ -n $(ls /sys/block | grep nvme"$x") ]];then
argsl=$(smartctl -a /dev/nvme$x | grep -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect" -e "Temperature:" -e "Percentage Used:" -e "Data Units Read:" -e "Data Units Written:" -e "Power on Hours:" -e "Power Cycles:" -e "Media and Data Integrity Errors:" -e "Error Information Log Entries:" -e "Percent_Lifetime_Remain" -e "Write_Error_Rate" -e "Offline_Uncorrectable" -e "Reported_Uncorrect" -e "Error_Correction_Count" -e "Unexpect_Power_Loss_Ct" -e "Raw_Read_Error_Rate" -e "Warning Comp. Temperature Time" -e "Critical Comp. Temperature Time" -e "Power On Hours" -e "Controller Busy Time" -e "Temperature Sensor 1" -e "Temperature Sensor 2" -e "Wear_Leveling_Count" -e "Available Spare:" -e "Critical Warning:" -e "Available Spare Threshold:" -o --color=never) argsl=$(smartctl -a /dev/nvme$x | grep -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect" -e "Temperature:" -e "Percentage Used:" -e "Data Units Read:" -e "Data Units Written:" -e "Power on Hours:" -e "Power Cycles:" -e "Media and Data Integrity Errors:" -e "Error Information Log Entries:" -e "Percent_Lifetime_Remain" -e "Write_Error_Rate" -e "Offline_Uncorrectable" -e "Reported_Uncorrect" -e "Error_Correction_Count" -e "Unexpect_Power_Loss_Ct" -e "Raw_Read_Error_Rate" -e "Warning Comp. Temperature Time" -e "Critical Comp. Temperature Time" -e "Power On Hours" -e "Controller Busy Time" -e "Temperature Sensor 1" -e "Temperature Sensor 2" -e "Wear_Leveling_Count" -e "Available Spare:" -e "Critical Warning:" -e "Available Spare Threshold:" -o --color=never)