From a9d76dd030fd0f74b716815c815a249651a867dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 28 Feb 2020 13:58:33 +0100 Subject: [PATCH] Put disk_list file content to disks array --- xymon/plugins/client/ext/smart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xymon/plugins/client/ext/smart b/xymon/plugins/client/ext/smart index b26421b..5eb524a 100755 --- a/xymon/plugins/client/ext/smart +++ b/xymon/plugins/client/ext/smart @@ -33,11 +33,13 @@ else { # fallback to disk detection if nothing defined in the config unless (@disks) { - opendir(DIR, '/dev') or die $!; - while (my $dev = readdir(DIR)) { - push(@disks, "/dev/$dev") if ($dev =~ /^[vs]d.*\D$/); + ## Put temp_disk_list content to disks array + open(my $fh, '<:encoding(UTF-8)', $temp_disk_list) + or die "Could not open file '$temp_disk_list' $!"; + while (my $row = <$fh>) { + chomp $row; + push(@disks, "$row"); } - closedir(DIR); } my @stat = stat($CACHEFILE);