From 7abeb154618e9b5d7f605b2ba2c40a5701db01b7 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 16 Jun 2020 17:59:54 +0200 Subject: [PATCH] remove useless code --- .../devices/cisco/ces/restapi/mode/callsrt.pm | 18 +++++------ .../cisco/ces/restapi/mode/callssummary.pm | 30 +++++++++---------- .../cisco/ces/restapi/mode/certificates.pm | 8 ++--- .../cisco/ces/restapi/mode/components.pm | 16 +++++----- .../cisco/ces/restapi/mode/diagnostics.pm | 6 ++-- .../cisco/ces/restapi/mode/peripherals.pm | 8 ++--- .../cisco/ces/restapi/mode/sessions.pm | 6 ++-- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/hardware/devices/cisco/ces/restapi/mode/callsrt.pm b/hardware/devices/cisco/ces/restapi/mode/callsrt.pm index 9a477dd3f..76722af64 100644 --- a/hardware/devices/cisco/ces/restapi/mode/callsrt.pm +++ b/hardware/devices/cisco/ces/restapi/mode/callsrt.pm @@ -125,8 +125,8 @@ sub set_counters { output_use => 'traffic_per_seconds', threshold_use => 'traffic_per_seconds', perfdatas => [ { value => 'traffic_per_seconds', template => '%d', - unit => 'B/s', min => 0, label_extra_instance => 1, instance_use => 'display' }, - ], + unit => 'B/s', min => 0, label_extra_instance => 1, instance_use => 'display' } + ] } }, { label => 'channels-maxjitter', nlabel => 'call.channels.maxjitter.milliseconds', set => { @@ -137,8 +137,8 @@ sub set_counters { output_use => 'max_jitter', threshold_use => 'max_jitter', perfdatas => [ { value => 'max_jitter', template => '%d', - unit => 'ms', min => 0, label_extra_instance => 1, instance_use => 'display' }, - ], + unit => 'ms', min => 0, label_extra_instance => 1, instance_use => 'display' } + ] } }, { label => 'channels-packetloss', nlabel => 'call.channels.packetloss.count', set => { @@ -149,8 +149,8 @@ sub set_counters { threshold_use => 'packets_loss', perfdatas => [ { value => 'packets_loss', template => '%d', - min => 0, label_extra_instance => 1, instance_use => 'display' }, - ], + min => 0, label_extra_instance => 1, instance_use => 'display' } + ] } }, { label => 'channels-packetloss-prct', nlabel => 'call.channels.packetloss.percentage', display_ok => 0, set => { @@ -161,10 +161,10 @@ sub set_counters { threshold_use => 'packets_loss_prct', perfdatas => [ { value => 'packets_loss_prct', template => '%.2f', - unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' }, - ], + unit => '%', min => 0, max => 100, label_extra_instance => 1, instance_use => 'display' } + ] } - }, + } ]; } diff --git a/hardware/devices/cisco/ces/restapi/mode/callssummary.pm b/hardware/devices/cisco/ces/restapi/mode/callssummary.pm index e222b9bfc..0f49228c3 100644 --- a/hardware/devices/cisco/ces/restapi/mode/callssummary.pm +++ b/hardware/devices/cisco/ces/restapi/mode/callssummary.pm @@ -53,7 +53,7 @@ sub set_counters { { name => 'global_video_incoming', cb_prefix_output => 'prefix_global_output', type => 0, skipped_code => { -10 => 1 } }, { name => 'global_video_outgoing', cb_prefix_output => 'prefix_global_output', type => 0, skipped_code => { -10 => 1 } }, { name => 'global_audio_incoming', cb_prefix_output => 'prefix_global_output', type => 0, skipped_code => { -10 => 1 } }, - { name => 'global_audio_outgoing', cb_prefix_output => 'prefix_global_output', type => 0, skipped_code => { -10 => 1 } }, + { name => 'global_audio_outgoing', cb_prefix_output => 'prefix_global_output', type => 0, skipped_code => { -10 => 1 } } ]; $self->{maps_counters}->{global} = [ @@ -61,8 +61,8 @@ sub set_counters { key_values => [ { name => 'new_calls' } ], output_template => 'total calls finished: %d', perfdatas => [ - { value => 'new_calls', template => '%d', min => 0 }, - ], + { template => '%d', min => 0 } + ] } } ]; @@ -72,8 +72,8 @@ sub set_counters { key_values => [ { name => 'peoplecount' } ], output_template => 'people count: %s', perfdatas => [ - { value => 'peoplecount', template => '%d', min => 0 }, - ], + { template => '%d', min => 0 } + ] } } ]; @@ -85,26 +85,26 @@ sub set_counters { key_values => [ { name => 'loss' }, { name => 'pkts' }, { name => 'loss_prct' } ], closure_custom_output => $self->can('custom_loss_output'), perfdatas => [ - { value => 'loss', template => '%d', min => 0 }, - ], + { template => '%d', min => 0 } + ] } }, { label => 'packetloss-prct', nlabel => 'calls.' . $type . '.' . $direction . '.packetloss.percentage', display_ok => 0, set => { key_values => [ { name => 'loss_prct' }, { name => 'loss' }, { name => 'pkts' } ], closure_custom_output => $self->can('custom_loss_output'), perfdatas => [ - { value => 'loss_prct', template => '%d', unit => '%', min => 0, max => 100 }, - ], + { template => '%d', unit => '%', min => 0, max => 100 } + ] } }, { label => 'maxjitter', nlabel => 'calls.' . $type . '.' . $direction . '.maxjitter.count', set => { key_values => [ { name => 'maxjitter' } ], output_template => 'max jitter: %s ms', perfdatas => [ - { value => 'maxjitter', template => '%d', unit => 'ms', min => 0 }, - ], + { template => '%d', unit => 'ms', min => 0 } + ] } - }, + } ]; } } @@ -157,7 +157,7 @@ sub manage_selection { $self->{global_video_outgoing} = { loss => 0, pkts => 0, loss_prct => 0, maxjitter => 0, label => 'video outgoing' }; $self->{global_audio_incoming} = { loss => 0, pkts => 0, loss_prct => 0, maxjitter => 0, label => 'audio incoming' }; $self->{global_audio_outgoing} = { loss => 0, pkts => 0, loss_prct => 0, maxjitter => 0, label => 'audio outgoing' }; - $self->{global_roomanalytics} = { peoplecount => 0}; + $self->{global_roomanalytics} = { peoplecount => 0 }; return if (!defined($result->{CallHistoryGetResult}->{Entry})); @@ -185,9 +185,9 @@ sub manage_selection { } } } - $self->{'global_roomanalytics'}->{peoplecount} = $_->{RoomAnalytics}->{PeopleCount}; + $self->{global_roomanalytics}->{peoplecount} = $_->{RoomAnalytics}->{PeopleCount}; if ($_->{RoomAnalytics}->{PeopleCount} =~ /^N\/A$/) { - $self->{'global_roomanalytics'}->{peoplecount} = 0; + $self->{global_roomanalytics}->{peoplecount} = 0; } } diff --git a/hardware/devices/cisco/ces/restapi/mode/certificates.pm b/hardware/devices/cisco/ces/restapi/mode/certificates.pm index cb73eb87d..dbc93f3de 100644 --- a/hardware/devices/cisco/ces/restapi/mode/certificates.pm +++ b/hardware/devices/cisco/ces/restapi/mode/certificates.pm @@ -39,7 +39,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'certificates', type => 1, cb_prefix_output => 'prefix_certificate_output', message_multiple => 'All certificates are ok', skipped_code => { -10 => 1 } }, + { name => 'certificates', type => 1, cb_prefix_output => 'prefix_certificate_output', message_multiple => 'All certificates are ok', skipped_code => { -10 => 1 } } ]; $self->{maps_counters}->{certificates} = [ @@ -47,8 +47,8 @@ sub set_counters { key_values => [ { name => 'validity_time' }, { name => 'generation_time' } ], closure_custom_output => $self->can('custom_validity_output'), perfdatas => [ - { value => 'validity_time', template => '%d', min => 0, unit => 's' }, - ], + { template => '%d', min => 0, unit => 's' } + ] } } ]; @@ -102,7 +102,7 @@ sub manage_selection { $self->{certificates}->{$_->{item}} = { display => $_->{SubjectName}, validity_time => $end_date - time(), - generation_time => centreon::plugins::misc::change_seconds(value => $end_date - time()), + generation_time => centreon::plugins::misc::change_seconds(value => $end_date - time()) }; } } diff --git a/hardware/devices/cisco/ces/restapi/mode/components.pm b/hardware/devices/cisco/ces/restapi/mode/components.pm index bb21cfb4d..c65f69f4b 100644 --- a/hardware/devices/cisco/ces/restapi/mode/components.pm +++ b/hardware/devices/cisco/ces/restapi/mode/components.pm @@ -54,17 +54,17 @@ sub set_system { ['InProgress', 'OK'], ['InstallationFailed', 'CRITICAL'], ['Failed', 'CRITICAL'], - ['Succeeded', 'OK'], + ['Succeeded', 'OK'] ], software_urgency => [ ['Low', 'OK'], ['Medium', 'OK'], - ['Critical', 'CRITICAL'], + ['Critical', 'CRITICAL'] ], signal_state => [ ['OK', 'OK'], ['Unsupported', 'WARNING'], - ['Unknown', 'UNKNOWN'], + ['Unknown', 'UNKNOWN'] ], format_status => [ ['Ok', 'OK'], @@ -72,24 +72,24 @@ sub set_system { ['NotFound', 'OK'], ['Error', 'CRITICAL'], ['Interlaced', 'OK'], - ['Unknown', 'UNKNOWN'], + ['Unknown', 'UNKNOWN'] ], webex => [ ['Disabled', 'OK'], ['Stopped', 'OK'], ['Error', 'CRITICAL'], ['Registered', 'OK'], - ['Registering', 'OK'], + ['Registering', 'OK'] ], st_status => [ ['Inactive', 'WARNING'], - ['Active', 'OK'], + ['Active', 'OK'] ], st_availability => [ ['Unavailable', 'WARNING'], ['Available', 'OK'], - ['Off', 'OK'], - ], + ['Off', 'OK'] + ] }; $self->{components_exec_load} = 0; diff --git a/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm b/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm index 1c9c4e7f9..516370e1d 100644 --- a/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm +++ b/hardware/devices/cisco/ces/restapi/mode/diagnostics.pm @@ -63,9 +63,9 @@ sub set_counters { closure_custom_calc => $self->can('custom_status_calc'), closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, - closure_custom_threshold_check => \&catalog_status_threshold, + closure_custom_threshold_check => \&catalog_status_threshold } - }, + } ]; } @@ -77,7 +77,7 @@ sub new { $options{options}->add_options(arguments => { 'filter-msg:s' => { name => 'filter_msg' }, 'warning-status:s' => { name => 'warning_status', default => '%{level} =~ /warning|minor/i' }, - 'critical-status:s' => { name => 'critical_status', default => '%{level} =~ /critical|major/i' }, + 'critical-status:s' => { name => 'critical_status', default => '%{level} =~ /critical|major/i' } }); return $self; diff --git a/hardware/devices/cisco/ces/restapi/mode/peripherals.pm b/hardware/devices/cisco/ces/restapi/mode/peripherals.pm index 5c3e0dc5a..fd72283aa 100644 --- a/hardware/devices/cisco/ces/restapi/mode/peripherals.pm +++ b/hardware/devices/cisco/ces/restapi/mode/peripherals.pm @@ -29,7 +29,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'global', type => 0 }, + { name => 'global', type => 0 } ]; $self->{maps_counters}->{global} = [ @@ -37,8 +37,8 @@ sub set_counters { key_values => [ { name => 'connected' } ], output_template => 'peripherals connected: %d', perfdatas => [ - { value => 'connected', template => '%d', min => 0 }, - ], + { template => '%d', min => 0 } + ] } } ]; @@ -51,7 +51,7 @@ sub new { $self->{version} = '1.0'; $options{options}->add_options(arguments => { - 'filter-since:s' => { name => 'filter_since', default => 86400 }, + 'filter-since:s' => { name => 'filter_since', default => 86400 } }); centreon::plugins::misc::mymodule_load( diff --git a/hardware/devices/cisco/ces/restapi/mode/sessions.pm b/hardware/devices/cisco/ces/restapi/mode/sessions.pm index 56351b865..76570640c 100644 --- a/hardware/devices/cisco/ces/restapi/mode/sessions.pm +++ b/hardware/devices/cisco/ces/restapi/mode/sessions.pm @@ -29,7 +29,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'global', type => 0 }, + { name => 'global', type => 0 } ]; $self->{maps_counters}->{global} = [ @@ -37,8 +37,8 @@ sub set_counters { key_values => [ { name => 'sessions' } ], output_template => 'total current sessions: %d', perfdatas => [ - { value => 'sessions', template => '%d', min => 0 }, - ], + { template => '%d', min => 0 } + ] } } ];