varasto: Index | Files

package smart

import ""

Access SMART data of disks


Package Files

jsonformat.go smart.go

func SmartCtlBackend Uses

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

func SmartCtlViaDockerBackend Uses

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

joonas/smartmontools built from simple Dockerfile:

FROM alpine:edge RUN apk add --update smartmontools

type AtaSmartAttribute Uses

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 Uses

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

type SmartCtlJsonReport Uses

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 Uses

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

func (*SmartCtlJsonReport) FindSmartAttributeByName Uses

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

Package smart imports 4 packages (graph) and is imported by 1 packages. Updated 2020-08-22. Refresh now. Tools for package owners.