mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-12-21 02:21:55 +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)
|
||||
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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue