diff --git a/centreon-plugins/cloud/aws/elb/application/mode/connections.pm b/centreon-plugins/cloud/aws/elb/application/mode/connections.pm index 5fbe57d8b..36b052ddd 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/connections.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/connections.pm @@ -223,6 +223,10 @@ Set the instance name (Required) (Can be multiple). Add Availability Zone dimension. +=item B<--target-group> + +Add target group dimension. + =item B<--filter-metric> Filter metrics (Can be: ActiveConnectionCount', 'NewConnectionCount', diff --git a/centreon-plugins/cloud/aws/elb/application/mode/discovery.pm b/centreon-plugins/cloud/aws/elb/application/mode/discovery.pm index 7688079b7..d9ac537ff 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/discovery.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/discovery.pm @@ -60,6 +60,7 @@ sub run { next if (!defined($load_balancer->{LoadBalancerArn}) || $load_balancer->{Type} ne 'application'); my %elb; $elb{type} = "application"; + $elb{arn} = $load_balancer->{LoadBalancerArn}; $elb{name} = $1 if ($load_balancer->{LoadBalancerArn} =~ /arn:aws:elasticloadbalancing:.*:loadbalancer\/(.*)/); $elb{dns_name} = $load_balancer->{DNSName}; $elb{availability_zones} = $load_balancer->{AvailabilityZones}; diff --git a/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm b/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm index 42bd3d958..3e6436a96 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/httpcodes.pm @@ -237,6 +237,10 @@ Set the instance name (Required) (Can be multiple). Add Availability Zone dimension. +=item B<--target-group> + +Add target group dimension. + =item B<--filter-metric> Filter metrics (Can be: 'HTTPCode_Target_2XX_Count', 'HTTPCode_Target_3XX_Count', diff --git a/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm b/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm index db44fd99a..2b8032fe6 100644 --- a/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm +++ b/centreon-plugins/cloud/aws/elb/application/mode/targetshealth.pm @@ -160,6 +160,10 @@ sub manage_selection { if (defined($self->{option_results}->{availability_zone}) && $self->{option_results}->{availability_zone} ne '') { push @{$self->{aws_dimensions}}, { Name => 'AvailabilityZone', Value => $self->{option_results}->{availability_zone} }; } + 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} }; + } + $metric_results{$instance} = $options{custom}->cloudwatch_get_metrics( namespace => 'AWS/ApplicationELB', dimensions => $self->{aws_dimensions}, @@ -213,6 +217,10 @@ Set the instance name (Required) (Can be multiple). Add Availability Zone dimension. +=item B<--target-group> + +Add target group dimension. + =item B<--filter-metric> Filter metrics (Can be: 'HealthyHostCount', 'UnHealthyHostCount') diff --git a/centreon-plugins/cloud/aws/elb/network/mode/discovery.pm b/centreon-plugins/cloud/aws/elb/network/mode/discovery.pm index 633dbadac..33fdd28a6 100644 --- a/centreon-plugins/cloud/aws/elb/network/mode/discovery.pm +++ b/centreon-plugins/cloud/aws/elb/network/mode/discovery.pm @@ -60,6 +60,7 @@ sub run { next if (!defined($load_balancer->{LoadBalancerArn}) || $load_balancer->{Type} ne 'network'); my %elb; $elb{type} = "network"; + $elb{arn} = $load_balancer->{LoadBalancerArn}; $elb{name} = $1 if ($load_balancer->{LoadBalancerArn} =~ /arn:aws:elasticloadbalancing:.*:loadbalancer\/(.*)/); $elb{dns_name} = $load_balancer->{DNSName}; $elb{availability_zones} = $load_balancer->{AvailabilityZones};