mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
Plugin(cloud::google::gcp::management::stackdriver) - Mode(getmetrics): allow compatibility with DISTRIBUTION type values CTOR-1643 (#5609)
This commit is contained in:
parent
da00258077
commit
4abce275b9
@ -333,9 +333,14 @@ sub gcp_get_metrics {
|
||||
}
|
||||
|
||||
my $metric_calc = { points => 0 };
|
||||
my $value;
|
||||
foreach my $point (@{$timeserie->{points}}) {
|
||||
if (defined($point->{value})) {
|
||||
my $value = $point->{value}->{ lc($timeserie->{valueType}) . 'Value' };
|
||||
if (lc($timeserie->{valueType}) eq 'distribution') {
|
||||
$value = $point->{value}->{ lc($timeserie->{valueType}) . 'Value' }->{count};
|
||||
} else {
|
||||
$value = $point->{value}->{ lc($timeserie->{valueType}) . 'Value' };
|
||||
}
|
||||
if (defined($aggregations{average})) {
|
||||
$metric_calc->{average} = 0 if (!defined($metric_calc->{average}));
|
||||
$metric_calc->{average} += $value;
|
||||
|
@ -97,6 +97,7 @@ Fortinet
|
||||
FQDN
|
||||
FreeBSD
|
||||
frsevent
|
||||
GCP
|
||||
--get-param
|
||||
HAProxy
|
||||
HashiCorp
|
||||
@ -266,6 +267,7 @@ SRX
|
||||
SSDCapacity
|
||||
SSG
|
||||
SSH
|
||||
Stackdriver
|
||||
standAlone
|
||||
statefile
|
||||
--statefile-concat-cwd
|
||||
|
Loading…
x
Reference in New Issue
Block a user