diff --git a/CHANGELOG b/CHANGELOG index 7cb018109e..41f8441fc1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -50,7 +50,9 @@ Cacti CHANGELOG -issue#3663: Disabling Data Collection Causes Undefined Variable PHP Errors -issue#3668: "Input Field" is not marked red after error message -issue#3669: Input Method was renamed after add an Input Field +-issue#3673: Spikekill does not receive correct `avgnan` value when launching from GUI -issue#3681: Move arrows don't align on all themes +-issue#3682: Mouse over Zoom is no longer available in 'Time Graph View' mode -feature#3647: add_datasource.php should print the created ID -feature#3666: Update jstree.js to 3.3.10 diff --git a/graph.php b/graph.php index 3c3e9d67db..d8b6fe73e5 100644 --- a/graph.php +++ b/graph.php @@ -211,8 +211,21 @@ function initializeGraph() { "' value_max='"+data.value_max+"'>" ); - responsiveResizeGraphs(); + $('#graph_start').val(data.graph_start); + $('#graph_end').val(data.graph_end); + + var graph_id = '#graph_'+data.local_graph_id; + if (data.rra_id > 0) { + graph_id += '[rra_id=\'' + data.rra_id + '\']'; + } + $(graph_id).zoom({ + inputfieldStartTime : 'date1', + inputfieldEndTime : 'date2', + serverTimeOffset : + }); + + responsiveResizeGraphs(); }) .fail(function(data) { getPresentHTTPError(data); @@ -472,12 +485,12 @@ function initializeGraph() { $(graph_id).zoom({ inputfieldStartTime : 'date1', inputfieldEndTime : 'date2', - serverTimeOffset : + serverTimeOffset : }); if (graph_data_on) { graphXport(); - }else if (props_on) { + } else if (props_on) { graphProperties(); } @@ -486,7 +499,6 @@ function initializeGraph() { .fail(function(data) { getPresentHTTPError(data); }); - }); $('a[id$="_properties"]').unbind('click').click(function() { diff --git a/include/layout.js b/include/layout.js index 2ca3b61b72..33a9e9e7ae 100644 --- a/include/layout.js +++ b/include/layout.js @@ -3209,7 +3209,7 @@ function removeSpikesVariance(local_graph_id) { } function removeSpikesInRange(local_graph_id) { - var strURL = urlPath+'spikekill.php?method=fill&avgnan=last&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; + var strURL = urlPath+'spikekill.php?method=fill&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; closeDateFilters(); @@ -3227,7 +3227,7 @@ function removeSpikesInRange(local_graph_id) { } function removeRangeFill(local_graph_id) { - var strURL = urlPath+'spikekill.php?method=float&avgnan=last&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; + var strURL = urlPath+'spikekill.php?method=float&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; closeDateFilters(); @@ -3285,7 +3285,7 @@ function dryRunVariance(local_graph_id) { } function dryRunSpikesInRange(local_graph_id) { - var strURL = urlPath+'spikekill.php?method=fill&avgnan=last&dryrun=true&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; + var strURL = urlPath+'spikekill.php?method=fill&dryrun=true&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; closeDateFilters(); @@ -3306,7 +3306,7 @@ function dryRunSpikesInRange(local_graph_id) { } function dryRunRangeFill(local_graph_id) { - var strURL = urlPath+'spikekill.php?method=float&avgnan=last&dryrun=true&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; + var strURL = urlPath+'spikekill.php?method=float&dryrun=true&local_graph_id='+local_graph_id+'&outlier-start='+graph_start+'&outlier-end='+graph_end; closeDateFilters(); @@ -3575,6 +3575,7 @@ function initializeGraphs() { $('a[id$="_util"]').each(function() { var graph_id = $(this).attr('id').replace('graph_','').replace('_util',''); + $(this).attr('href',urlPath+ 'graph.php?action=zoom&local_graph_id='+graph_id+ '&rra_id=0&graph_start='+timestampDate1+ diff --git a/lib/spikekill.php b/lib/spikekill.php index d3d9e19059..a2eee776f7 100644 --- a/lib/spikekill.php +++ b/lib/spikekill.php @@ -137,12 +137,12 @@ public function __construct($rrdfile = '', $method = '', $avgnan = '', $stddev = $this->numspike = $numspike; } - $this->dmethod = read_config_option('spikekill_method', 1); - $this->dnumspike = read_config_option('spikekill_number', 10); - $this->dstddev = read_config_option('spikekill_deviations', 10); - $this->dpercent = read_config_option('spikekill_percent', 500); - $this->doutliers = read_config_option('spikekill_outliers', 5); - $this->davgnan = read_config_option('spikekill_avgnan', 'last'); + $this->dmethod = read_config_option('spikekill_method', true); + $this->dnumspike = read_config_option('spikekill_number', true); + $this->dstddev = read_config_option('spikekill_deviations', true); + $this->dpercent = read_config_option('spikekill_percent', true); + $this->doutliers = read_config_option('spikekill_outliers', true); + $this->davgnan = read_config_option('spikekill_avgnan', true); return true; } @@ -187,12 +187,12 @@ private function initialize_spikekill() { $this->set_error("FATAL: File '$this->rrdfile' is not writeable by '" . get_execution_user() . "'."); } - $umethod = read_user_setting('spikekill_method', $this->dmethod); - $unumspike = read_user_setting('spikekill_number', $this->dnumspike); - $ustddev = read_user_setting('spikekill_deviations', $this->dstddev); - $upercent = read_user_setting('spikekill_percent', $this->dpercent); - $uoutliers = read_user_setting('spikekill_outliers', $this->doutliers); - $uavgnan = read_user_setting('spikekill_avgnan', $this->davgnan); + $umethod = read_user_setting('spikekill_method', $this->dmethod, true); + $unumspike = read_user_setting('spikekill_number', $this->dnumspike, true); + $ustddev = read_user_setting('spikekill_deviations', $this->dstddev, true); + $upercent = read_user_setting('spikekill_percent', $this->dpercent, true); + $uoutliers = read_user_setting('spikekill_outliers', $this->doutliers, true); + $uavgnan = read_user_setting('spikekill_avgnan', $this->davgnan, true); /* set the correct value */ if ($this->avgnan == '') {