From cb0aa9823eb7b7dd0555c6a1352ec97278b673d2 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 26 Sep 2020 15:18:55 -0600 Subject: [PATCH] retrieve all device data. SAS devices do not return power on hours when using `-a` flag (unlike other device types). fixes #43 fixes #9 --- README.md | 2 +- collector/pkg/collector/metrics.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae324f6..8a1032b 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ analogj/scrutiny - `/run/udev` is necessary to provide the Scrutiny collector with access to your device metadata - `--cap-add SYS_RAWIO` is necessary to allow `smartctl` permission to query your device SMART data - - NOTE: If you have NVMe drives, you must use `--cap-add SYS_ADMIN` instead. See [#26](https://github.com/AnalogJ/scrutiny/issues/26) + - NOTE: If you have NVMe drives, you must use `--cap-add SYS_ADMIN` instead. See issue [#26](https://github.com/AnalogJ/scrutiny/issues/26#issuecomment-696817130) - `--device` entries are required to ensure that your hard disk devices are accessible within the container - `analogj/scrutiny` is a omnibus image, containing both the webapp server (frontend & api) as well as the S.M.A.R.T metric collector. (see below) diff --git a/collector/pkg/collector/metrics.go b/collector/pkg/collector/metrics.go index c98e83c..394e0e3 100644 --- a/collector/pkg/collector/metrics.go +++ b/collector/pkg/collector/metrics.go @@ -105,7 +105,7 @@ func (mc *MetricsCollector) Collect(deviceWWN string, deviceName string, deviceT //defer wg.Done() mc.logger.Infof("Collecting smartctl results for %s\n", deviceName) - args := []string{"-a", "-j"} + args := []string{"-x", "-j"} //only include the device type if its a non-standard one. In some cases ata drives are detected as scsi in docker, and metadata is lost. if len(deviceType) > 0 && deviceType != "scsi" && deviceType != "ata" { args = append(args, "-d", deviceType)