Added functions (PopulateAttributeStatus) to ensure that NVME and SCSI drives set the status for SMART attributes.
Moved Status populating fucntion into the *Attribute files, so they are closer to the code they actually interact with.
Fix frontend to correctly display status, thresh and Ideal for NVMe and SCSI ddrives.
@ -21,7 +21,7 @@ var NmveMetadata = map[string]NvmeAttributeMetadata{
ID:"critical_warning",
ID:"critical_warning",
DisplayName:"Critical Warning",
DisplayName:"Critical Warning",
DisplayType:"",
DisplayType:"",
Ideal:"",
Ideal:"low",
Critical:true,
Critical:true,
Description:"This field indicates critical warnings for the state of the controller. Each bit corresponds to a critical warning type; multiple bits may be set. If a bit is cleared to ‘0’, then that critical warning does not apply. Critical warnings may result in an asynchronous event notification to the host. Bits in this field represent the current associated state and are not persistent.",
Description:"This field indicates critical warnings for the state of the controller. Each bit corresponds to a critical warning type; multiple bits may be set. If a bit is cleared to ‘0’, then that critical warning does not apply. Critical warnings may result in an asynchronous event notification to the host. Bits in this field represent the current associated state and are not persistent.",
},
},
@ -37,7 +37,7 @@ var NmveMetadata = map[string]NvmeAttributeMetadata{
ID:"available_spare",
ID:"available_spare",
DisplayName:"Available Spare",
DisplayName:"Available Spare",
DisplayType:"",
DisplayType:"",
Ideal:"",
Ideal:"high",
Critical:true,
Critical:true,
Description:"Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.",
Description:"Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.",
},
},
@ -45,7 +45,7 @@ var NmveMetadata = map[string]NvmeAttributeMetadata{
ID:"percentage_used",
ID:"percentage_used",
DisplayName:"Percentage Used",
DisplayName:"Percentage Used",
DisplayType:"",
DisplayType:"",
Ideal:"",
Ideal:"low",
Critical:true,
Critical:true,
Description:"Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).",
Description:"Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).",
},
},
@ -117,7 +117,7 @@ var NmveMetadata = map[string]NvmeAttributeMetadata{
ID:"media_errors",
ID:"media_errors",
DisplayName:"Media Errors",
DisplayName:"Media Errors",
DisplayType:"",
DisplayType:"",
Ideal:"",
Ideal:"low",
Critical:true,
Critical:true,
Description:"Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.",
Description:"Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.",
},
},
@ -125,7 +125,7 @@ var NmveMetadata = map[string]NvmeAttributeMetadata{
ID:"num_err_log_entries",
ID:"num_err_log_entries",
DisplayName:"Numb Err Log Entries",
DisplayName:"Numb Err Log Entries",
DisplayType:"",
DisplayType:"",
Ideal:"",
Ideal:"low",
Critical:true,
Critical:true,
Description:"Contains the number of Error Information log entries over the life of the controller.",
Description:"Contains the number of Error Information log entries over the life of the controller.",
{AttributeId:"read.errors_corrected_by_eccfast",Name:"Read Errors Corrected by ECC Fast",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByEccfast},
{AttributeId:"read.errors_corrected_by_eccfast",Name:"Read Errors Corrected by ECC Fast",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByEccfast, Threshold:-1},
{AttributeId:"read.errors_corrected_by_eccdelayed",Name:"Read Errors Corrected by ECC Delayed",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByEccdelayed},
{AttributeId:"read.errors_corrected_by_eccdelayed",Name:"Read Errors Corrected by ECC Delayed",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByEccdelayed, Threshold:-1},
{AttributeId:"read.errors_corrected_by_rereads_rewrites",Name:"Read Errors Corrected by ReReads/ReWrites",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByRereadsRewrites},
{AttributeId:"read.errors_corrected_by_rereads_rewrites",Name:"Read Errors Corrected by ReReads/ReWrites",Value:info.ScsiErrorCounterLog.Read.ErrorsCorrectedByRereadsRewrites, Threshold:0},
{AttributeId:"read.total_errors_corrected",Name:"Read Total Errors Corrected",Value:info.ScsiErrorCounterLog.Read.TotalErrorsCorrected},
{AttributeId:"read.total_errors_corrected",Name:"Read Total Errors Corrected",Value:info.ScsiErrorCounterLog.Read.TotalErrorsCorrected, Threshold:-1},
{AttributeId:"read.total_uncorrected_errors",Name:"Read Total Uncorrected Errors",Value:info.ScsiErrorCounterLog.Read.TotalUncorrectedErrors},
{AttributeId:"read.total_uncorrected_errors",Name:"Read Total Uncorrected Errors",Value:info.ScsiErrorCounterLog.Read.TotalUncorrectedErrors, Threshold:0},
{AttributeId:"write.errors_corrected_by_eccfast",Name:"Write Errors Corrected by ECC Fast",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByEccfast},
{AttributeId:"write.errors_corrected_by_eccfast",Name:"Write Errors Corrected by ECC Fast",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByEccfast, Threshold:-1},
{AttributeId:"write.errors_corrected_by_eccdelayed",Name:"Write Errors Corrected by ECC Delayed",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByEccdelayed},
{AttributeId:"write.errors_corrected_by_eccdelayed",Name:"Write Errors Corrected by ECC Delayed",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByEccdelayed, Threshold:-1},
{AttributeId:"write.errors_corrected_by_rereads_rewrites",Name:"Write Errors Corrected by ReReads/ReWrites",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByRereadsRewrites},
{AttributeId:"write.errors_corrected_by_rereads_rewrites",Name:"Write Errors Corrected by ReReads/ReWrites",Value:info.ScsiErrorCounterLog.Write.ErrorsCorrectedByRereadsRewrites, Threshold:0},
{AttributeId:"write.total_errors_corrected",Name:"Write Total Errors Corrected",Value:info.ScsiErrorCounterLog.Write.TotalErrorsCorrected},
{AttributeId:"write.total_errors_corrected",Name:"Write Total Errors Corrected",Value:info.ScsiErrorCounterLog.Write.TotalErrorsCorrected, Threshold:-1},
{AttributeId:"write.total_uncorrected_errors",Name:"Write Total Uncorrected Errors",Value:info.ScsiErrorCounterLog.Write.TotalUncorrectedErrors},
{AttributeId:"write.total_uncorrected_errors",Name:"Write Total Uncorrected Errors",Value:info.ScsiErrorCounterLog.Write.TotalUncorrectedErrors, Threshold:0},