From 706e922dff67ee199498c0582154d2ff862c2884 Mon Sep 17 00:00:00 2001 From: TPOB <19909103+TTTPOB@users.noreply.github.com> Date: Mon, 12 Aug 2024 22:14:27 +0800 Subject: [PATCH] fix(inputs.smartctl): Use --scan-open instead of --scan to provide correct device type info (#15724) --- plugins/inputs/smartctl/README.md | 4 ++-- plugins/inputs/smartctl/sample.conf | 2 +- plugins/inputs/smartctl/smartctl_scan.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/inputs/smartctl/README.md b/plugins/inputs/smartctl/README.md index a43f5876b..93892ecf1 100644 --- a/plugins/inputs/smartctl/README.md +++ b/plugins/inputs/smartctl/README.md @@ -48,7 +48,7 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details. ## Devices to include or exclude ## By default, the plugin will use all devices found in the output of - ## `smartctl --scan`. Only one option is allowed at a time. If set, include + ## `smartctl --scan-open`. Only one option is allowed at a time. If set, include ## sets the specific devices to scan, while exclude omits specific devices. # devices_include = [] # devices_exclude = [] @@ -96,7 +96,7 @@ Defaults!SMARTCTL !logfile, !syslog, !pam_session This plugin uses the following commands to determine devices and collect metrics: -* `smartctl --json --scan` +* `smartctl --json --scan-open` * `smartctl --json --all $DEVICE --device $TYPE --nocheck=$NOCHECK` Please include the output of the above two commands for all devices that are diff --git a/plugins/inputs/smartctl/sample.conf b/plugins/inputs/smartctl/sample.conf index e4bbe243e..85cd4d562 100644 --- a/plugins/inputs/smartctl/sample.conf +++ b/plugins/inputs/smartctl/sample.conf @@ -11,7 +11,7 @@ ## Devices to include or exclude ## By default, the plugin will use all devices found in the output of - ## `smartctl --scan`. Only one option is allowed at a time. If set, include + ## `smartctl --scan-open`. Only one option is allowed at a time. If set, include ## sets the specific devices to scan, while exclude omits specific devices. # devices_include = [] # devices_exclude = [] diff --git a/plugins/inputs/smartctl/smartctl_scan.go b/plugins/inputs/smartctl/smartctl_scan.go index 36784b61a..a7ab69229 100644 --- a/plugins/inputs/smartctl/smartctl_scan.go +++ b/plugins/inputs/smartctl/smartctl_scan.go @@ -9,7 +9,7 @@ import ( ) // This is here so we can override it during testing -var scanArgs = []string{"--json", "--scan"} +var scanArgs = []string{"--json", "--scan-open"} type scanDevice struct { Name string