From 65f5beeb11314f51060120ab784749a4fa125501 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 21 Jun 2026 19:47:19 +0200 Subject: [PATCH] Add hardware RAID passthrough devices config Add an opt-in SMART module config option for manually listing hardware RAID passthrough devices, expose configured physical disks to smartctl, and document the option. https://github.com/webmin/webmin/issues/1704 --- smart-status/config | 1 + smart-status/config.info | 1 + smart-status/config_info.pl | 20 ++++++ smart-status/help/config_raid_devices.html | 13 ++++ smart-status/smart-status-lib.pl | 76 ++++++++++++++++++++-- 5 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 smart-status/config_info.pl create mode 100644 smart-status/help/config_raid_devices.html diff --git a/smart-status/config b/smart-status/config index 2f395c4f9..f8954775b 100644 --- a/smart-status/config +++ b/smart-status/config @@ -2,3 +2,4 @@ smartctl=smartctl mode=1 attribs=1 ata=0 +raid_devices= diff --git a/smart-status/config.info b/smart-status/config.info index 877a82feb..1b71abcdd 100644 --- a/smart-status/config.info +++ b/smart-status/config.info @@ -3,3 +3,4 @@ attribs=Show all attributes,1,1-Yes,0-No smartctl=Full path to smartctl command,0 ata=Force ATA query mode?,1,1-Yes,0-No extra=Extra command-line parameters to smartctl,3,None +raid_devices=Hardware RAID passthrough devices,15,raid_devices diff --git a/smart-status/config_info.pl b/smart-status/config_info.pl new file mode 100644 index 000000000..d19d7a1d4 --- /dev/null +++ b/smart-status/config_info.pl @@ -0,0 +1,20 @@ +sub show_raid_devices +{ +my ($value) = @_; +$value ||= ""; +$value =~ s/\t/\n/g; +my $placeholder = "e_escape("/dev/sg0 cciss 0 3"); +return &ui_textarea("raid_devices", $value, 3, 60, undef, 0, + "placeholder=\"$placeholder\""); +} + +sub parse_raid_devices +{ +my $value = $in{'raid_devices'} || ""; +$value =~ s/\r//g; +$value =~ s/\n/\t/g; +$value =~ s/\s+$//; +return $value; +} + +1; diff --git a/smart-status/help/config_raid_devices.html b/smart-status/help/config_raid_devices.html new file mode 100644 index 000000000..735794bad --- /dev/null +++ b/smart-status/help/config_raid_devices.html @@ -0,0 +1,13 @@ +
Hardware RAID passthrough devices
+ +This option can be used to add physical disks behind hardware RAID +controllers when they are not detected automatically, but can be queried +by smartctl through a passthrough device. Leave it empty unless +you need to monitor disks behind such a controller.

+ +For example, /dev/sg0 cciss 0 3 adds three cciss +physical disks numbered 0, 1 and 2 through the /dev/sg0 +passthrough device. The final value is the number of disks to add, not the +last disk number.

+ +