Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebraun committed Nov 17, 2024
2 parents cb59e93 + 76f85ec commit 0d8ce4f
Show file tree
Hide file tree
Showing 46 changed files with 2,061 additions and 892 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Cacti CHANGELOG
-issue#5900: Please add the ability to select compiled RRDtool v1.9+
-feature#412: Import Export for Graph and Tree rules
-feature#1214: Move Tree Create/Remove/Modify Functions to lib/api_tree.php
-feature#1398: Implement an interactive web based Plugin upgrade process
-feature#1442: Add validation to GUI inputs
-feature#1523: Value above RRD maximum value
-feature#1987: Plugins should be able to be downloaded, installed, and upgraded from Plugin Management
Expand All @@ -37,6 +38,7 @@ Cacti CHANGELOG
-feature#2550: Enable use of authenticator codes for Two-Factor Authentication
-feature#2572: Support Sorting of Tree or Graph View by Data Source
-feature#2607: Allow adding sites from command line
-feature#2738: Set cache rebuild process indicator for the Cacti UI
-feature#2767: Plugins should be temporarily disabled if a required plugin is also disabled
-feature#2959: Add multi threading for push out hosts (cli)
-feature#3048: Allow different log settings for remote pollers
Expand Down Expand Up @@ -102,6 +104,8 @@ Cacti CHANGELOG
-feature#5463: When building Automation Rules, show the 'effective sql' on the page for users who know SQL
-feature#5578: Provide new templates for Aruba switch, Aruba wifi controller and HPE iLO to be available during install
-feature#5596: Add template Aruba OSCX switch 6x00
-feature#5601: Order Graph Item Inputs Naturally (MariaDB 10.7++, no MySQL support)
-feature#5681: Add poller information to graph-variables
-feature#5717: Add Aruba Clearpass template
-feature#5804: Remove the Classic Theme in Cacti
-feature#5833: Add button for remove all data and configuration/settings
Expand All @@ -111,14 +115,22 @@ Cacti CHANGELOG
-feature#5860: When Cacti is running on MariaDB move the Data Source statistics partitions to the ARIA table format
-feature#5861: In Cacti Utilities, be able to view the MariaDB/MySQL processeslist and active background tasks
-feature#5862: Change logging message around remote agent timeout
-feature#5866: Add 'database' to the permission structure in db_get_permissions() function
-feature#5871: Make it possible for splice_rrd.php to run from outside of Cacti
-feature#5889: Make it so that Cacti does not share sessions between browser tabs
-feature#5892: Enable Authentication Cookies by Default in New Installs
-feature#5907: Add Filter for Data Input Method on Data Templates
-feature#5908: Add Searching of Notes and External ID when Searching for a Device
-feature#5920: Remove the use of tables for alignment on graphs page and move to flex alignment
-feature#5922: Add HPE Nimble/Alletra template
-feature#5923: If RRDtool crashes due to a segmentation fault, report that and retry a few times
-feature: Allow messages to be popup notifications
-feature: Upgrade billboard.js to version 3.7.4
-feature: Upgrade billboard.js to version 3.14.1
-feature: Upgrade jQueryUI to 1.14.1
-feature: Upgrade d3.js to version 7.8.2
-feature: Upgrade ua-parser.js to version 1.0.35
-feature: Add parsedown to vendor library for plugin CHANGELOG and README viewing support
-feature: Add year display to get_daysfromtime function

1.2.29
-issue#5843: Issue with temporary tables with use of microtime
Expand Down
5 changes: 2 additions & 3 deletions cli/push_out_hosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
if (in_array('-v', $parms) || in_array('-V', $parms) || in_array('--version', $parms)) {
// exception for github tests
print 'Cacti Repopulate poller cache Tool, Version ' . CACTI_VERSION . ' ' . COPYRIGHT_YEARS . PHP_EOL;
}
else {
} else {
print 'WARNING: Deprecated script push_out_hosts.php. Please use rebuild_poller_cache.php.' . PHP_EOL;
passthru ($php_binary . ' ' . CACTI_PATH_CLI . '/rebuild_poller_cache.php ' .$parameters);
passthru ($php_binary . ' ' . CACTI_PATH_CLI . '/rebuild_poller_cache.php ' . $parameters);
}
6 changes: 2 additions & 4 deletions cli/rebuild_poller_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
require_once(CACTI_PATH_LIBRARY . '/api_data_source.php');
require_once(CACTI_PATH_LIBRARY . '/poller.php');


