#12323 added netflow interval select

This commit is contained in:
Daniel Cebrian 2024-01-02 12:57:02 +01:00
parent 0efa911300
commit 110d7f4842
4 changed files with 27 additions and 2 deletions

View File

@ -83,6 +83,23 @@ $table->data[3][] = html_print_label_input_block(
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
);
$table->data[4][] = html_print_label_input_block(
__('Netflow interval').ui_print_help_tip(__('It is necessary to restart the server if the value is changed.'), true),
html_print_select(
[
'600' => __('10 min'),
'1800' => __('30 min'),
'3600' => __('60 min'),
],
'netflow_interval',
$config['netflow_interval'],
'',
'',
0,
true
)
);
$table->data[4][] = html_print_label_input_block(
__('Enable Sflow'),
html_print_checkbox_switch_extended(

View File

@ -1624,6 +1624,10 @@ function config_update_config()
$error_update[] = __('Netflow max lifetime');
}
if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) {
$error_update[] = __('Netflow interval');
}
if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) {
$error_update[] = __('Name resolution for IP address');
}
@ -3060,6 +3064,10 @@ function config_process_config()
config_update_value('netflow_max_lifetime', '5');
}
if (!isset($config['netflow_interval'])) {
config_update_value('netflow_interval', 1800);
}
if (!isset($config['sflow_interval'])) {
config_update_value('sflow_interval', SECONDS_10MINUTES);
}

View File

@ -91,7 +91,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('sound_alert', 'include/sounds/air_shock_alarm.wav'),
('sound_critical', 'include/sounds/Star_Trek_emergency_simulation.wav'),
('sound_warning', 'include/sounds/negativebeep.wav'),
('netflow_interval', '3600'),
('netflow_interval', '1800'),
('netflow_daemon', '/usr/bin/nfcapd'),
('netflow_nfdump', '/usr/bin/nfdump'),
('netflow_max_resolution', '50'),

View File

@ -140,7 +140,7 @@ sub pandora_get_sharedconfig ($$) {
# Netflow configuration options
$pa_config->{"activate_netflow"} = pandora_get_tconfig_token ($dbh, 'activate_netflow', 0);
$pa_config->{"netflow_path"} = pandora_get_tconfig_token ($dbh, 'netflow_path', '/var/spool/pandora/data_in/netflow');
$pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 3600);
$pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 1800);
$pa_config->{"netflow_daemon"} = pandora_get_tconfig_token ($dbh, 'netflow_daemon', '/usr/bin/nfcapd');
# Sflow configuration options