From 391aae38e4c93eadadf51cf20379af71c9251714 Mon Sep 17 00:00:00 2001 From: David Randall Date: Sun, 5 May 2024 10:29:02 -0400 Subject: [PATCH] Use long option and move the device name to the end Signed-off-by: David Randall --- readjson.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readjson.go b/readjson.go index 3f6b3ee..234bc85 100644 --- a/readjson.go +++ b/readjson.go @@ -64,7 +64,7 @@ func readFakeSMARTctl(logger log.Logger, device Device) gjson.Result { // Get json from smartctl and parse it func readSMARTctl(logger log.Logger, device Device) (gjson.Result, bool) { start := time.Now() - out, err := exec.Command(*smartctlPath, "--json", "--info", "--health", "--attributes", "--tolerance=verypermissive", "--nocheck=standby", "--format=brief", "--log=error", device.Name, "-d", device.Type).Output() + out, err := exec.Command(*smartctlPath, "--json", "--info", "--health", "--attributes", "--tolerance=verypermissive", "--nocheck=standby", "--format=brief", "--log=error", "--device="+device.Type, device.Name).Output() if err != nil { level.Warn(logger).Log("msg", "S.M.A.R.T. output reading", "err", err, "device", device.Info_Name) }