From d9db045141b08d90fdf68e4168639fca4288123c Mon Sep 17 00:00:00 2001 From: dgalloway Date: Wed, 16 Sep 2015 10:16:39 -0400 Subject: [PATCH] Proceed as JBOD if not RAID --- roles/testnode/files/libexec/smart.pl | 35 ++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/roles/testnode/files/libexec/smart.pl b/roles/testnode/files/libexec/smart.pl index 4ae1aeb..34162a9 100644 --- a/roles/testnode/files/libexec/smart.pl +++ b/roles/testnode/files/libexec/smart.pl @@ -11,7 +11,6 @@ my $out; my @out; my $drives; my $pci; -my $scsi; my $type; my $mdadm; my $fullcommand; @@ -21,7 +20,6 @@ my $multiline; my $hostname = `uname -n`; chomp $hostname; my $pci = `lspci | /bin/grep -i raid | /bin/grep -v PATA | /usr/bin/head -1`; -my $scsi = `lspci | /bin/grep -i scsi | /bin/grep -v PATA | /usr/bin/head -1`; my $smartctl = "/usr/sbin/smartctl"; @@ -126,23 +124,6 @@ sub smartctl } } -#1068 IT controller OR Intel SAS. -if ( $scsi =~ /SAS1068E/i || $scsi =~ /Patsburg/i ) -{ - open(BLOCK,"cat /proc/partitions | grep -w sd[a-z] |"); - while () - { - my @output = split; - my $blockdevice = $output[3]; - foreach ( $blockdevice ) - { - $drives++; - smartctl("$smartctl","none",$blockdevice,"none"); - } - } -} - - # software raid! if (-e "/proc/mdstat") { @@ -219,6 +200,22 @@ if ( $pci =~ /areca/i) } } +# assume JBOD/direct access if not areca or hw raid +if ( $mdadm == 0 && $pci !~ /areca/i ) +{ + open(BLOCK,"cat /proc/partitions | grep -w sd[a-z] |"); + while () + { + my @output = split; + my $blockdevice = $output[3]; + foreach ( $blockdevice ) + { + $drives++; + smartctl("$smartctl","none",$blockdevice,"none"); + } + } +} + # show results my $result = 0; $result = 1 if $warn; -- 2.39.5