-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunSIATBW
79 lines (70 loc) · 4.47 KB
/
runSIATBW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# system by simmon
# [email protected] - siatbw-v0.01d
# siatbw program color code set.
RED='\033[0;31m' # RED 빨강
BLUE='\033[0;34m' # BLUE 파랑
WHITE='\033[0;37m' # WHITE 하얀색
GREEN='\033[0;32m' # GREEN 녹색
# program run.
echo "SCAN Your Disk INFO"
echo "status nvme"
echo "-------------------------------------------------------------------------"
fdisk -l|grep "/dev/nv"|grep Disk|cut -d '/' -f3
echo "-------------------------------------------------------------------------"
echo "staus sata or sas"
fdisk -l|grep "/dev/sd"|grep Disk|cut -d '/' -f3
echo "-------------------------------------------------------------------------"
echo " "
printf "CHECK or SCAN Disk Name ${GREEN} sda sdb sdc ${WHITE}\n"
printf "OK, Enter your device name above: ${BLUE}"
read -a SYDND
printf "${WHITE}Show - input Disk: ${SYDND}"
echo " "
echo "TEST number of your Disk : ${#SYDND[*]}"
echo " "
echo "-------------------------------------------------------------------------"
for SYDND in "${SYDND[@]}"
do
echo "-------------------------------------------------------------------------"
printf "${WHITE}Input Device Name: ${BLUE} $SYDND ${WHITE}\n"
printf "RAW Date Value - PROCESSING \n"
BASinfo=$(smartctl -a /dev/${SYDND})
rawinfo=`echo "$BASinfo"|awk '/Total_LBAs_Written/ {print $10*512/1024/1024/1024}'`
NAME=`echo "$BASinfo"|awk '/Device Model/ {print $3 $4 $5 $6}'`
On_Time=`echo "$BASinfo"|awk '/Power_On_Hours/ {print $10}'`
Wear_Count=`echo "$BASinfo"|awk '/Wear_Leveling_Count/ {print $10}'`
Lbs_Written=`echo "$BASinfo"|awk '/Total_LBAs_Written/ {print $10}'`
Start_Stop_Count=`echo "$BASinfo"|awk '/Start_Stop_Count/ {print $10}'`
Spin_Up_Time=`echo "$BASinfo"|awk '/Spin_Up_Time/ {print $10}'`
Power_Cycle=`echo "$BASinfo"|awk '/Power_Cycle_Count/ {print $10}'`
POR_Count=`echo "$BASinfo"|awk '/POR_Recovery_Count/ {print $10}'`
NV_On_Time=`echo "$BASinfo"|awk '/Power On Hours/ {print $4}'`
NV_Power=`echo "$BASinfo"|awk '/Power Cycles/ {print $3}'`
NV_Model=`echo "$BASinfo"|awk '/Model Number/ {print $3 $4 $5 $6}'`
NV_WRITE=`echo "$BASinfo"|awk '/Data Units Written/ {print $5 $6}'`
NV_READ=`echo "$BASinfo"|awk '/Data Units Read/ {print $5 $6}'`
RRER=`echo "$BASinfo"|awk '/Raw_Read_Error_Rate/ {print $10}'`
RSC=`echo "$BASinfo"|awk '/Reallocated_Sector_Ct/ {print $10}'`
REC=`echo "$BASinfo"|awk '/Reallocated_Event_Count/ {print $10}'`
SER=`echo "$BASinfo"|awk '/Seek_Error_Rate/ {print $10}'`
SRC=`echo "$BASinfo"|awk '/Spin_Retry_Count/ {print $10}'`
CPS=`echo "$BASinfo"|awk '/Current_Pending_Sector/ {print $10}'`
OU=`echo "$BASinfo"|awk '/Offline_Uncorrectable/ {print $10}'`
UCEC=`echo "$BASinfo"|awk '/UDMA_CRC_Error_Count/ {print $10}'`
HER=`echo "$BASinfo"|awk '/Hardware_ECC_Recovered/ {print $10}'`
TBW=`echo $rawinfo|awk '{print $1/1024}'`
printf "On_Time: ${RED} ${NV_On_Time} ${On_Time} ${WHITE} Power_Cycle_Count: ${BLUE} ${NV_Power} ${Power_Cycle} ${WHITE}\n"
printf "NVME Disk - DATA Units Written: ${BLUE} ${NV_WRITE} ${WHITE} DATA Units Read: ${BLUE} ${NV_READ} ${WHITE}\n"
printf "SDD Disk - Wear_Leveling_Count: ${BLUE} ${Wear_Count} ${WHITE} POR_Recovery_Count: ${BLUE} ${POR_Count} ${WHITE} lbs_written:${BLUE} ${Lbs_Written} ${WHITE}\n"
printf "HDD Disk - Spin_Up_Time: ${BLUE} ${Spin_Up_Time} ${WHITE} Start_Stop_Count: ${BLUE} ${Start_Stop_Count} ${WHITE}\n"
printf "${BLUE}TBW-usage: $rawinfo GB ${RED}[ $TBW TB ] ${WHITE}\n"
printf "${BLUE}ERROR Indicator Value -> \n"
printf "${RED}RAW_Read_Error_Rate: ${BLUE} $RRER ${RED} Reallocated_Sector_Ct: ${BLUE} $RSC ${RED} Seek_Error_Rate: ${BLUE} $SER\n"
printf "${RED}Spin_Retry_Count: ${BLUE} $SRC ${RED} Current_Pending_Sector: ${BLUE} $CPS ${RED} Offline_Uncorrectable: ${BLUE} $OU ${RED}\n"
printf "${RED}UDMA_CRC_Error_Count: ${BLUE} $UCEC ${RED} Reallocated_Event_Count: ${BLUE} $REC ${RED} Hardware_ECC_Recovered: ${BLUE} $HER\n"
printf "${WHITE}TBW Device Name: ${GREEN} $NV_Model ${NAME} ${BLUE} $SYDND ${WHITE}test completed\n"
echo "-------------------------------------------------------------------------"
done
printf " S I A T B W Program Terminated! ------------------------ ${WHITE} 💗system by simmon ${WHITE}\n"
echo " "