|
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
// Attribute definitions
SMARTAttr reallocated = {
.id = REALLOC_SEC_COUNT_ID,
.name = "Reallocated_Sector_Ct",
.value = -1,
.threshold_warn = 0,
.threshold_crit = -1,
.optional = false,
};
SMARTAttr pending = {
.id = CURRENT_PENDING_SEC_ID,
.name = "Current_Pending_Sector",
.value = -1,
.threshold_warn = 0,
.threshold_crit = -1,
.optional = false,
};
SMARTAttr off_uncorrect = {
.id = OFFLINE_UNCORRECT_ID,
.name = "Offline_Uncorrectable",
.value = -1,
.threshold_warn = 0,
.threshold_crit = 0,
.optional = false,
};
SMARTAttr wear = {
.id = WEAR_COUNT_ID,
.name = "Wear_Leveling_Count",
.value = -1,
.threshold_warn = 80,
.threshold_crit = 90,
.optional = true,
};
SMARTAttr wearout = {
.id = MEDIA_WEAROUT_ID,
.name = "Media_Wearout_Indicator",
.value = -1,
.threshold_warn = 80,
.threshold_crit = 90,
.optional = true,
};
SMARTAttr badblocks = {
.id = RUNTIME_BAD_BLOCKS_ID,
.name = "Runtime_Bad_Block",
.value = -1,
.threshold_warn = 0,
.threshold_crit = 0,
.optional = false,
};
SMARTAttr rep_uncorrect = {
.id = REP_UNCORRECT_ID,
.name = "Reported_Uncorrect",
.value = -1,
.threshold_warn = 0,
|
|
118
119
120
121
122
123
|
map<int,SMARTAttr> prepareAttrMap(int driveType);
int getSmartAttrValue(string line);
int getSmartAttrID(string line);
int run_smartctl_cmd(const string command, const char* disk, string* output);
int checkDriveType(const char* disk);
int evalStatus(const char* disk, int driveType, string* status);
|