From c2cce7bb2cb47adb82e7afeafe50eb3daa82aae6 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 Signed-off-by: Deezzir --- 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, ) }