smart

package
v0.0.0-...-ea0be71 Latest Latest
Warning

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

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

Documentation

Overview

Access SMART data of disks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SmartCtlBackend

func SmartCtlBackend(device string) ([]byte, error)

func SmartCtlViaDockerBackend

func SmartCtlViaDockerBackend(device string) ([]byte, error)

joonas/smartmontools built from simple Dockerfile:

FROM alpine:edge RUN apk add --update smartmontools

Types

type AtaSmartAttribute

type AtaSmartAttribute struct {
	Id     int    `json:"id"`
	Name   string `json:"name"`
	Value  int    `json:"value"`
	Worst  int    `json:"worst"`
	Thresh int    `json:"thresh"`
	Raw    struct {
		Value  int    `json:"value"`
		String string `json:"string"`
	} `json:"raw"`
}

type Backend

type Backend func(device string) ([]byte, error)

type SmartCtlJsonReport

type SmartCtlJsonReport struct {
	JsonFormatVersion  []int `json:"json_format_version"`
	AtaSmartAttributes struct {
		Revision int                 `json:"revision"`
		Table    []AtaSmartAttribute `json:"table"`
	} `json:"ata_smart_attributes"`
	SmartStatus struct {
		Passed bool `json:"passed"`
	} `json:"smart_status"`
	PowerCycleCount int `json:"power_cycle_count"`
	PowerOnTime     struct {
		Hours int `json:"hours"`
	} `json:"power_on_time"`
	Temperature struct {
		Current int `json:"current"`
	} `json:"temperature"`
}

func Scan

func Scan(device string, back Backend) (*SmartCtlJsonReport, error)

func (*SmartCtlJsonReport) FindSmartAttributeByName

func (s *SmartCtlJsonReport) FindSmartAttributeByName(name string) *AtaSmartAttribute

Jump to

Keyboard shortcuts

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