remove useless code

This commit is contained in:
garnier-quentin 2020-06-16 17:59:54 +02:00
parent 58ea20c94e
commit 7abeb15461
7 changed files with 46 additions and 46 deletions

View File

@ -125,8 +125,8 @@ sub set_counters {
output_use => 'traffic_per_seconds', threshold_use => 'traffic_per_seconds', output_use => 'traffic_per_seconds', threshold_use => 'traffic_per_seconds',
perfdatas => [ perfdatas => [
{ value => 'traffic_per_seconds', template => '%d', { 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 => { { label => 'channels-maxjitter', nlabel => 'call.channels.maxjitter.milliseconds', set => {
@ -137,8 +137,8 @@ sub set_counters {
output_use => 'max_jitter', threshold_use => 'max_jitter', output_use => 'max_jitter', threshold_use => 'max_jitter',
perfdatas => [ perfdatas => [
{ value => 'max_jitter', template => '%d', { 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 => { { label => 'channels-packetloss', nlabel => 'call.channels.packetloss.count', set => {
@ -149,8 +149,8 @@ sub set_counters {
threshold_use => 'packets_loss', threshold_use => 'packets_loss',
perfdatas => [ perfdatas => [
{ value => 'packets_loss', template => '%d', { 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 => { { 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', threshold_use => 'packets_loss_prct',
perfdatas => [ perfdatas => [
{ value => 'packets_loss_prct', template => '%.2f', { 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' }
], ]
} }
}, }
]; ];
} }

View File

@ -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_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_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_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} = [ $self->{maps_counters}->{global} = [
@ -61,8 +61,8 @@ sub set_counters {
key_values => [ { name => 'new_calls' } ], key_values => [ { name => 'new_calls' } ],
output_template => 'total calls finished: %d', output_template => 'total calls finished: %d',
perfdatas => [ perfdatas => [
{ value => 'new_calls', template => '%d', min => 0 }, { template => '%d', min => 0 }
], ]
} }
} }
]; ];
@ -72,8 +72,8 @@ sub set_counters {
key_values => [ { name => 'peoplecount' } ], key_values => [ { name => 'peoplecount' } ],
output_template => 'people count: %s', output_template => 'people count: %s',
perfdatas => [ 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' } ], key_values => [ { name => 'loss' }, { name => 'pkts' }, { name => 'loss_prct' } ],
closure_custom_output => $self->can('custom_loss_output'), closure_custom_output => $self->can('custom_loss_output'),
perfdatas => [ perfdatas => [
{ value => 'loss', template => '%d', min => 0 }, { template => '%d', min => 0 }
], ]
} }
}, },
{ label => 'packetloss-prct', nlabel => 'calls.' . $type . '.' . $direction . '.packetloss.percentage', display_ok => 0, set => { { label => 'packetloss-prct', nlabel => 'calls.' . $type . '.' . $direction . '.packetloss.percentage', display_ok => 0, set => {
key_values => [ { name => 'loss_prct' }, { name => 'loss' }, { name => 'pkts' } ], key_values => [ { name => 'loss_prct' }, { name => 'loss' }, { name => 'pkts' } ],
closure_custom_output => $self->can('custom_loss_output'), closure_custom_output => $self->can('custom_loss_output'),
perfdatas => [ 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 => { { label => 'maxjitter', nlabel => 'calls.' . $type . '.' . $direction . '.maxjitter.count', set => {
key_values => [ { name => 'maxjitter' } ], key_values => [ { name => 'maxjitter' } ],
output_template => 'max jitter: %s ms', output_template => 'max jitter: %s ms',
perfdatas => [ 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_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_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_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})); 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$/) { if ($_->{RoomAnalytics}->{PeopleCount} =~ /^N\/A$/) {
$self->{'global_roomanalytics'}->{peoplecount} = 0; $self->{global_roomanalytics}->{peoplecount} = 0;
} }
} }

View File

@ -39,7 +39,7 @@ sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{maps_counters_type} = [ $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} = [ $self->{maps_counters}->{certificates} = [
@ -47,8 +47,8 @@ sub set_counters {
key_values => [ { name => 'validity_time' }, { name => 'generation_time' } ], key_values => [ { name => 'validity_time' }, { name => 'generation_time' } ],
closure_custom_output => $self->can('custom_validity_output'), closure_custom_output => $self->can('custom_validity_output'),
perfdatas => [ 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}} = { $self->{certificates}->{$_->{item}} = {
display => $_->{SubjectName}, display => $_->{SubjectName},
validity_time => $end_date - time(), 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())
}; };
} }
} }

View File

@ -54,17 +54,17 @@ sub set_system {
['InProgress', 'OK'], ['InProgress', 'OK'],
['InstallationFailed', 'CRITICAL'], ['InstallationFailed', 'CRITICAL'],
['Failed', 'CRITICAL'], ['Failed', 'CRITICAL'],
['Succeeded', 'OK'], ['Succeeded', 'OK']
], ],
software_urgency => [ software_urgency => [
['Low', 'OK'], ['Low', 'OK'],
['Medium', 'OK'], ['Medium', 'OK'],
['Critical', 'CRITICAL'], ['Critical', 'CRITICAL']
], ],
signal_state => [ signal_state => [
['OK', 'OK'], ['OK', 'OK'],
['Unsupported', 'WARNING'], ['Unsupported', 'WARNING'],
['Unknown', 'UNKNOWN'], ['Unknown', 'UNKNOWN']
], ],
format_status => [ format_status => [
['Ok', 'OK'], ['Ok', 'OK'],
@ -72,24 +72,24 @@ sub set_system {
['NotFound', 'OK'], ['NotFound', 'OK'],
['Error', 'CRITICAL'], ['Error', 'CRITICAL'],
['Interlaced', 'OK'], ['Interlaced', 'OK'],
['Unknown', 'UNKNOWN'], ['Unknown', 'UNKNOWN']
], ],
webex => [ webex => [
['Disabled', 'OK'], ['Disabled', 'OK'],
['Stopped', 'OK'], ['Stopped', 'OK'],
['Error', 'CRITICAL'], ['Error', 'CRITICAL'],
['Registered', 'OK'], ['Registered', 'OK'],
['Registering', 'OK'], ['Registering', 'OK']
], ],
st_status => [ st_status => [
['Inactive', 'WARNING'], ['Inactive', 'WARNING'],
['Active', 'OK'], ['Active', 'OK']
], ],
st_availability => [ st_availability => [
['Unavailable', 'WARNING'], ['Unavailable', 'WARNING'],
['Available', 'OK'], ['Available', 'OK'],
['Off', 'OK'], ['Off', 'OK']
], ]
}; };
$self->{components_exec_load} = 0; $self->{components_exec_load} = 0;

View File

@ -63,9 +63,9 @@ sub set_counters {
closure_custom_calc => $self->can('custom_status_calc'), closure_custom_calc => $self->can('custom_status_calc'),
closure_custom_output => $self->can('custom_status_output'), closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; }, 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 => { $options{options}->add_options(arguments => {
'filter-msg:s' => { name => 'filter_msg' }, 'filter-msg:s' => { name => 'filter_msg' },
'warning-status:s' => { name => 'warning_status', default => '%{level} =~ /warning|minor/i' }, '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; return $self;

View File

@ -29,7 +29,7 @@ sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{maps_counters_type} = [ $self->{maps_counters_type} = [
{ name => 'global', type => 0 }, { name => 'global', type => 0 }
]; ];
$self->{maps_counters}->{global} = [ $self->{maps_counters}->{global} = [
@ -37,8 +37,8 @@ sub set_counters {
key_values => [ { name => 'connected' } ], key_values => [ { name => 'connected' } ],
output_template => 'peripherals connected: %d', output_template => 'peripherals connected: %d',
perfdatas => [ perfdatas => [
{ value => 'connected', template => '%d', min => 0 }, { template => '%d', min => 0 }
], ]
} }
} }
]; ];
@ -51,7 +51,7 @@ sub new {
$self->{version} = '1.0'; $self->{version} = '1.0';
$options{options}->add_options(arguments => { $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( centreon::plugins::misc::mymodule_load(

View File

@ -29,7 +29,7 @@ sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{maps_counters_type} = [ $self->{maps_counters_type} = [
{ name => 'global', type => 0 }, { name => 'global', type => 0 }
]; ];
$self->{maps_counters}->{global} = [ $self->{maps_counters}->{global} = [
@ -37,8 +37,8 @@ sub set_counters {
key_values => [ { name => 'sessions' } ], key_values => [ { name => 'sessions' } ],
output_template => 'total current sessions: %d', output_template => 'total current sessions: %d',
perfdatas => [ perfdatas => [
{ value => 'sessions', template => '%d', min => 0 }, { template => '%d', min => 0 }
], ]
} }
} }
]; ];