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
Click to show internal directories.
Click to hide internal directories.