measurements

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 NewSmartFromInfluxDB(attrs map[string]interface{}) (*Smart, error)

func (*Smart) Flatten

func (sm *Smart) Flatten() (tags map[string]string, fields map[string]interface{})

func (*Smart) FromCollectorSmartInfo

func (sm *Smart) FromCollectorSmartInfo(wwn string, info collector.SmartInfo) error

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) GetTransformedValue added in v0.7.3

func (sa *SmartAtaAttribute) GetTransformedValue() int64

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
	GetTransformedValue() int64
}

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) GetTransformedValue added in v0.7.3

func (sa *SmartNvmeAttribute) GetTransformedValue() int64

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) GetTransformedValue added in v0.7.3

func (sa *SmartScsiAttribute) GetTransformedValue() int64

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

type SmartTemperature struct {
	Date time.Time `json:"date"`
	Temp int64     `json:"temp"`
}

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{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL