0) { $data_source_path = get_data_source_path($local_data_id['local_data_id'], true); } else { $data_source_path = ''; } if ($data_source_path != '') { $html = true; $dryrun = false; $out_start = ''; $out_end = ''; $avgnan = ''; $method = ''; $rrdfile = $data_source_path; if (isrv('dryrun')) { $dryrun = true; } if (isrv('method')) { $method = gnrv('method'); } if (isrv('avgnan')) { $avgnan = gnrv('avgnan'); } if (isrv('outlier-start')) { $out_start = gnrv('outlier-start'); } if (isrv('outlier-end')) { $out_end = gnrv('outlier-end'); } $spiker = new spikekill($rrdfile, $method, $avgnan, '', $out_start, $out_end); $spiker->dryrun = $dryrun; $spiker->html = $html; $result = $spiker->remove_spikes(); if ($debug) { if (!$result) { cacti_log("ERROR: SpikeKill failed for $rrdfile. Message is " . $spiker->get_errors(), false, 'SPIKEKILL'); } else { cacti_log("NOTICE: SpikeKill succeeded for $rrdfile. Message is " . $spiker->get_output(), false, 'SPIKEKILL'); } } else { if (!$result) { $results = $spiker->get_errors(); } else { $results = $spiker->get_output(); } } } } } print json_encode(['local_graph_id' => $local_graph_id, 'results' => $results]); } else { print __('FATAL: Spike Kill Not Allowed') . PHP_EOL; }