/* switch to main database for cli's */
if ($config['poller_id'] > 1) {
db_switch_remote_to_main();
Expand Down Expand Up @@ -335,7 +334,6 @@ function pushout_launch_child($thread_id, $threads) {
cacti_log(sprintf('NOTE: Launching Rebuild poller cache Number %s for Type %s', $thread_id, 'child'), true, 'PUSHOUT', POLLER_VERBOSITY_MEDIUM);

exec_background($php_binary, CACTI_PATH_CLI . "/rebuild_poller_cache.php --type=child --threads=$threads --child=$thread_id " . ($debug ? " --debug":"") . ($host_template_id ? " --host-template-id=$host_template_id":"") . ($data_template_id ? " --data-template-id=$data_template_id":""));

}

/**
Expand Down Expand Up @@ -400,8 +398,8 @@ function display_help() {
print ' --debug - Display verbose output during execution' . PHP_EOL . PHP_EOL;

print 'System Controlled:' . PHP_EOL;
print ' --type - The type and subtype of the rebuild poller cache process' . PHP_EOL;
print ' --child - The thread id of the child process' . PHP_EOL . PHP_EOL;
print ' --type - The type and subtype of the rebuild poller cache process' . PHP_EOL;
print ' --child - The thread id of the child process' . PHP_EOL . PHP_EOL;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cli/refresh_csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
/* display_version - displays version information */
function display_version() {
$version = get_cacti_cli_version();
print "Cacti Rebuild Poller Cache Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL;
print "Cacti CSRF File Utility, Version $version, " . COPYRIGHT_YEARS . PHP_EOL;
}

/* display_help - displays the usage of the function */
Expand Down
83 changes: 50 additions & 33 deletions data_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function form_save() {

if (cacti_sizeof($data_template_fields)) {
foreach ($data_template_fields as $data_template_field) {
raise_message('data_template_rrd_' . $data_template_field['dtr_id'], __('Field "%s" is missing an Output Field', $data_template_field['data_source_name']), MESSAGE_LEVEL_WARN);
raise_message('data_template_rrd_' . $data_template_field['dtr_id'], __('Field "%s" is missing an Output Field. Select the Output Field associated with this Data Source, and press Save again.', $data_template_field['data_source_name']), MESSAGE_LEVEL_WARN);
}
}
}
Expand Down Expand Up @@ -744,17 +744,15 @@ function template_edit() {
if (isset($template_data_rrds)) {
if (cacti_sizeof($template_data_rrds) > 1) {
/* draw the data source tabs on the top of the page */
print "<div class='tabs' style='float:left;'><nav><ul role='tablist'>\n";
print "<div class='tabs' style='float:left;'><nav><ul role='tablist'>";

foreach ($template_data_rrds as $template_data_rrd) {
print "<li class='subTab'><a " . (($template_data_rrd['id'] == get_request_var('view_rrd')) ? "class='pic selected'" : "class='pic'") . " href='" . html_escape('data_templates.php?action=template_edit&id=' . get_request_var('id') . '&view_rrd=' . $template_data_rrd['id']) . "'>" . ($i + 1) . ': ' . html_escape($template_data_rrd['data_source_name']) . '</a>' . ($template_data['data_sources'] == 0 ? "<a class='pic deleteMarker fa fa-times' title='" . __esc('Delete') . "' href='" . html_escape('data_templates.php?action=rrd_remove&id=' . $template_data_rrd['id'] . '&data_template_id=' . get_request_var('id')) . "'></a>":"<a class='deleteMarkerDisabled fa fa-times' href='#' title='" . __esc('Data Templates in use can not be modified') . "'></a>") . "</li>\n";
print "<li class='subTab'><a " . (($template_data_rrd['id'] == get_request_var('view_rrd')) ? "class='pic selected'" : "class='pic'") . " href='" . html_escape('data_templates.php?action=template_edit&id=' . get_request_var('id') . '&view_rrd=' . $template_data_rrd['id']) . "'>" . ($i + 1) . ': ' . html_escape($template_data_rrd['data_source_name']) . '</a>' . ($template_data['data_sources'] == 0 ? "<a class='pic deleteMarker fa fa-times' title='" . __esc('Delete') . "' href='" . html_escape('data_templates.php?action=rrd_remove&id=' . $template_data_rrd['id'] . '&data_template_id=' . get_request_var('id')) . "'></a>":"<a class='deleteMarkerDisabled fa fa-times' href='#' title='" . __esc('Data Templates in use can not be modified') . "'></a>") . "</li>";

$i++;
}

print "
</ul></nav>\n
</div>\n";
print "</ul></nav></div>";
} elseif (cacti_sizeof($template_data_rrds) == 1) {
set_request_var('view_rrd', $template_data_rrds[0]['id']);
}
Expand Down Expand Up @@ -992,37 +990,42 @@ function template() {
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
),
'filter' => array(
'filter' => FILTER_DEFAULT,
'pageset' => true,
'default' => ''
),
),
'sort_column' => array(
'filter' => FILTER_CALLBACK,
'default' => 'name',
'options' => array('options' => 'sanitize_search_string')
),
),
'sort_direction' => array(
'filter' => FILTER_CALLBACK,
'default' => 'ASC',
'options' => array('options' => 'sanitize_search_string')
),
),
'profile' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
),
'method' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'has_data' => array(
'filter' => FILTER_VALIDATE_REGEXP,
'options' => array('options' => array('regexp' => '(true|false)')),
'pageset' => true,
'default' => read_config_option('default_has') == 'on' ? 'true':'false'
)
)
);

