From 06115fbba27ed61281388c734bdc11fbc53545a6 Mon Sep 17 00:00:00 2001 From: CPbN <40244829+CPbN@users.noreply.github.com> Date: Wed, 15 Jan 2020 18:05:49 +0100 Subject: [PATCH] Simplify --- apps/voip/3cx/restapi/mode/system.pm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/voip/3cx/restapi/mode/system.pm b/apps/voip/3cx/restapi/mode/system.pm index fbb22c1d6..72c82d761 100644 --- a/apps/voip/3cx/restapi/mode/system.pm +++ b/apps/voip/3cx/restapi/mode/system.pm @@ -24,7 +24,7 @@ use base qw(centreon::plugins::templates::counter); use strict; use warnings; -use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold); +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc); sub custom_status_output { my ($self, %options) = @_; @@ -37,14 +37,6 @@ sub custom_status_output { return $msg; } -sub custom_status_calc { - my ($self, %options) = @_; - - $self->{result_values}->{error} = $options{new_datas}->{$self->{instance} . '_error'}; - $self->{result_values}->{service} = $options{new_datas}->{$self->{instance} . '_service'}; - return 0; -} - sub set_counters { my ($self, %options) = @_; @@ -77,7 +69,7 @@ sub set_counters { $self->{maps_counters}->{service} = [ { label => 'status', threshold => 0, set => { key_values => [ { name => 'error' }, { name => 'service' } ], - closure_custom_calc => $self->can('custom_status_calc'), + closure_custom_calc => \&catalog_status_calc, closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, closure_custom_threshold_check => \&catalog_status_threshold,