mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-23 01:43:07 +01:00
Avoid running mineVersion when the SMARTctlInfo struct is not ready
Signed-off-by: Jakub Klinkovský <j.l.k@gmx.com>
This commit is contained in:
parent
6e2143ca62
commit
a35f67bb0f
1 changed files with 3 additions and 1 deletions
|
@ -45,7 +45,9 @@ func (smart *SMARTctlInfo) SetJSON(json gjson.Result) {
|
|||
|
||||
// Collect metrics
|
||||
func (smart *SMARTctlInfo) Collect() {
|
||||
smart.mineVersion()
|
||||
if smart.Ready {
|
||||
smart.mineVersion()
|
||||
}
|
||||
}
|
||||
|
||||
func (smart *SMARTctlInfo) mineVersion() {
|
||||
|
|
Loading…
Reference in a new issue