mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Added configurable purge tnetwork_matrix
Former-commit-id: e5869879c2445c15c8332d245ac2dd0d3f8de5d5
This commit is contained in:
parent
287ce78260
commit
f0a3f4e9d7
@ -536,6 +536,19 @@ $table->data[] = [
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$table->data[] = [
|
||||||
|
__('Max. days before delete old network matrix data'),
|
||||||
|
html_print_input_text(
|
||||||
|
'delete_old_network_matrix',
|
||||||
|
$config['delete_old_network_matrix'],
|
||||||
|
'',
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
true
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
$table_other = new stdClass();
|
$table_other = new stdClass();
|
||||||
$table_other->width = '100%';
|
$table_other->width = '100%';
|
||||||
$table_other->class = 'databox filters';
|
$table_other->class = 'databox filters';
|
||||||
|
@ -752,6 +752,10 @@ function config_update_config()
|
|||||||
$error_update[] = __('Max. days before delete old messages');
|
$error_update[] = __('Max. days before delete old messages');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'))) {
|
||||||
|
$error_update[] = __('Max. days before delete old network matrix data');
|
||||||
|
}
|
||||||
|
|
||||||
if (!config_update_value('max_graph_container', get_parameter('max_graph_container'))) {
|
if (!config_update_value('max_graph_container', get_parameter('max_graph_container'))) {
|
||||||
$error_update[] = __('Graph container - Max. Items');
|
$error_update[] = __('Graph container - Max. Items');
|
||||||
}
|
}
|
||||||
@ -1547,6 +1551,10 @@ function config_process_config()
|
|||||||
config_update_value('delete_old_messages', 21);
|
config_update_value('delete_old_messages', 21);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['delete_old_network_matrix'])) {
|
||||||
|
config_update_value('delete_old_network_matrix', 10);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['max_graph_container'])) {
|
if (!isset($config['max_graph_container'])) {
|
||||||
config_update_value('max_graph_container', 10);
|
config_update_value('max_graph_container', 10);
|
||||||
}
|
}
|
||||||
|
@ -433,10 +433,12 @@ sub pandora_purgedb ($$) {
|
|||||||
# Delete old tgraph_source data
|
# Delete old tgraph_source data
|
||||||
db_do ($dbh,"DELETE FROM tgraph_source WHERE id_graph NOT IN (SELECT id_graph FROM tgraph)");
|
db_do ($dbh,"DELETE FROM tgraph_source WHERE id_graph NOT IN (SELECT id_graph FROM tgraph)");
|
||||||
|
|
||||||
# Delete network traffic old data
|
# Delete network traffic old data.
|
||||||
log_message ('PURGE', 'Deleting old network matrix data.');
|
log_message ('PURGE', 'Deleting old network matrix data.');
|
||||||
my $matrix_limit = time() - 86400 * 7; #FIXME It should be configurable.
|
if ($conf->{'_delete_old_network_matrix'} > 0) {
|
||||||
db_do ($dbh, "DELETE FROM tnetwork_matrix WHERE utimestamp < ?", $matrix_limit);
|
my $matrix_limit = time() - 86400 * $conf->{'_delete_old_network_matrix'};
|
||||||
|
db_do ($dbh, "DELETE FROM tnetwork_matrix WHERE utimestamp < ?", $matrix_limit);
|
||||||
|
}
|
||||||
|
|
||||||
# Delete old messages
|
# Delete old messages
|
||||||
log_message ('PURGE', "Deleting old messages.");
|
log_message ('PURGE', "Deleting old messages.");
|
||||||
@ -664,6 +666,7 @@ sub pandora_load_config_pdb ($) {
|
|||||||
$conf->{'_days_delete_unknown'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'days_delete_unknown'");
|
$conf->{'_days_delete_unknown'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'days_delete_unknown'");
|
||||||
$conf->{'_inventory_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'inventory_purge'");
|
$conf->{'_inventory_purge'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'inventory_purge'");
|
||||||
$conf->{'_delete_old_messages'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_old_messages'");
|
$conf->{'_delete_old_messages'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_old_messages'");
|
||||||
|
$conf->{'_delete_old_network_matrix'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = '_delete_old_network_matrix'");
|
||||||
$conf->{'_enterprise_installed'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'enterprise_installed'");
|
$conf->{'_enterprise_installed'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'enterprise_installed'");
|
||||||
$conf->{'_metaconsole'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole'");
|
$conf->{'_metaconsole'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole'");
|
||||||
$conf->{'_metaconsole_events_history'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole_events_history'");
|
$conf->{'_metaconsole_events_history'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole_events_history'");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user