Documentation
¶
Index ¶
- type Smart
- func (sm *Smart) Flatten() (tags map[string]string, fields map[string]interface{})
- func (sm *Smart) FromCollectorSmartInfo(wwn string, info collector.SmartInfo) error
- func (sm *Smart) ProcessAtaSmartInfo(tableItems []collector.AtaSmartAttributesTableItem)
- func (sm *Smart) ProcessNvmeSmartInfo(nvmeSmartHealthInformationLog collector.NvmeSmartHealthInformationLog)
- func (sm *Smart) ProcessScsiSmartInfo(defectGrownList int64, scsiErrorCounterLog collector.ScsiErrorCounterLog)
- type SmartAtaAttribute
- func (sa *SmartAtaAttribute) Flatten() map[string]interface{}
- func (sa *SmartAtaAttribute) GetStatus() pkg.AttributeStatus
- func (sa *SmartAtaAttribute) Inflate(key string, val interface{})
- func (sa *SmartAtaAttribute) PopulateAttributeStatus() *SmartAtaAttribute
- func (sa *SmartAtaAttribute) ValidateThreshold(smartMetadata thresholds.AtaAttributeMetadata)
- type SmartAttribute
- type SmartNvmeAttribute
- type SmartScsiAttribute
- type SmartTemperature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Smart ¶
type Smart struct { Date time.Time `json:"date"` DeviceWWN string `json:"device_wwn"` //(tag) DeviceProtocol string `json:"device_protocol"` //Metrics (fields) Temp int64 `json:"temp"` PowerOnHours int64 `json:"power_on_hours"` PowerCycleCount int64 `json:"power_cycle_count"` //Attributes (fields) Attributes map[string]SmartAttribute `json:"attrs"` //status Status pkg.DeviceStatus }
func NewSmartFromInfluxDB ¶
func (*Smart) FromCollectorSmartInfo ¶
Parse Collector SMART data results and create Smart object (and associated SmartAtaAttribute entries)
func (*Smart) ProcessAtaSmartInfo ¶
func (sm *Smart) ProcessAtaSmartInfo(tableItems []collector.AtaSmartAttributesTableItem)
generate SmartAtaAttribute entries from Scrutiny Collector Smart data.
func (*Smart) ProcessNvmeSmartInfo ¶
func (sm *Smart) ProcessNvmeSmartInfo(nvmeSmartHealthInformationLog collector.NvmeSmartHealthInformationLog)
generate SmartNvmeAttribute entries from Scrutiny Collector Smart data.
func (*Smart) ProcessScsiSmartInfo ¶
func (sm *Smart) ProcessScsiSmartInfo(defectGrownList int64, scsiErrorCounterLog collector.ScsiErrorCounterLog)
generate SmartScsiAttribute entries from Scrutiny Collector Smart data.
type SmartAtaAttribute ¶
type SmartAtaAttribute struct { AttributeId int `json:"attribute_id"` Value int64 `json:"value"` Threshold int64 `json:"thresh"` Worst int64 `json:"worst"` RawValue int64 `json:"raw_value"` RawString string `json:"raw_string"` WhenFailed string `json:"when_failed"` //Generated data TransformedValue int64 `json:"transformed_value"` Status pkg.AttributeStatus `json:"status"` StatusReason string `json:"status_reason,omitempty"` FailureRate float64 `json:"failure_rate,omitempty"` }
func (*SmartAtaAttribute) Flatten ¶
func (sa *SmartAtaAttribute) Flatten() map[string]interface{}
func (*SmartAtaAttribute) GetStatus ¶
func (sa *SmartAtaAttribute) GetStatus() pkg.AttributeStatus
func (*SmartAtaAttribute) Inflate ¶
func (sa *SmartAtaAttribute) Inflate(key string, val interface{})
func (*SmartAtaAttribute) PopulateAttributeStatus ¶
func (sa *SmartAtaAttribute) PopulateAttributeStatus() *SmartAtaAttribute
populate attribute status, using SMART Thresholds & Observed Metadata Chainable
func (*SmartAtaAttribute) ValidateThreshold ¶
func (sa *SmartAtaAttribute) ValidateThreshold(smartMetadata thresholds.AtaAttributeMetadata)
compare the attribute (raw, normalized, transformed) value to observed thresholds, and update status if necessary
type SmartAttribute ¶
type SmartAttribute interface { Flatten() (fields map[string]interface{}) Inflate(key string, val interface{}) GetStatus() pkg.AttributeStatus }
type SmartNvmeAttribute ¶
type SmartNvmeAttribute struct { AttributeId string `json:"attribute_id"` //json string from smartctl Value int64 `json:"value"` Threshold int64 `json:"thresh"` TransformedValue int64 `json:"transformed_value"` Status pkg.AttributeStatus `json:"status"` StatusReason string `json:"status_reason,omitempty"` FailureRate float64 `json:"failure_rate,omitempty"` }
func (*SmartNvmeAttribute) Flatten ¶
func (sa *SmartNvmeAttribute) Flatten() map[string]interface{}
func (*SmartNvmeAttribute) GetStatus ¶
func (sa *SmartNvmeAttribute) GetStatus() pkg.AttributeStatus
func (*SmartNvmeAttribute) Inflate ¶
func (sa *SmartNvmeAttribute) Inflate(key string, val interface{})
func (*SmartNvmeAttribute) PopulateAttributeStatus ¶
func (sa *SmartNvmeAttribute) PopulateAttributeStatus() *SmartNvmeAttribute
populate attribute status, using SMART Thresholds & Observed Metadata Chainable
type SmartScsiAttribute ¶
type SmartScsiAttribute struct { AttributeId string `json:"attribute_id"` //json string from smartctl Value int64 `json:"value"` Threshold int64 `json:"thresh"` TransformedValue int64 `json:"transformed_value"` Status pkg.AttributeStatus `json:"status"` StatusReason string `json:"status_reason,omitempty"` FailureRate float64 `json:"failure_rate,omitempty"` }
func (*SmartScsiAttribute) Flatten ¶
func (sa *SmartScsiAttribute) Flatten() map[string]interface{}
func (*SmartScsiAttribute) GetStatus ¶
func (sa *SmartScsiAttribute) GetStatus() pkg.AttributeStatus
func (*SmartScsiAttribute) Inflate ¶
func (sa *SmartScsiAttribute) Inflate(key string, val interface{})
func (*SmartScsiAttribute) PopulateAttributeStatus ¶
func (sa *SmartScsiAttribute) PopulateAttributeStatus() *SmartScsiAttribute
populate attribute status, using SMART Thresholds & Observed Metadata Chainable
type SmartTemperature ¶
func (*SmartTemperature) Flatten ¶
func (st *SmartTemperature) Flatten() (tags map[string]string, fields map[string]interface{})
func (*SmartTemperature) Inflate ¶
func (st *SmartTemperature) Inflate(key string, val interface{})