smartctl

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SmartctlCmdImpl is a base CMD for smartctl util
	SmartctlCmdImpl = "smartctl"
	// SmartctlDeviceInfoCmdImpl is a CMD to get basic SMART information and health about device in JSON format
	SmartctlDeviceInfoCmdImpl = SmartctlCmdImpl + " --info --json %s"
	// SmartctlHealthCmdImpl is a CMD to get  SMART status of device in JSON format
	SmartctlHealthCmdImpl = SmartctlCmdImpl + " --health --json %s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceSMARTInfo

type DeviceSMARTInfo struct {
	SerialNumber string          `json:"serial_number"`
	SmartStatus  map[string]bool `json:"smart_status"`
	Rotation     int             `json:"rotation_rate"`
}

DeviceSMARTInfo represents SMART information about device

type SMARTCTL

type SMARTCTL struct {
	// contains filtered or unexported fields
}

SMARTCTL is a wrap for system smartctl util

func NewSMARTCTL

func NewSMARTCTL(e command.CmdExecutor) *SMARTCTL

NewSMARTCTL is a constructor for SMARTCTL

func (*SMARTCTL) GetDriveInfoByPath

func (sa *SMARTCTL) GetDriveInfoByPath(path string) (*DeviceSMARTInfo, error)

GetDriveInfoByPath gets SMART information about device by its Path using smartctl util

type WrapSmartctl

type WrapSmartctl interface {
	GetDriveInfoByPath(path string) (*DeviceSMARTInfo, error)
}

WrapSmartctl is an interface that encapsulates operation with system smartctl util

Jump to

Keyboard shortcuts

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