From e4290b3f4d801904eb446b868a7cf0befca38144 Mon Sep 17 00:00:00 2001 From: Steven Kreitzer Date: Wed, 23 Aug 2023 10:25:22 -0500 Subject: [PATCH] fix: adding quiet mode for smartctl command Signed-off-by: Steven Kreitzer --- readjson.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readjson.go b/readjson.go index 4b7d4ca..a3055c7 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", "--log=error", device).Output() + out, err := exec.Command(*smartctlPath, "--json", "--info", "--health", "--attributes", "--tolerance=verypermissive", "--nocheck=standby", "--format=brief", "--log=error", "--quietmode=errorsonly", device).Output() if err != nil { level.Warn(logger).Log("msg", "S.M.A.R.T. output reading", "err", err, "device", device) }