Check for smart_status object presense

Signed-off-by: Deezzir <deezzir@gmail.com>
This commit is contained in:
Deezzir 2024-12-19 21:42:18 -05:00
parent b47737b0be
commit c2cce7bb2c
No known key found for this signature in database
GPG key ID: BC9F5289FAC4E96A

View file

@ -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,
)
}