From b333d3f2f0fbe1fb6abf5027f9294c0b6ed7c074 Mon Sep 17 00:00:00 2001 From: John Thiltges Date: Thu, 29 Jun 2023 14:40:19 -0500 Subject: [PATCH] Include SCSI error counters in smartctl JSON output Signed-off-by: John Thiltges --- readjson.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readjson.go b/readjson.go index 80ad738..28e08b0 100644 --- a/readjson.go +++ b/readjson.go @@ -64,7 +64,7 @@ func readFakeSMARTctl(logger log.Logger, device string) gjson.Result { // Get json from smartctl and parse it func readSMARTctl(logger log.Logger, device string) (gjson.Result, bool) { level.Debug(logger).Log("msg", "Collecting S.M.A.R.T. counters", "device", device) - out, err := exec.Command(*smartctlPath, "--json", "--info", "--health", "--attributes", "--tolerance=verypermissive", "--nocheck=standby", "--format=brief", device).Output() + out, err := exec.Command(*smartctlPath, "--json", "--info", "--health", "--attributes", "--tolerance=verypermissive", "--nocheck=standby", "--format=brief", "--log=error", device).Output() if err != nil { level.Warn(logger).Log("msg", "S.M.A.R.T. output reading", "err", err) }