From b059e0f97d1f8a77c1f7bf03056c2e926e5532d4 Mon Sep 17 00:00:00 2001 From: Elias Ohm Date: Mon, 20 Jul 2020 02:50:30 +0200 Subject: [PATCH] user maximum size for auto-sized volumes as total space for calculation * 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 --- check_netapp_ontap.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/check_netapp_ontap.pl b/check_netapp_ontap.pl index b28c718..abe6181 100644 --- a/check_netapp_ontap.pl +++ b/check_netapp_ontap.pl @@ -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)) { @@ -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' ) {