]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Proceed as JBOD if not RAID
authordgalloway <dgallowa@REDHAT.COM>
Wed, 16 Sep 2015 14:16:39 +0000 (10:16 -0400)
committerdgalloway <dgallowa@REDHAT.COM>
Wed, 16 Sep 2015 14:54:03 +0000 (10:54 -0400)
roles/testnode/files/libexec/smart.pl

index 4ae1aeb135e2724a1a7f7c7978cdf5c534de450e..34162a934fbf616af9113c0adda5010f895a8015 100644 (file)
@@ -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 (<BLOCK>)
-       {
-               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 (<BLOCK>)
+       {
+               my @output = split;
+               my $blockdevice = $output[3];
+               foreach ( $blockdevice )
+               {
+                       $drives++;
+                       smartctl("$smartctl","none",$blockdevice,"none");
+               }
+       }
+}
+
 # show results
 my $result = 0;
 $result = 1 if $warn;