Merge pull request #88 from k0ste/help3

Pruned /dev/ prefix from device label
This commit is contained in:
Ben Kochie 2022-10-20 11:31:44 +01:00 committed by GitHub
commit 3a8968a04a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,7 +46,7 @@ func NewSMARTctl(logger log.Logger, json gjson.Result, ch chan<- prometheus.Metr
json: json,
logger: logger,
device: SMARTDevice{
device: strings.TrimSpace(json.Get("device.name").String()),
device: strings.TrimPrefix(strings.TrimSpace(json.Get("device.name").String()), "/dev/"),
serial: strings.TrimSpace(json.Get("serial_number").String()),
family: strings.TrimSpace(json.Get("model_family").String()),
model: strings.TrimSpace(json.Get("model_name").String()),