From: Dan Mick Date: Tue, 8 Sep 2015 18:33:13 +0000 (-0700) Subject: Find Areca sg device in the documented way; no idea about vsf info X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fc0a786f9d124bbaf476916c1b700c5cbf8cfcbf;p=ceph-cm-ansible.git Find Areca sg device in the documented way; no idea about vsf info Signed-off-by: Dan Mick --- diff --git a/roles/testnode/files/libexec/smart.pl b/roles/testnode/files/libexec/smart.pl index addd56b..f55870e 100644 --- a/roles/testnode/files/libexec/smart.pl +++ b/roles/testnode/files/libexec/smart.pl @@ -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 () { + 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 () {