diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e420e62989..bbaa9c0ad9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-01-23 Ramon Novoa + + * pandoradb_data.sql, pandoradb.sql, + pandoradb.data.postgreSQL.sql, + pandoradb.data.oracle.sql, + godmode/netflow/nf_manage.php: Added netflow daemon configuration + options. + 2012-01-23 Juan Manuel Ramon * include/functions_api.php: Modified get_policy_modules function. diff --git a/pandora_console/godmode/netflow/nf_manage.php b/pandora_console/godmode/netflow/nf_manage.php index f173e54fb9..e775180f42 100644 --- a/pandora_console/godmode/netflow/nf_manage.php +++ b/pandora_console/godmode/netflow/nf_manage.php @@ -38,14 +38,12 @@ $update = (bool) get_parameter ("update"); if ($update) { $config['netflow_path'] = (string)get_parameter('netflow_path'); + $config['netflow_interval'] = (int)get_parameter('netflow_interval'); + $config['netflow_daemon'] = (string)get_parameter('netflow_daemon'); - if (db_get_value('token', 'tconfig', 'token', 'netflow_path') === false) { - config_create_value('netflow_path', $config['netflow_path']); - } else { - db_process_sql_update ('tconfig', - array ('value' => $config['netflow_path']), - array ('token' => 'netflow_path')); - } + db_process_sql_update ('tconfig', array ('value' => $config['netflow_path']), array ('token' => 'netflow_path')); + db_process_sql_update ('tconfig', array ('value' => $config['netflow_interval']), array ('token' => 'netflow_interval')); + db_process_sql_update ('tconfig', array ('value' => $config['netflow_daemon']), array ('token' => 'netflow_daemon')); } $table->width = '70%'; @@ -57,8 +55,12 @@ $table->style[0] = 'vertical-align: top;'; $table->data = array (); -$table->data[0][0] = ''.__('Path').''. ui_print_help_tip (__("Read input from a sequence of files in the same directory."), true); +$table->data[0][0] = ''.__('Data storage path').''. ui_print_help_tip (__("Directory where netflow data will be stored."), true); $table->data[0][1] = html_print_input_text ('netflow_path', $config['netflow_path'], false, 50, 200, true); +$table->data[1][0] = ''.__('Daemon interval').''; +$table->data[1][1] = html_print_input_text ('netflow_interval', $config['netflow_interval'], false, 50, 200, true); +$table->data[2][0] = ''.__('Daemon binary path').''; +$table->data[2][1] = html_print_input_text ('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true); echo '
'; diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 88bef43a8f..65de7b9849 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -85,6 +85,9 @@ INSERT INTO tconfig (token, value) VALUES ('integria_enabled', '0'); INSERT INTO tconfig (token, value) VALUES ('integria_api_password', ' '); INSERT INTO tconfig (token, value) VALUES ('integria_inventory', '0'); INSERT INTO tconfig (token, value) VALUES ('integria_url', ' '); +INSERT INTO tconfig (token, value) VALUES ('netflow_path', '/var/spool/pandora/data_in/netflow'); +INSERT INTO tconfig (token, value) VALUES ('netflow_interval', '300'); +INSERT INTO tconfig (token, value) VALUES ('netflow_daemon', '/usr/bin/nfcapd'); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 6580afa42d..97fed96469 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -81,7 +81,10 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('integria_enabled', '0'), ('integria_api_password', ''), ('integria_inventory', '0'), -('integria_url', ''); +('integria_url', ''), +('netflow_path', '/var/spool/pandora/data_in/netflow'), +('netflow_interval', '300'), +('netflow_daemon', '/usr/bin/nfcapd'); COMMIT WORK; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 022091771d..e15d751709 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1292,7 +1292,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` ( `ip_src` TEXT NOT NULL, `dst_port` TEXT NOT NULL, `src_port` TEXT NOT NULL, - `advanced_filter` TEXT NOT NULL,, + `advanced_filter` TEXT NOT NULL, `aggregate` varchar(60), `output` varchar(60), PRIMARY KEY (`id_sg`) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index a2bca35fc6..c4f867273f 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -80,7 +80,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('integria_enabled', '0'), ('integria_api_password', ''), ('integria_inventory', '0'), -('integria_url', ''); +('integria_url', ''), +('netflow_path', '/var/spool/pandora/data_in/netflow'), +('netflow_interval', '300'), +('netflow_daemon', '/usr/bin/nfcapd'); UNLOCK TABLES;