From 069dfd3b2d2ba0afc8fc0aa34b5bd839b3e640a1 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 28 Oct 2019 13:40:44 +0100 Subject: [PATCH] fix netapp snapmirrorlag --- storage/netapp/snmp/mode/snapmirrorlag.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/storage/netapp/snmp/mode/snapmirrorlag.pm b/storage/netapp/snmp/mode/snapmirrorlag.pm index 1b8bed064..d300b932d 100644 --- a/storage/netapp/snmp/mode/snapmirrorlag.pm +++ b/storage/netapp/snmp/mode/snapmirrorlag.pm @@ -107,7 +107,7 @@ sub check_snapmirror { } my $id_selected = []; - my $snmp_result_name = $options{snmp}->get_table(oid => $oid_snapmirrorSrc, nothing_quit => 1); + my $snmp_result_name = $options{snmp}->get_table(oid => $oid_snapmirrorSrc); foreach my $oid (keys %$snmp_result_name) { next if ($oid !~ /\.([0-9]+)$/); my $instance = $1; @@ -121,11 +121,8 @@ sub check_snapmirror { push @$id_selected, $instance; } - if (scalar(@$id_selected) <= 0) { - $self->{output}->add_option_msg(short_msg => "No snapmirrors found for filter '" . $self->{option_results}->{filter_name} . "'."); - $self->{output}->option_exit(); - } - + return if (scalar(@$id_selected) <= 0); + my $map_state = { 1 => 'uninitialized', 2 => 'snapmirrored', 3 => 'brokenOff', 4 => 'quiesced', @@ -159,8 +156,10 @@ sub check_snapmirror { sub check_sm { my ($self, %options) = @_; + return if (scalar(keys %{$self->{snapmirror}}) > 0); + my $oid_snapmirrorRelSrcPath = '.1.3.6.1.4.1.789.1.29.1.1.2'; - + my $id_selected = []; my $snmp_result_name = $options{snmp}->get_table(oid => $oid_snapmirrorRelSrcPath, nothing_quit => 1); foreach my $oid (keys %$snmp_result_name) {