]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Find Areca sg device in the documented way; no idea about vsf info
authorDan Mick <dan.mick@redhat.com>
Tue, 8 Sep 2015 18:33:13 +0000 (11:33 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 8 Sep 2015 18:41:13 +0000 (11:41 -0700)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
roles/testnode/files/libexec/smart.pl

index addd56b6843be5747a7fe2d899db0d90c5cf0fa9..f55870ee267dc1fb3c1cc7ce93f35a8106b1a460 100644 (file)
@@ -178,9 +178,16 @@ if ( $pci =~ /areca/i)
                push(@out,$message);
        }
 
-       my $vsf= `sudo /usr/sbin/cli64 vsf info  | grep -v Capacity | grep -v ======== | grep -v ErrMsg | wc -l`;
-       chomp $vsf;
-       my $scsidev = "/dev/sg$vsf";
+        open (SG, '/proc/scsi/sg/devices');
+       my $sgindex = 0;
+       while (<SG>) {
+               my ($host, $chan, $id, $lun, $type, $opens, $depth, $busy, $online) = split();
+               if ($type == 3) {
+                       last;
+               }
+               $sgindex++;
+       }
+       my $scsidev = "/dev/sg$sgindex";
        open(CLI,"sudo /usr/sbin/cli64 disk info | grep -vi Modelname | grep -v ====== | grep -vi GuiErr | grep -vi Free | grep -vi Failed | grep -vi 'N.A.' |");
        while (<CLI>)
        {