From f77c827644a0807312843bf40727994066d25198 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 25 Jun 2019 17:39:15 +0200 Subject: [PATCH] hardened code avaya aes --- .../hardware/telephony/avaya/aes/snmp/mode/services.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/hardware/telephony/avaya/aes/snmp/mode/services.pm b/centreon-plugins/hardware/telephony/avaya/aes/snmp/mode/services.pm index 8c3f2efeb..8e80b0a62 100644 --- a/centreon-plugins/hardware/telephony/avaya/aes/snmp/mode/services.pm +++ b/centreon-plugins/hardware/telephony/avaya/aes/snmp/mode/services.pm @@ -224,6 +224,7 @@ sub manage_aep { sub add_service { my ($self, %options) = @_; + return if (!defined($options{display})); return if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $options{display} !~ /$self->{option_results}->{filter_name}/); $self->{service}->{$options{display}} = { %options }; @@ -255,7 +256,8 @@ sub manage_selection { state => $result->{avAesTsapiState}, status => $result->{avAesTsapiStatus}, license_error => $result->{avAesTsapiLicenseError}, - avAesTsapiClientsConnected => $result->{avAesTsapiClientsConnected} != -1 ? $result->{avAesTsapiClientsConnected} : undef, + avAesTsapiClientsConnected => + defined($result->{avAesTsapiClientsConnected}) && $result->{avAesTsapiClientsConnected} != -1 ? $result->{avAesTsapiClientsConnected} : undef, ); $self->add_service( display => $result->{avAesDlgName}, @@ -268,7 +270,8 @@ sub manage_selection { state => $result->{avAesDmccState}, status => $result->{avAesDmccStatus}, license_error => $result->{avAesDmccLicenseError}, - mem_used_prct => ($result->{avAesDmccUsedMemory} * 100) / ($result->{avAesDmccUsedMemory} + $result->{avAesDmccFreeMemory}) + mem_used_prct => + defined($result->{avAesDmccFreeMemory}) ? (($result->{avAesDmccUsedMemory} * 100) / ($result->{avAesDmccUsedMemory} + $result->{avAesDmccFreeMemory})) : undef ); $self->manage_aep(%options);