Skip to content

Commit

Permalink
user maximum size for auto-sized volumes as total space for calculation
Browse files Browse the repository at this point in the history
* implemented as fixed default as I think there isn't a real need to monitor on the current volume total-size boundary on such volumes
  • Loading branch information
Elias481 committed Jul 20, 2020
1 parent cd21084 commit 304cd29
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions check_netapp_ontap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,7 @@ sub get_volume_space {
my $nahTag = NaElement->new("tag");
my $strActiveTag = "";
my %hshVolUsage;
my $volAutoSizeAttr;

# Narrow search to only the requested node if configured by user with the -n option
if (defined($strVHost)) {
Expand Down Expand Up @@ -1541,6 +1542,12 @@ sub get_volume_space {
$hshVolUsage{$strVolName}{'state'} = $nahVol->child_get("volume-state-attributes")->child_get_string("state");
} else {
$hshVolUsage{$strVolName}{'state'} = $nahVol->child_get("volume-state-attributes")->child_get_string("state");
$volAutoSizeAttr = $nahVol->child_get('volume-autosize-attributes');
if (defined($volAutoSizeAttr) && $volAutoSizeAttr->child_get_string('mode') =~ m/^grow(?:_shrink)$/) {
$hshVolUsage{$strVolName}{'space-total'} = $volAutoSizeAttr->child_get_string("maximum-size");
} else {
$hshVolUsage{$strVolName}{'space-total'} = $nahVol->child_get("volume-space-attributes")->child_get_string("size-total");
}
$hshVolUsage{$strVolName}{'space-total'} = $nahVol->child_get("volume-space-attributes")->child_get_string("size-total");
if ($debug) {
if ( $hshVolUsage{$strVolName}{'space-total'} == 0 || $hshVolUsage{$strVolName}{'space-total'} eq '0' ) {
Expand Down

0 comments on commit 304cd29

Please sign in to comment.