WIP - start supporting NVME and SCSI drive smart data.

Added addiitonal log message data for Smartctl exit ccode.
This commit is contained in:
Jason Kulatunga
2020-08-24 23:01:03 -07:00
parent 794479b28e
commit 5a80ae3e74
14 changed files with 2022 additions and 125 deletions
@@ -0,0 +1,21 @@
package db
import "github.com/jinzhu/gorm"
type SmartScsiAttribute struct {
gorm.Model
SmartId int `json:"smart_id"`
Smart Device `json:"-" gorm:"foreignkey:SmartId"` // use SmartId as foreign key
AttributeId string `json:"attribute_id"` //json string from smartctl
Name string `json:"name"`
Value int `json:"value"`
Threshold int `json:"thresh"`
TransformedValue int64 `json:"transformed_value"`
Status string `gorm:"-" json:"status,omitempty"`
StatusReason string `gorm:"-" json:"status_reason,omitempty"`
FailureRate float64 `gorm:"-" json:"failure_rate,omitempty"`
History []SmartScsiAttribute `gorm:"-" json:"history,omitempty"`
}