Skip to content

Commit

Permalink
Check for smart_status object presense
Browse files Browse the repository at this point in the history
Signed-off-by: Deezzir <[email protected]>
  • Loading branch information
Deezzir committed Dec 20, 2024
1 parent b47737b commit c2cce7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smartctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,12 @@ func (smart *SMARTctl) mineSCSIBytesWritten() {
}

func (smart *SMARTctl) mineSmartStatus() {
smartStatus := smart.json.Get("smart_status.passed")
smartStatus := smart.json.Get("smart_status")
if smartStatus.Exists() {
smart.ch <- prometheus.MustNewConstMetric(
metricDeviceSmartStatus,
prometheus.GaugeValue,
smartStatus.Float(),
smartStatus.Get("passed").Float(),
smart.device.device,
)
}
Expand Down

0 comments on commit c2cce7b

Please sign in to comment.