mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 08:34:46 +02:00
fix(netdata): mode get-chart - wrong values (#3394)
This commit is contained in:
parent
c754ec8ae3
commit
77e2f794ed
@ -123,22 +123,23 @@ sub manage_selection {
|
|||||||
my $chart_name = $self->{option_results}->{chart_name};
|
my $chart_name = $self->{option_results}->{chart_name};
|
||||||
my $stat = $self->{option_results}->{chart_statistics};
|
my $stat = $self->{option_results}->{chart_statistics};
|
||||||
|
|
||||||
|
$self->{metrics}->{$chart_name} = {};
|
||||||
|
# we remove the first time value
|
||||||
|
shift @{$result->{labels}};
|
||||||
foreach my $chart_value (@{$result->{data}}) {
|
foreach my $chart_value (@{$result->{data}}) {
|
||||||
|
shift(@$chart_value);
|
||||||
foreach my $chart_label (@{$result->{labels}}) {
|
foreach my $chart_label (@{$result->{labels}}) {
|
||||||
$self->{metrics}->{$chart_name}->{$chart_label} = shift @{$chart_value};
|
$self->{metrics}->{$chart_name}->{$chart_label} = shift(@$chart_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $metric (keys %{$self->{metrics}->{$chart_name}}) {
|
foreach my $metric (keys %{$self->{metrics}->{$chart_name}}) {
|
||||||
next if ($metric eq 'time');
|
$self->{metric}->{$metric . '_' . $stat} = {
|
||||||
foreach my $value (values %{$self->{metrics}->{$chart_name}}) {
|
display => $metric . '_' . $stat,
|
||||||
$self->{metric}->{$metric . '_' . $stat} = {
|
value => $self->{metrics}->{$chart_name}->{$metric},
|
||||||
display => $metric . '_' . $stat,
|
unit => $unit,
|
||||||
value => $value,
|
perf_label => $metric . '_' . $stat
|
||||||
unit => $unit,
|
};
|
||||||
perf_label => $metric . '_' . $stat
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user