diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 9e6f6ee180..07db7327a5 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -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( diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 9eb19be28d..dc7bb103db 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -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); } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index a7df8d9764..25818b1f3e 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -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'), diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 87c32de026..ee98db9627 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -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