m20201107210306

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DeviceProtocolAta = "ATA"
View Source
const DeviceProtocolNvme = "NVMe"
View Source
const DeviceProtocolScsi = "SCSI"

Variables

This section is empty.

Functions

This section is empty.

Types

type Device deprecated

type Device struct {
	//GORM attributes, see: http://gorm.io/docs/conventions.html
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time

	WWN    string `json:"wwn" gorm:"primary_key"`
	HostId string `json:"host_id"`

	DeviceName     string  `json:"device_name"`
	Manufacturer   string  `json:"manufacturer"`
	ModelName      string  `json:"model_name"`
	InterfaceType  string  `json:"interface_type"`
	InterfaceSpeed string  `json:"interface_speed"`
	SerialNumber   string  `json:"serial_number"`
	Firmware       string  `json:"firmware"`
	RotationSpeed  int     `json:"rotational_speed"`
	Capacity       int64   `json:"capacity"`
	FormFactor     string  `json:"form_factor"`
	SmartSupport   bool    `json:"smart_support"`
	DeviceProtocol string  `json:"device_protocol"` //protocol determines which smart attribute types are available (ATA, NVMe, SCSI)
	DeviceType     string  `json:"device_type"`     //device type is used for querying with -d/t flag, should only be used by collector.
	SmartResults   []Smart `gorm:"foreignkey:DeviceWWN" json:"smart_results"`
}

Deprecated: m20201107210306.Device is deprecated, only used by db migrations

func (*Device) IsAta

func (dv *Device) IsAta() bool

func (*Device) IsNvme

func (dv *Device) IsNvme() bool

func (*Device) IsScsi

func (dv *Device) IsScsi() bool

type Smart deprecated

type Smart struct {
	gorm.Model

	DeviceWWN string `json:"device_wwn"`
	Device    Device `json:"-" gorm:"foreignkey:DeviceWWN"` // use DeviceWWN as foreign key

	TestDate    time.Time `json:"date"`
	SmartStatus string    `json:"smart_status"` // SmartStatusPassed or SmartStatusFailed

	//Metrics
	Temp            int64 `json:"temp"`
	PowerOnHours    int64 `json:"power_on_hours"`
	PowerCycleCount int64 `json:"power_cycle_count"`

	AtaAttributes  []SmartAtaAttribute  `json:"ata_attributes" gorm:"foreignkey:SmartId"`
	NvmeAttributes []SmartNvmeAttribute `json:"nvme_attributes" gorm:"foreignkey:SmartId"`
	ScsiAttributes []SmartScsiAttribute `json:"scsi_attributes" gorm:"foreignkey:SmartId"`
}

Deprecated: m20201107210306.Smart is deprecated, only used by db migrations

type SmartAtaAttribute deprecated

type SmartAtaAttribute struct {
	gorm.Model

	SmartId int    `json:"smart_id"`
	Smart   Device `json:"-" gorm:"foreignkey:SmartId"` // use SmartId as foreign key

	AttributeId int    `json:"attribute_id"`
	Name        string `json:"name"`
	Value       int    `json:"value"`
	Worst       int    `json:"worst"`
	Threshold   int    `json:"thresh"`
	RawValue    int64  `json:"raw_value"`
	RawString   string `json:"raw_string"`
	WhenFailed  string `json:"when_failed"`

	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          []SmartAtaAttribute `gorm:"-" json:"history,omitempty"`
}

Deprecated: m20201107210306.SmartAtaAttribute is deprecated, only used by db migrations

type SmartNvmeAttribute deprecated

type SmartNvmeAttribute 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          []SmartNvmeAttribute `gorm:"-" json:"history,omitempty"`
}

Deprecated: m20201107210306.SmartNvmeAttribute is deprecated, only used by db migrations

type SmartScsiAttribute deprecated

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"`
}

Deprecated: m20201107210306.SmartScsiAttribute is deprecated, only used by db migrations

Jump to

Keyboard shortcuts

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