From 440cda07bd4ffe4163ed9b74dc367cc4002ceafb Mon Sep 17 00:00:00 2001 From: itoussies <65223458+itoussies@users.noreply.github.com> Date: Mon, 2 Nov 2020 14:34:38 +0100 Subject: [PATCH] discovery mode fix (#2315) --- .../alyvix/restapi/mode/listtestcases.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/apps/monitoring/alyvix/restapi/mode/listtestcases.pm b/centreon-plugins/apps/monitoring/alyvix/restapi/mode/listtestcases.pm index a8cab90c7..212b058f0 100644 --- a/centreon-plugins/apps/monitoring/alyvix/restapi/mode/listtestcases.pm +++ b/centreon-plugins/apps/monitoring/alyvix/restapi/mode/listtestcases.pm @@ -20,11 +20,10 @@ package apps::monitoring::alyvix::restapi::mode::listtestcases; -use base qw(centreon::plugins::templates::counter); +use base qw(centreon::plugins::mode); use strict; use warnings; -use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold); sub new { my ($class, %options) = @_; @@ -38,6 +37,11 @@ sub new { return $self; } +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + sub manage_selection { my ($self, %options) = @_; @@ -81,10 +85,11 @@ sub disco_show { my $testcases = $self->manage_selection(%options); foreach my $testcase (@$testcases) { - next if (defined($self->{option_results}->{filter_case}) - && $self->{option_results}->{filter_case} ne '' - && $testcase->{scenario} !~ /$self->{option_results}->{filter_case}/ ); - $self->{output}->add_disco_entry(name => $testcases->{testcase_alias}); + next if (defined($self->{option_results}->{filter_testcase}) + && $self->{option_results}->{filter_testcase} ne '' + && $testcase->{testcase_alias} !~ /$self->{option_results}->{filter_testcase}/ ); + + $self->{output}->add_disco_entry(name => $testcase->{testcase_alias}); } }