mirror of
https://github.com/byReqz/stocheck.git
synced 2025-07-06 02:40:50 +00:00
Compare commits
1 Commits
main
...
637a065868
Author | SHA1 | Date | |
---|---|---|---|
637a065868 |
10
stocheck.sh
10
stocheck.sh
@ -36,24 +36,24 @@ while [ -z "$1" ]; do
|
||||
fi
|
||||
if [[ "$raidts" == "unmounted" ]];then
|
||||
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
|
||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 5)
|
||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | 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" " ")
|
||||
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[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 ""
|
||||
else
|
||||
raidfs=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 3)
|
||||
raidper=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 6)
|
||||
raidmp=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 7)
|
||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | cut -d " " -f 5)
|
||||
raiduuid=$(echo "$lsbl" | grep "$raid" | tr -s ' ' | 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" " ")
|
||||
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[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 ""
|
||||
fi
|
||||
done
|
||||
@ -109,7 +109,7 @@ while [ -z "$1" ]; do
|
||||
fi
|
||||
if [[ -n $(ls /dev | grep nvme) ]];then
|
||||
echo "=== nvme drive check: ($(ls -l /sys/block | grep nvme | wc -l) found) ==="
|
||||
for x in {0..24};do
|
||||
for x in {0..4};do
|
||||
scan=$(smartctl --scan)
|
||||
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)
|
||||
|
Reference in New Issue
Block a user