From 1d7d55a451a8e5ba8e19e185b089d5b30a38631e Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 9 Aug 2017 13:27:51 +0200 Subject: [PATCH] fixed errors in form wux --- pandora_console/extras/mr/6.sql | 7 +++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 6 ++++++ .../godmode/agentes/configurar_agente.php | 12 ++++++++++-- pandora_console/include/constants.php | 1 + pandora_console/pandoradb_data.sql | 1 + 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 pandora_console/extras/mr/6.sql diff --git a/pandora_console/extras/mr/6.sql b/pandora_console/extras/mr/6.sql new file mode 100644 index 0000000000..5e459a2622 --- /dev/null +++ b/pandora_console/extras/mr/6.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +ALTER TABLE tagente MODIFY COLUMN cascade_protection_module int(10) unsigned NOT NULL default '0'; + +INSERT INTO tmodule VALUES (8, 'Wux module'); + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index b3174434db..5c004155ac 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1415,3 +1415,9 @@ ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default -- --------------------------------------------------------------------- ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default ''; + +-- --------------------------------------------------------------------- +-- Table `tmodule` +-- --------------------------------------------------------------------- + +INSERT INTO tmodule VALUES (8, 'Wux module'); \ No newline at end of file diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index dd7123e781..6b4045bcb5 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -972,10 +972,18 @@ if ($update_module || $create_module) { $custom_integer_1_default = $module['custom_integer_1']; $custom_integer_2_default = $module['custom_integer_2']; } - $custom_string_1 = (string) get_parameter ('custom_string_1', $custom_string_1_default); + + if($id_module_type == MODULE_WUX){ + $custom_string_1 = base64_encode((string) get_parameter ('custom_string_1', $custom_string_1_default)); + $custom_integer_1 = (int) get_parameter ('custom_integer_1', $custom_integer_1_default); + } + else{ + $custom_string_1 = (string) get_parameter ('custom_string_1', $custom_string_1_default); + $custom_integer_1 = (int) get_parameter ('prediction_module', $custom_integer_1_default); + } + $custom_string_2 = (string) get_parameter ('custom_string_2', $custom_string_2_default); $custom_string_3 = (string) get_parameter ('custom_string_3', $custom_string_3_default); - $custom_integer_1 = (int) get_parameter ('custom_integer_1', $custom_integer_1_default); $custom_integer_2 = (int) get_parameter ('custom_integer_2', $custom_integer_2_default); // Get macros diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 82cd88aa41..f039a90504 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -311,6 +311,7 @@ define ('MODULE_PLUGIN', 4); define ('MODULE_PREDICTION', 5); define ('MODULE_WMI', 6); define ('MODULE_WEB', 7); +define ('MODULE_WUX', 8); /* Type of Modules of Prediction */ define ('MODULE_PREDICTION_SERVICE', 2); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index c36186aff9..9438ccea8a 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -344,6 +344,7 @@ INSERT INTO tmodule VALUES (4,'Plugin module'); INSERT INTO tmodule VALUES (5,'Prediction module'); INSERT INTO tmodule VALUES (6,'WMI module'); INSERT INTO tmodule VALUES (7, 'Web module'); +INSERT INTO tmodule VALUES (8, 'Wux module'); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (1,'OS Total process','Total process in Operating System (UNIX MIB)',13,15,0,0,300,0,'','','public','HOST-RESOURCES-MIB::hrSystemProcesses.0 ',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','',''); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `tags`, `disabled_types_event`, `module_macros`) VALUES (2,'OS CPU Load (1 min)','CPU Load in Operating System (UNIX MIB)',13,15,0,0,300,0,'','','public','UCD-SNMP-MIB::laLoad.1',4,2,0,NULL,NULL,NULL,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic','','','','','','');