Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Issues #3673, #3682 #3685

Merged
merged 3 commits into from
Jul 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 16 additions & 4 deletions graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : <?php print date('Z');?>
});

responsiveResizeGraphs();
})
.fail(function(data) {
getPresentHTTPError(data);
Expand Down Expand Up @@ -472,12 +485,12 @@ function initializeGraph() {
$(graph_id).zoom({
inputfieldStartTime : 'date1',
inputfieldEndTime : 'date2',
serverTimeOffset : <?php print date('Z') . "\n";?>
serverTimeOffset : <?php print date('Z');?>
});

if (graph_data_on) {
graphXport();
}else if (props_on) {
} else if (props_on) {
graphProperties();
}

Expand All @@ -486,7 +499,6 @@ function initializeGraph() {
.fail(function(data) {
getPresentHTTPError(data);
});

});

$('a[id$="_properties"]').unbind('click').click(function() {
Expand Down
9 changes: 5 additions & 4 deletions include/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand Down Expand Up @@ -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();

Expand All @@ -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();

Expand Down Expand Up @@ -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+
Expand Down
24 changes: 12 additions & 12 deletions lib/spikekill.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 == '') {
Expand Down