From: dgalloway Date: Wed, 16 Sep 2015 14:16:39 +0000 (-0400) Subject: Proceed as JBOD if not RAID X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9db045141b08d90fdf68e4168639fca4288123c;p=ceph-cm-ansible.git Proceed as JBOD if not RAID --- diff --git a/roles/testnode/files/libexec/smart.pl b/roles/testnode/files/libexec/smart.pl index 4ae1aeb1..34162a93 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;