mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
fix(aws/health): events mode - limit issue with paws (#2732)
This commit is contained in:
parent
0df621c812
commit
cf2b2c162e
@ -619,11 +619,9 @@ sub health_describe_affected_entities {
|
|||||||
eval {
|
eval {
|
||||||
my $lwp_caller = new Paws::Net::LWPCaller();
|
my $lwp_caller = new Paws::Net::LWPCaller();
|
||||||
my $health = Paws->service('Health', caller => $lwp_caller, region => $self->{option_results}->{region});
|
my $health = Paws->service('Health', caller => $lwp_caller, region => $self->{option_results}->{region});
|
||||||
my $health_options = { Filter => {} };
|
|
||||||
if (defined($options{filter_event_arns})) {
|
|
||||||
$health_options->{Filter}->{EventArns} = $options{filter_event_arns};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
while (my @events = splice(@{$options{filter_event_arns}}, 0, 10)) {
|
||||||
|
my $health_options = { Filter => { EventArns => \@events } };
|
||||||
while ((my $entities = $health->DescribeAffectedEntities(%$health_options))) {
|
while ((my $entities = $health->DescribeAffectedEntities(%$health_options))) {
|
||||||
foreach (@{$entities->{Entities}}) {
|
foreach (@{$entities->{Entities}}) {
|
||||||
push @$entities_results, {
|
push @$entities_results, {
|
||||||
@ -639,6 +637,7 @@ sub health_describe_affected_entities {
|
|||||||
last if (!defined($entities->{NextToken}));
|
last if (!defined($entities->{NextToken}));
|
||||||
$health_options->{NextToken} = $entities->{NextToken};
|
$health_options->{NextToken} = $entities->{NextToken};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
$self->{output}->add_option_msg(short_msg => "error: $@");
|
$self->{output}->add_option_msg(short_msg => "error: $@");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user