diff --git a/centreon-plugins/cloud/aws/elb/application/mode/connections.pm b/centreon-plugins/cloud/aws/elb/application/mode/connections.pm index e47d4ac8c..5b06a1705 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/connections.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/connections.pm @@ -115,6 +115,7 @@ sub new { "availability-zone:s" => { name => 'availability_zone' }, "filter-metric:s" => { name => 'filter_metric' }, "statistic:s@" => { name => 'statistic' }, + "target-group:s" => { name => 'target_group' } }); return $self; @@ -138,6 +139,10 @@ sub check_options { $self->{aws_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 600; $self->{aws_period} = defined($self->{option_results}->{period}) ? $self->{option_results}->{period} : 60; + if (defined($self->{option_results}->{target_group}) && self->{option_results}->{target_group} ne '') { + push @{$self->{aws_dimensions}}, { Name => 'TargetGroup', Value => $self->{option_results}->{target_group} }; + } + $self->{aws_statistics} = ['Sum']; if (defined($self->{option_results}->{statistic})) { $self->{aws_statistics} = []; diff --git a/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm b/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm index 6ff8c5a45..6e0938fa8 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm @@ -129,6 +129,7 @@ sub new { "name:s@" => { name => 'name' }, "availability-zone:s" => { name => 'availability_zone' }, "filter-metric:s" => { name => 'filter_metric' }, + "target-group:s" => { name => 'target_group' } }); return $self; @@ -152,6 +153,10 @@ sub check_options { $self->{aws_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 600; $self->{aws_period} = defined($self->{option_results}->{period}) ? $self->{option_results}->{period} : 60; + if (defined($self->{option_results}->{target_group}) && self->{option_results}->{target_group} ne '') { + push @{$self->{aws_dimensions}}, { Name => 'TargetGroup', Value => $self->{option_results}->{target_group} }; + } + $self->{aws_statistics} = ['Sum']; if (defined($self->{option_results}->{statistic})) { $self->{aws_statistics} = []; diff --git a/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm b/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm index e15525ae7..8ef5142f5 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm @@ -105,6 +105,7 @@ sub new { "availability-zone:s" => { name => 'availability_zone' }, "filter-metric:s" => { name => 'filter_metric' }, "statistic:s@" => { name => 'statistic' }, + "target-group:s" => { name => 'target_group' } }); return $self; @@ -128,6 +129,10 @@ sub check_options { $self->{aws_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 600; $self->{aws_period} = defined($self->{option_results}->{period}) ? $self->{option_results}->{period} : 60; + if (defined($self->{option_results}->{target_group}) && self->{option_results}->{target_group} ne '') { + push @{$self->{aws_dimensions}}, { Name => 'TargetGroup', Value => $self->{option_results}->{target_group} }; + } + $self->{aws_statistics} = ['Average']; if (defined($self->{option_results}->{statistic})) { $self->{aws_statistics} = [];