mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-16 01:33:07 +01:00
Add better error logging on smartctl exec failure
We will now log a warning if smartctl path passed via command line is invalid. Signed-off-by: Piotr Dobrowolski <admin@tastycode.pl>
This commit is contained in:
parent
2cc2249821
commit
1c9c6943e8
1 changed files with 3 additions and 0 deletions
|
@ -85,6 +85,9 @@ func readSMARTctlDevices(logger log.Logger) gjson.Result {
|
||||||
level.Warn(logger).Log("msg", "S.M.A.R.T. output reading error", "err", err)
|
level.Warn(logger).Log("msg", "S.M.A.R.T. output reading error", "err", err)
|
||||||
return gjson.Result{}
|
return gjson.Result{}
|
||||||
}
|
}
|
||||||
|
} else if err != nil {
|
||||||
|
level.Warn(logger).Log("msg", "S.M.A.R.T. output reading error", "err", err)
|
||||||
|
return gjson.Result{}
|
||||||
}
|
}
|
||||||
return parseJSON(string(out))
|
return parseJSON(string(out))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue