mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 23:54:18 +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 $metric_calc = { points => 0 };
|
||||||
|
my $value;
|
||||||
foreach my $point (@{$timeserie->{points}}) {
|
foreach my $point (@{$timeserie->{points}}) {
|
||||||
if (defined($point->{value})) {
|
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})) {
|
if (defined($aggregations{average})) {
|
||||||
$metric_calc->{average} = 0 if (!defined($metric_calc->{average}));
|
$metric_calc->{average} = 0 if (!defined($metric_calc->{average}));
|
||||||
$metric_calc->{average} += $value;
|
$metric_calc->{average} += $value;
|
||||||
|
@ -97,6 +97,7 @@ Fortinet
|
|||||||
FQDN
|
FQDN
|
||||||
FreeBSD
|
FreeBSD
|
||||||
frsevent
|
frsevent
|
||||||
|
GCP
|
||||||
--get-param
|
--get-param
|
||||||
HAProxy
|
HAProxy
|
||||||
HashiCorp
|
HashiCorp
|
||||||
@ -266,6 +267,7 @@ SRX
|
|||||||
SSDCapacity
|
SSDCapacity
|
||||||
SSG
|
SSG
|
||||||
SSH
|
SSH
|
||||||
|
Stackdriver
|
||||||
standAlone
|
standAlone
|
||||||
statefile
|
statefile
|
||||||
--statefile-concat-cwd
|
--statefile-concat-cwd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user