Merge branch 'ent-10265-eliminar-gestion-de-mapas-via-ntop-antigua-funcionalidad-deprecada' into 'develop'
Ent-10265-eliminar-gestion-de-mapas-via-ntop-antigua-funcionalidad-deprecada See merge request artica/pandorafms!6028
This commit is contained in:
commit
84f61c9022
|
@ -545,23 +545,8 @@ $table->data[6][0] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$table->data[6][1] = html_print_label_input_block(
|
||||
__('Max. days before delete old network matrix data'),
|
||||
html_print_input(
|
||||
[
|
||||
'type' => 'number',
|
||||
'size' => 5,
|
||||
'max' => $performance_variables_control['delete_old_network_matrix']->max,
|
||||
'name' => 'delete_old_network_matrix',
|
||||
'value' => $config['delete_old_network_matrix'],
|
||||
'return' => true,
|
||||
'min' => $performance_variables_control['delete_old_network_matrix']->min,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$table->data[7][0] = html_print_label_input_block(
|
||||
$table->data[6][1] = html_print_label_input_block(
|
||||
__('Max. days before delete inventory data'),
|
||||
html_print_input_text(
|
||||
'inventory_purge',
|
||||
|
|
|
@ -595,7 +595,6 @@ class ConsoleSupervisor
|
|||
'days_delete_unknown' => 'Max. days before unknown modules are deleted',
|
||||
'days_delete_not_initialized' => 'Max. days before delete not initialized modules',
|
||||
'days_autodisable_deletion' => 'Max. days before autodisabled agents are deleted',
|
||||
'delete_old_network_matrix' => 'Max. days before delete old network matrix data',
|
||||
'report_limit' => 'Item limit for real-time reports',
|
||||
'event_view_hr' => 'Default hours for event view',
|
||||
'big_operation_step_datos_purge' => 'Big Operation Step to purge old data',
|
||||
|
|
|
@ -978,10 +978,6 @@ function config_update_config()
|
|||
$error_update[] = __('Max. days before delete old messages');
|
||||
}
|
||||
|
||||
if (config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'), true) === false) {
|
||||
$error_update[] = __('Max. days before delete old network matrix data');
|
||||
}
|
||||
|
||||
if (config_update_value('max_graph_container', get_parameter('max_graph_container'), true) === false) {
|
||||
$error_update[] = __('Graph container - Max. Items');
|
||||
}
|
||||
|
@ -2239,10 +2235,6 @@ function config_process_config()
|
|||
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'])) {
|
||||
config_update_value('max_graph_container', 10);
|
||||
}
|
||||
|
@ -2510,10 +2502,6 @@ function config_process_config()
|
|||
'max' => 90,
|
||||
'min' => 0,
|
||||
],
|
||||
'delete_old_network_matrix' => [
|
||||
'max' => 30,
|
||||
'min' => 1,
|
||||
],
|
||||
'report_limit' => [
|
||||
'max' => 500,
|
||||
'min' => 1,
|
||||
|
|
|
@ -3764,20 +3764,6 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
|
|||
PRIMARY KEY(`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_matrix`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`source` VARCHAR(60) DEFAULT '',
|
||||
`destination` VARCHAR(60) DEFAULT '',
|
||||
`utimestamp` BIGINT DEFAULT 0,
|
||||
`bytes` INT UNSIGNED DEFAULT 0,
|
||||
`pkts` INT UNSIGNED DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`source`, `destination`, `utimestamp`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4 ;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `user_task`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -313,8 +313,6 @@ sub data_consumer ($$) {
|
|||
enterprise_hook('process_xml_connections', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]);
|
||||
} elsif (defined($xml_data->{'ipam_source'})) {
|
||||
enterprise_hook('process_xml_ipam', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]);
|
||||
} elsif (defined($xml_data->{'network_matrix'})){
|
||||
process_xml_matrix_network( $self->getConfig(), $xml_data, $self->getDBH());
|
||||
} else {
|
||||
process_xml_data ($self->getConfig (), $file_name, $xml_data, $self->getServerID (), $self->getDBH ());
|
||||
}
|
||||
|
@ -1130,45 +1128,6 @@ sub process_events_dataserver {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Process events in the XML.
|
||||
##########################################################################
|
||||
sub process_xml_matrix_network {
|
||||
my ($pa_config, $data, $dbh) = @_;
|
||||
|
||||
my $utimestamp = $data->{'network_matrix'}->[0]->{'utimestamp'};
|
||||
my $content = $data->{'network_matrix'}->[0]->{'content'};
|
||||
return unless defined($utimestamp) && defined($content);
|
||||
|
||||
# Try to decode the base64 inside
|
||||
my $matrix_info;
|
||||
eval {
|
||||
$matrix_info = decode_json(decode_base64($content));
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
logger($pa_config, "Error processing base64 matrix data '$content'.", 5);
|
||||
return;
|
||||
}
|
||||
foreach my $source (keys %$matrix_info) {
|
||||
foreach my $destination (keys %{$matrix_info->{$source}}) {
|
||||
my $matrix_single_data = $matrix_info->{$source}->{$destination};
|
||||
$matrix_single_data->{'source'} = $source;
|
||||
$matrix_single_data->{'destination'} = $destination;
|
||||
$matrix_single_data->{'utimestamp'} = $utimestamp;
|
||||
eval {
|
||||
db_process_insert($dbh, 'id', 'tnetwork_matrix', $matrix_single_data);
|
||||
};
|
||||
if ($@) {
|
||||
logger($pa_config, "Error inserted matrix data. Source: $source, destination: $destination, utimestamp: $utimestamp.", 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Get a lock on the given agent. Return 1 on success, 0 otherwise.
|
||||
##########################################################################
|
||||
|
|
|
@ -408,14 +408,6 @@ sub pandora_purgedb ($$$) {
|
|||
log_message ('PURGE', 'Deleting old tgraph_source data.');
|
||||
db_do ($dbh,"DELETE FROM tgraph_source WHERE id_graph NOT IN (SELECT id_graph FROM tgraph)");
|
||||
|
||||
|
||||
# Delete network traffic old data.
|
||||
log_message ('PURGE', 'Deleting old network matrix data.');
|
||||
if ($conf->{'_delete_old_network_matrix'} > 0) {
|
||||
my $matrix_limit = time() - 86400 * $conf->{'_delete_old_network_matrix'};
|
||||
db_do ($dbh, "DELETE FROM tnetwork_matrix WHERE utimestamp < ?", $matrix_limit);
|
||||
}
|
||||
|
||||
# Delete old messages
|
||||
log_message ('PURGE', "Deleting old messages.");
|
||||
if ($conf->{'_delete_old_messages'} > 0) {
|
||||
|
@ -599,7 +591,6 @@ sub pandoradb_load_history_conf($) {
|
|||
|
||||
$options{'_days_autodisable_deletion'} = 0 unless defined ($options{'_days_autodisable_deletion'});
|
||||
$options{'_num_past_special_days'} = 0 unless defined($options{'_num_past_special_days'});
|
||||
$options{'_delete_old_network_matrix'} = 0 unless defined($options{'_delete_old_network_matrix'});
|
||||
$options{'_delete_old_messages'} = 0 unless defined($options{'_delete_old_messages'});
|
||||
$options{'_netflow_max_lifetime'} = 0 unless defined($options{'_netflow_max_lifetime'});
|
||||
$options{'claim_back_snmp_modules'} = 0 unless defined($options{'claim_back_snmp_modules'});
|
||||
|
@ -695,7 +686,6 @@ sub pandora_load_config_pdb ($) {
|
|||
$conf->{'_delete_notinit'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'delete_notinit'");
|
||||
$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_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->{'_metaconsole'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'metaconsole'");
|
||||
$conf->{'_netflow_max_lifetime'} = get_db_value ($dbh, "SELECT value FROM tconfig WHERE token = 'netflow_max_lifetime'");
|
||||
|
|
Loading…
Reference in New Issue