From 26196daec6d73aee4fa7e2c960f4b3c68df578e1 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Tue, 27 Oct 2020 08:53:53 +0100 Subject: [PATCH] fix ipsec tunnel (#2286) --- .../common/cisco/standard/snmp/mode/ipsectunnel.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/centreon/common/cisco/standard/snmp/mode/ipsectunnel.pm b/centreon/common/cisco/standard/snmp/mode/ipsectunnel.pm index fd79bd5ef..8c06ac262 100644 --- a/centreon/common/cisco/standard/snmp/mode/ipsectunnel.pm +++ b/centreon/common/cisco/standard/snmp/mode/ipsectunnel.pm @@ -130,6 +130,11 @@ sub custom_traffic_output { sub custom_traffic_calc { my ($self, %options) = @_; + if (!defined($options{old_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}})) { + $self->{error_msg} = "Buffer creation"; + return -1; + } + my $total_bytes = 0; foreach (keys %{$options{new_datas}}) { if (/$self->{instance}_cipSecTunHc$options{extra_options}->{label_ref}Octets_(\d+)/) { @@ -191,6 +196,11 @@ sub custom_drop_output { sub custom_drop_calc { my ($self, %options) = @_; + if (!defined($options{old_datas}->{$self->{instance} . '_' . $options{extra_options}->{label_ref}})) { + $self->{error_msg} = "Buffer creation"; + return -1; + } + my $total_pkts = 0; foreach (keys %{$options{new_datas}}) { if (/$self->{instance}_cipSecTun$options{extra_options}->{label_ref}DropPkts_(\d+)/) {