diff --git a/centreon-plugins/network/aruba/orchestrator/restapi/mode/alarms.pm b/centreon-plugins/network/aruba/orchestrator/restapi/mode/alarms.pm index d2f2395ec..11bf9b529 100644 --- a/centreon-plugins/network/aruba/orchestrator/restapi/mode/alarms.pm +++ b/centreon-plugins/network/aruba/orchestrator/restapi/mode/alarms.pm @@ -120,11 +120,16 @@ sub manage_selection { foreach my $appliance (@$appliances) { next if (defined($self->{option_results}->{filter_hostname}) && $self->{option_results}->{filter_hostname} ne '' && - $appliance->{hostname} !~ /$self->{option_results}->{filter_hostname}/); + $appliance->{hostName} !~ /$self->{option_results}->{filter_hostname}/); push @{$post->{ids}}, $appliance->{id}; } + if (scalar(@{$post->{ids}}) <= 0) { + $self->{output}->add_option_msg(short_msg => 'no appliances selected'); + $self->{output}->option_exit(); + } + my $results = $options{custom}->request_api( method => 'POST', endpoint => '/alarm/appliance', diff --git a/centreon-plugins/network/aruba/orchestrator/restapi/mode/appliances.pm b/centreon-plugins/network/aruba/orchestrator/restapi/mode/appliances.pm index 3474b9bc3..ffc0a669c 100644 --- a/centreon-plugins/network/aruba/orchestrator/restapi/mode/appliances.pm +++ b/centreon-plugins/network/aruba/orchestrator/restapi/mode/appliances.pm @@ -128,7 +128,7 @@ sub manage_selection { $self->{appliances} = {}; foreach my $appliance (@$appliances) { next if (defined($self->{option_results}->{filter_hostname}) && $self->{option_results}->{filter_hostname} ne '' && - $appliance->{hostname} !~ /$self->{option_results}->{filter_hostname}/); + $appliance->{hostName} !~ /$self->{option_results}->{filter_hostname}/); my $group = $self->get_group(groups => $groups, groupId => $appliance->{groupId}); next if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&