Skip to content

Commit

Permalink
fixed internal disk multipath
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Krogloth committed Aug 23, 2018
1 parent b1a080e commit 6966b7b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
40 changes: 32 additions & 8 deletions check_cdot_multipath.pl
Expand Up @@ -66,6 +66,27 @@ sub Error {
$must_paths = 4;
}

my $shelf_iterator = NaElement->new("storage-shelf-info-get-iter");
$shelf_iterator->child_add_string("max-records", "1000");
my $shelf_response = $s->invoke_elem( $shelf_iterator );
my $shelfs = $shelf_response->child_get("attributes-list");

my @result = $shelfs->children_get();

my %shelfs;

foreach my $shelf (@result) {

my $type = $shelf->child_get_string("module-type");
my $stack = $shelf->child_get_string("stack-id");
my $shelf_id = $shelf->child_get_string("shelf-id");

my $shelf_name = "$stack.$shelf_id";

$shelfs{$shelf_name} = $type;

}

my $iterator = NaElement->new( "storage-disk-get-iter" );
my $tag_elem = NaElement->new( "tag" );
$iterator->child_add( $tag_elem );
Expand Down Expand Up @@ -94,21 +115,24 @@ sub Error {

foreach my $disk (@result) {

my $inventory = $disk->child_get("disk-inventory-info");
my $paths = $disk->child_get( "disk-paths" );
my $path_count = $paths->children_get( "disk-path-info" );
my $disk_name = $disk->child_get_string( "disk-name" );
my $path_info = $paths->child_get( "disk-path-info" );

foreach my $path ($path_info) {
my $shelf = $inventory->child_get_string("shelf");
my $stack_id = $inventory->child_get_string("stack-id");

my $disk_path_name = $path->child_get_string( "disk-name" );
my @split = split( /:/, $disk_path_name );
my $iom_type = $shelfs{"$stack_id.$shelf"};

# Internal disks i.e. A700s have 8 paths
if($iom_type eq "iom12f"){
$must_paths = "8";
}

if((@split eq 2) && ($path_count ne $must_paths)){
unless($path_count > $must_paths){
push @failed_disks, $disk_name;
}
}
unless($path_count eq $must_paths){
push @failed_disks, $disk_name;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions check_cdot_recommendations.pl
Expand Up @@ -241,7 +241,7 @@ sub Error {
}
print "\n";
} else {
print "OK - no volumes without QOS\n"
print "OK - no volumes without QOS\n";
}

if ($guarantee_count != 0) {
Expand All @@ -251,7 +251,7 @@ sub Error {
}
print "\n";
} else {
print "OK - no volumes with wrong space-guarantee\n"
print "OK - no volumes with wrong space-guarantee\n";
}

if ($snapreserve_count != 0){
Expand All @@ -271,7 +271,7 @@ sub Error {
}
print "\n";
} else {
print "OK - no snapmirrors without schedule\n"
print "OK - no snapmirrors without schedule\n";
}

if ($failover_count != 0) {
Expand All @@ -281,7 +281,7 @@ sub Error {
}
print "\n";
} else {
print "OK - no LIFs without failover-groups\n"
print "OK - no LIFs without failover-groups\n";
}

if ($policy_count != 0) {
Expand All @@ -291,7 +291,7 @@ sub Error {
}
print "\n";
} else {
print "OK - no volumes with default snapshot policy (*_root\$,test excluded)\n"
print "OK - no volumes with default snapshot policy (*_root\$,test excluded)\n";
}

exit 1;
Expand Down

0 comments on commit 6966b7b

Please sign in to comment.