{{define "content"}} {{template "flash" .}} {{with .Data}}{{$sm := .D.Smart}}

{{.D.Model}} {{.D.Serial}}

device {{.D.Path}}
{{if .D.Size}}
size {{bytes .D.Size}}
{{end}}
bus {{.D.Tran}}{{if .D.Rota}} (rotational){{else}} (ssd){{end}}
{{if $sm}}
protocol {{$sm.Protocol}}
firmware {{$sm.Firmware}}
health {{if not $sm.Supported}}not supported{{else if $sm.Healthy}}PASSED{{else}}FAILED{{end}}
temperature {{if $sm.HasTemp}}{{$sm.TempC}}°C{{else}}—{{end}}{{if .D.Standby}} (standby, last read){{end}}
power-on {{hours $sm.PowerOnHrs}}
power cycles {{$sm.PowerCycles}}
last SMART read {{dt $sm.CheckedAt}}
{{with $sm.LastTest}}
self-test {{if .InProgress}}in progress, {{.Remaining}}% left{{else}}{{.Type}}: {{.Status}} at {{.Hours}} h{{end}}
{{end}} {{if $sm.Error}}
{{$sm.Error}}
{{end}} {{end}}
{{if .Known}}
{{end}}
{{if $sm}} {{with $sm.NVMe}}

NVMe health

critical warning {{if .CriticalWarning}}0x{{printf "%02x" .CriticalWarning}}{{else}}none{{end}}
percentage used {{.PercentageUsed}}%
available spare {{.AvailableSpare}}% (threshold {{.SpareThreshold}}%)
media errors {{if .MediaErrors}}{{.MediaErrors}}{{else}}0{{end}}
error log entries {{.ErrLogEntries}}
unsafe shutdowns {{.UnsafeShutdowns}}
{{end}}

Temperature, last 30 days {{len .History}} snapshots

{{.TempSpark}}
{{if $sm.Attrs}}

SMART attributes

{{range $sm.Attrs}} {{$crit := and (or (eq .ID 5) (eq .ID 187) (eq .ID 188) (eq .ID 197) (eq .ID 198)) (gt .Raw 0)}} {{end}}
IDNameValueWorstThreshRawFailed
{{.ID}}{{.Name}} {{.Value}}{{.Worst}}{{.Thresh}} {{.RawString}} {{if .WhenFailed}}{{.WhenFailed}}{{end}}
{{end}} {{if .History}}

History

{{range .HistoryRev}}{{end}}
TimeTempHealthHours{{if $sm.NVMe}}Media err{{else}}Realloc (5){{end}}Pending (197)CRC (199)
{{dt (unix .T)}}{{.TempC}}°C{{if .Healthy}}ok{{else}}FAIL{{end}}{{.Hours}}{{.Realloc}}{{.Pending}}{{.CRC}}
{{end}} {{else}}

No SMART data yet{{if .D.Standby}} — disk is in standby, waiting for it to wake up{{end}}.

{{end}} {{end}} {{end}}