From 798826f23ebb1d816180d7a107634a845bc1bd6c Mon Sep 17 00:00:00 2001 From: Deezzir Date: Thu, 19 Dec 2024 21:42:18 -0500 Subject: [PATCH] Check for `smart_status` object presense --- smartctl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smartctl.go b/smartctl.go index 4909e40..b136b8b 100644 --- a/smartctl.go +++ b/smartctl.go @@ -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, ) }