validate_store_request_vars($filters, 'sess_dt');
Expand All @@ -1048,6 +1051,23 @@ function template() {
<td>
<input type='text' class='ui-state-default ui-corner-all' id='filter' name='filter' size='25' value='<?php print html_escape_request_var('filter');?>'>
</td>
<td>
<?php print __('Method');?>
</td>
<td>
<select id='method' onChange='applyFilter()' data-defaultLabel='<?php print __('Method');?>'>
<option value='-1'<?php print(get_request_var('method') == '-1' ? ' selected>':'>') . __('All');?></option>
<?php
$methods = array_rekey(db_fetch_assoc('SELECT id, name FROM data_input ORDER BY name'), 'id', 'name');

if (cacti_sizeof($methods)) {
foreach ($methods as $key => $value) {
print "<option value='" . $key . "'" . (get_request_var('method') == $key ? ' selected':'') . '>' . html_escape($value) . '</option>';
}
}
?>
</select>
</td>
<td>
<?php print __('Profile');?>
</td>
Expand All @@ -1057,16 +1077,12 @@ function template() {
<?php
$profiles = array_rekey(db_fetch_assoc('SELECT id, name FROM data_source_profiles ORDER BY name'), 'id', 'name');

if (cacti_sizeof($profiles)) {
foreach ($profiles as $key => $value) {
print "<option value='" . $key . "'";

if (get_request_var('profile') == $key) {
print ' selected';
} print '>' . html_escape($value) . "</option>\n";
}
}
?>
if (cacti_sizeof($profiles)) {
foreach ($profiles as $key => $value) {
print "<option value='" . $key . "'" . (get_request_var('profile') == $key ? ' selected':'') . '>' . html_escape($value) . '</option>';
}
}
?>
</select>
</td>
<td>
Expand All @@ -1076,16 +1092,12 @@ function template() {
<select id='rows' name='rows' onChange='applyFilter()' data-defaultLabel='<?php print __('Data Templates');?>'>
<option value='-1'<?php print(get_request_var('rows') == '-1' ? ' selected>':'>') . __('Default');?></option>
<?php
if (cacti_sizeof($item_rows)) {
foreach ($item_rows as $key => $value) {
print "<option value='" . $key . "'";

if (get_request_var('rows') == $key) {
print ' selected';
} print '>' . html_escape($value) . "</option>\n";
}
}
?>
if (cacti_sizeof($item_rows)) {
foreach ($item_rows as $key => $value) {
print "<option value='" . $key . "'" . (get_request_var('rows') == $key ? ' selected':'') . '>' . html_escape($value) . '</option>';
}
}
?>
</select>
</td>
<td>
Expand All @@ -1110,6 +1122,7 @@ function applyFilter() {
strURL += '?filter='+$('#filter').val();
strURL += '&rows='+$('#rows').val();
strURL += '&profile='+$('#profile').val();
strURL += '&method='+$('#method').val();
strURL += '&has_data='+$('#has_data').is(':checked');
loadUrl({url:strURL})
}
Expand Down Expand Up @@ -1156,6 +1169,10 @@ function clearFilter() {
$sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . ' dtd.data_source_profile_id=' . get_request_var('profile');
}

if (get_request_var('method') != '-1') {
$sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . ' dtd.data_input_id=' . get_request_var('method');
}

if (get_request_var('has_data') == 'true') {
$sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . ' dt.data_sources > 0';
}
Expand Down
Loading

0 comments on commit 0d8ce4f

Please sign in to comment.