smartctl

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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