mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-23 13:45:18 +02:00
Bug fix: get interval value
git-svn-id: http://svn.merethis.net/centreon-esxd/trunk@53 a5eaa968-4c79-4d68-970d-af6011b5b055
This commit is contained in:
parent
4086f2d396
commit
03856c27e6
@ -117,21 +117,29 @@ sub generic_performance_values_historic {
|
|||||||
my @perf_metric_ids = get_perf_metric_ids($perfs);
|
my @perf_metric_ids = get_perf_metric_ids($perfs);
|
||||||
|
|
||||||
my $perf_query_spec;
|
my $perf_query_spec;
|
||||||
|
my $tstamp = time();
|
||||||
|
my (@t) = gmtime($tstamp - $interval);
|
||||||
|
my $startTime = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
|
||||||
|
(1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0]);
|
||||||
|
(@t) = gmtime($tstamp);
|
||||||
|
my $endTime = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
|
||||||
|
(1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1],$t[0]);
|
||||||
|
|
||||||
if ($interval == 20) {
|
if ($interval == 20) {
|
||||||
$perf_query_spec = PerfQuerySpec->new(entity => $view,
|
$perf_query_spec = PerfQuerySpec->new(entity => $view,
|
||||||
metricId => @perf_metric_ids,
|
metricId => @perf_metric_ids,
|
||||||
format => 'normal',
|
format => 'normal',
|
||||||
intervalId => 20,
|
intervalId => 20,
|
||||||
|
startTime => $startTime,
|
||||||
|
endTime => $endTime,
|
||||||
maxSample => 1);
|
maxSample => 1);
|
||||||
} else {
|
} else {
|
||||||
my (@t) = gmtime(time() - $interval);
|
|
||||||
my $start = sprintf("%04d-%02d-%02dT%02d:%02d:00Z",
|
|
||||||
(1900+$t[5]),(1+$t[4]),$t[3],$t[2],$t[1]);
|
|
||||||
$perf_query_spec = PerfQuerySpec->new(entity => $view,
|
$perf_query_spec = PerfQuerySpec->new(entity => $view,
|
||||||
metricId => @perf_metric_ids,
|
metricId => @perf_metric_ids,
|
||||||
format => 'normal',
|
format => 'normal',
|
||||||
intervalId => $interval,
|
intervalId => $interval,
|
||||||
startTime => $start
|
startTime => $startTime,
|
||||||
|
endTime => $endTime
|
||||||
);
|
);
|
||||||
#maxSample => 1);
|
#maxSample => 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user