-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsc_status.pl
More file actions
58 lines (50 loc) · 1.21 KB
/
sc_status.pl
File metadata and controls
58 lines (50 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl -wl
$ip = '10.1.14.50';
@volume = ("ibmsnew-vol4", "ibmsnew-vol3", "ibmsnew-vol2", "ibmsnew-vol1");
#while (@volume) {
for ($i=0;$i<=$#volume;$i++) {
# chomp $volume[$i];
$status = &GetSCstatus($volume[$i], $ip);
print $status;
@stat = split(/ /, $status);
shift(@stat);
print "$volume[$i]";
for ($i=0;$i<=$#stat;$i++) {
print "$stat[$i]";
}
# if ($stat[0] !~ /complete/) {
# print "$volume[$i] is in $stat[1]%";
# } elsif ($stat[0] =~ /complete/) {
# if ($stat[2] =~ /NoFailure/) {
# print "$volume[$i] completed";
# delete $volume[$i];
# }
# }
}
sub GetSCstatus {
($vol, $ip) = @_;
my $r;
undef $r;
# print $vol;
open(STAT, "navicli -h $ip sancopy -info -name $vol -complete -sessionstatus -failure|") or die "$!";
while (<STAT>) {
chomp;
s/\s*//g;
(@line) = split(/:/, $_);
print $line[1];
$r .= " $line[1]";
}
return $r
}
# $var = &GetCompName;
# @complete = split(/ /, $var);
# shift @complete;
# while (@volume) {
#sub GetCompName {
# for ($i=0;$i<=$#volume;$i++) {
# $comp .= " complete$i";
# }
# return $comp;
#}
#@status = `navicli -h $ip sancopy -info -name ibmsnew-vol3`;
# delete $array[index]