Skip to content
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
6 changes: 5 additions & 1 deletion .github/workflows/plugin-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ jobs:

- name: Setup Permissions
run: |
sudo chown -R www-data:runner ${{ github.workspace }}/cacti
# Composer runs as the runner user in a later step and calls touch()
# while generating the fixture autoloader. utime() only succeeds for the
# file owner, so the runner user must own the tree here; www-data keeps
# group access. Ownership is handed back to www-data before polling.
sudo chown -R runner:www-data ${{ github.workspace }}/cacti
sudo find ${{ github.workspace }}/cacti -type d -exec chmod 775 {} \;
sudo find ${{ github.workspace }}/cacti -type f -exec chmod 664 {} \;
sudo chmod +x ${{ github.workspace }}/cacti/cmd.php
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

--- develop ---

* issue: Remove the Listener and Stream from the report page. They are part of what a Filter materializes, so changing them there ran the report against data that was never materialized. They are now set only in the Filter editor, and the report page reads them straight from the saved Filter. The New button now follows Edit.

* issue: Start a materialization automatically when a Filter is saved with a change that affects its cached results, from either the Filter editor or the FlowView tab, and say so, instead of asking the user to start one by hand from the Filters page.

* issue: Queue a fresh materialization when a Filter is saved while one is already running for it. The active run is working from the settings as they were, so leaving the save to it left the new settings uncached; the save now says the rebuild is queued rather than started, and the poller launches it once no materialization is running. Each queued Filter is kept in its own settings row with a token the poller compare-and-deletes, so concurrent saves never overwrite one another and a Filter re-queued while the poller is draining is not dropped.

* issue: Point the NetFlow graph drilldown at a saved Filter scoped to the graph's exporter. The report page now reads the Listener and Stream from the Filter, so the icon's old ex_addr and listener overrides were ignored and it showed every exporter under the default Filter; it now links to a saved Filter matching both the graph's Listener and Stream, picks the most specific one deterministically when a Listener has more than one, and is omitted when none matches rather than pointing at a Filter for the wrong Stream.

* issue: Stop a scheduled report whose saved Filter has been deleted from filling the PHP log with warnings on every run. The schedule poller read the timespan and name of a query that was no longer there, and ran the empty result through the report, so each run logged a burst of "Undefined array key" and "array offset on bool" warnings. The runner now logs one warning naming the schedule and the missing query and stops, and run_flow_query() returns nothing for a Filter that is gone before reading any of its columns

* issue: Materialize the newest partition that has rotated. A partition is only cached as a full scan when the materialization range covers all of its flows, but the range ended only a second past the last partition's nominal window, while a flow is written to the partition of the time it was captured and can end after that window (a flow still open as the partition rotates, or an exporter whose clock is ahead). The newest rotated partition, the one most likely to hold such a flow and still on the InnoDB engine, was therefore never a full scan and never cached, so its Filter stayed Required even right after a materialization. The range now pads the end by a day, as it already did the start
Expand Down
24 changes: 3 additions & 21 deletions flowview.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ function save_filter_as(): void {
}
}

/* the Listener and Stream stay as the source Filter has them, they are not on the page */
$overrides = [
'device_id',
'ex_addr',
'excluded',
'sortfield',
'cutofflines',
Expand Down Expand Up @@ -412,17 +411,8 @@ function load_session_for_filter() {

break;
case 'device_id':
if (!isset_request_var('device_id') || get_nfilter_request_var('device_id') == '-1') {
set_request_var('device_id', $value);
}

break;
case 'ex_addr':
/* the page lists no Stream as 'All' */
if (!isset_request_var('ex_addr') || get_nfilter_request_var('ex_addr') == '') {
set_request_var('ex_addr', ($value === '' || $value == '-1') ? '0' : $value);
}

/* the Listener and Stream are read straight from the saved Filter, not the page */
break;
case 'panel_table':
case 'panel_bytes':
Expand Down Expand Up @@ -519,11 +509,8 @@ function flowview_request_vars(): void {
}

/* ================= input validation and session storage ================= */
/* the Listener and Stream are part of the Filter, so the report page neither shows nor sends them */
$filters = array(
'device_id' => [
'filter' => FILTER_VALIDATE_INT,
'default' => '0'
],
'sortfield' => array(
'filter' => FILTER_CALLBACK,
'options' => ['options' => 'sanitize_search_string'],
Expand Down Expand Up @@ -560,11 +547,6 @@ function flowview_request_vars(): void {
'options' => ['options' => 'sanitize_search_string'],
'default' => ''
),
'ex_addr' => array(
'filter' => FILTER_CALLBACK,
'options' => ['options' => 'sanitize_search_string'],
'default' => '0'
),
'domains' => array(
'filter' => FILTER_VALIDATE_REGEXP,
'options' => array('options' => array('regexp' => '(true|false)')),
Expand Down
3 changes: 3 additions & 0 deletions flowview_process.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@
/* partitions that went cold this cycle are materialized for every filter */
flowview_materialize_rotated_partitions();

/* Filters saved while a materialization had them are rebuilt now the queue is quiet */
flowview_launch_queued_rematerializations();

if ($maint) {
flowview_debug('Performing Table Maintenance');

Expand Down
Loading
Loading