mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
(plugin) cloud::aws::cloudwatch - remove required option --dimension (#3515)
This commit is contained in:
parent
f40b77a3a3
commit
938cdcdfb0
@ -128,10 +128,6 @@ sub check_options {
|
|||||||
$append = '-';
|
$append = '-';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($self->{dimension_name} eq '') {
|
|
||||||
$self->{output}->add_option_msg(short_msg => "Need to specify --dimension option.");
|
|
||||||
$self->{output}->option_exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->{aws_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 600;
|
$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;
|
$self->{aws_period} = defined($self->{option_results}->{period}) ? $self->{option_results}->{period} : 60;
|
||||||
@ -179,8 +175,10 @@ sub manage_selection {
|
|||||||
foreach my $stat (('minimum', 'maximum', 'average', 'sum')) {
|
foreach my $stat (('minimum', 'maximum', 'average', 'sum')) {
|
||||||
next if (!defined($metric_results->{$label}->{$stat}));
|
next if (!defined($metric_results->{$label}->{$stat}));
|
||||||
|
|
||||||
$self->{metrics}->{$self->{dimension_name} . '_' . $label . '_' . $stat} = {
|
my $name = $label . '_' . $stat;
|
||||||
display => $self->{dimension_name} . '_' . $label . '_' . $stat,
|
$name = $self->{dimension_name} . '_' . $name if ($self->{dimension_name} ne '');
|
||||||
|
$self->{metrics}->{$name} = {
|
||||||
|
display => $name,
|
||||||
value => $metric_results->{$label}->{$stat},
|
value => $metric_results->{$label}->{$stat},
|
||||||
perf_label => $label . '_' . $stat,
|
perf_label => $label . '_' . $stat,
|
||||||
};
|
};
|
||||||
@ -209,7 +207,7 @@ Set cloudwatch namespace (Required).
|
|||||||
|
|
||||||
=item B<--dimension>
|
=item B<--dimension>
|
||||||
|
|
||||||
Set cloudwatch dimensions (Required).
|
Set cloudwatch dimensions.
|
||||||
|
|
||||||
=item B<--metric>
|
=item B<--metric>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user