diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index fa8a7cecb9..efe1852466 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2012-08-21 Miguel de Dios + + * extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql, + godmode/agentes/module_manager_editor_common.php, + godmode/agentes/module_manager.php, + godmode/agentes/configurar_agente.php, + godmode/agentes/module_manager_editor.php, pandoradb.sql, + pandoradb.postgreSQL.sql, pandoradb.oracle.sql, + operation/agentes/estado_ultimopaquete.php, + operation/agentes/estado_monitores.php, + operation/agentes/ver_agente.php: added in the modules the same + feature to set agent in "Quiet" mode. + 2012-08-21 Miguel de Dios * pandoradb.oracle.sql, operation/agentes/estado_generalagente.php, diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index c2d7e4e782..d3bae4d348 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -103,6 +103,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `module_ff_interval` int(4) unsigned def ALTER TABLE `tagente_modulo` CHANGE COLUMN `post_process` `post_process` double(18,5) default NULL; ALTER TABLE `tagente_modulo` ADD COLUMN `wizard_level` enum('basic','advanced','custom','nowizard') default 'nowizard'; ALTER TABLE `tagente_modulo` ADD COLUMN `macros` text; +ALTER TABLE `tagente_modulo` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0'; -- ----------------------------------------------------- -- Table `tnetwork_component` diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index 7d390f7a4d..5419492057 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -242,7 +242,6 @@ WHERE token='prominent_time'; -- ----------------------------------------------------- -- Table `tnetwork_component` -- ----------------------------------------------------- - ALTER TABLE tnetwork_component ADD (wizard_level VARCHAR2(100) default 'custom' NOT NULL); ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard')); ALTER TABLE tnetwork_component ADD (only_metaconsole NUMBER(5, 0) default 0 NOT NULL); @@ -252,15 +251,14 @@ ALTER TABLE tnetwork_component ADD (macros CLOB default ''); -- ----------------------------------------------------- -- Table `tagente_modulo` -- ----------------------------------------------------- - ALTER TABLE tagente_modulo ADD (wizard_level VARCHAR2(100) default 'nowizard' NOT NULL); ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard')); ALTER TABLE tagente_modulo ADD (macros CLOB default ''); +ALTER TABLE tagente_modulo ADD (quiet NUMBER(5, 0) default 0 NOT NULL); -- ----------------------------------------------------- -- Table `tplugin` -- ----------------------------------------------------- - ALTER TABLE tplugin ADD (macros CLOB default ''); ALTER TABLE tplugin ADD (parameters CLOB default ''); diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 7d18c2c590..37d33165eb 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -123,6 +123,7 @@ ALTER TABLE "talert_snmp" ADD COLUMN "single_value" varchar(255) DEFAULT ''; -- Table `tagente_modulo` -- ----------------------------------------------------- ALTER TABLE "tagente_modulo" ADD COLUMN "module_ff_interval" INTEGER NOT NULL default 0; +ALTER TABLE "tagente_modulo" ADD COLUMN "quiet" SMALLINT NOT NULL default 0; -- ----------------------------------------------------- -- Table `tevent_filter` diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7791973d7c..4986c48b44 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -65,6 +65,7 @@ $nombre_agente = ""; $direccion_agente = get_parameter ('direccion', ''); $intervalo = SECONDS_5MINUTES; $ff_interval = 0; +$quiet_module = 0; $id_server = ""; $max_alerts = 0; $modo = 1; @@ -683,6 +684,7 @@ if ($update_module || $create_module) { $max = (int) get_parameter ('max'); $interval = (int) get_parameter ('module_interval', $intervalo); $ff_interval = (int) get_parameter ('module_ff_interval'); + $quiet_module = (int) get_parameter ('quiet_module'); $id_plugin = (int) get_parameter ('id_plugin'); $id_export = (int) get_parameter ('id_export'); $disabled = (bool) get_parameter ('disabled'); @@ -818,7 +820,8 @@ if ($update_module) { 'custom_integer_2' => $custom_integer_2, 'min_ff_event' => $ff_event, 'unit' => $unit, - 'macros' => $macros); + 'macros' => $macros, + 'quiet' => $quiet_module); if ($prediction_module == 3 && $serialize_ops == '') { $result = false; @@ -926,7 +929,8 @@ if ($create_module) { 'custom_integer_2' => $custom_integer_2, 'min_ff_event' => $ff_event, 'unit' => $unit, - 'macros' => $macros); + 'macros' => $macros, + 'quiet' => $quiet_module); if ($prediction_module == 3 && $serialize_ops == '') { $id_agent_module = false; diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 0c5a0bbbca..c2c6fbde01 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -218,9 +218,9 @@ if ($multiple_delete) { } -// ========================== -// MODULE VISUALIZATION TABLE -// ========================== +// ================== +// TABLE LIST MODULES +// ================== $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente=' . $id_agente; $selectNameUp = ''; @@ -350,8 +350,8 @@ $params = implode(',', array ('id_agente_modulo', 'id_tipo_modulo', 'descripcion', 'nombre', 'max', 'min', 'module_interval', 'id_modulo', 'id_module_group', 'disabled','max_warning', 'min_warning', 'str_warning', 'max_critical', 'min_critical', - 'str_critical')); - + 'str_critical', 'quiet')); + $where = sprintf("delete_pending = 0 AND id_agente = %s", $id_agente); $search_string_entities = io_safe_input($search_string); @@ -480,8 +480,12 @@ foreach ($modules as $module) { $data = array (); } - - $data[0] = ''; + $data[0] = ""; + if ($module['quiet']) { + $data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) + . " "; + } + $data[0] .= ''; if ($module["disabled"]) $data[0] .= '' . ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt').''; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 201db538da..8ae165ab54 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -153,6 +153,7 @@ if ($id_agent_module) { $interval = agents_get_interval ($id_agente); } $ff_interval = $module['module_ff_interval']; + $quiet_module = $module['quiet']; $unit = $module['unit']; $tcp_port = $module['tcp_port']; $tcp_send = $module['tcp_send']; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 42cd8ded19..b1fb7dc47a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -264,7 +264,7 @@ $none_text = __('None'); $disabled_export = false; // If code comes from policies disable export select global $__code_from; -if ($__code_from == 'policies'){ +if ($__code_from == 'policies') { $none_text = __('Not needed'); $disabled_export = true; } @@ -314,6 +314,10 @@ $table_advanced->data[6][4] = html_print_select_from_sql ( ORDER BY name", 'id_tag_selected[]', $id_tag, '','','', true, true, false, false, 'width: 200px', '5'); +$table_advanced->data[7][0] = __('Quiet'); +$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true); +$table_advanced->colspan[7][1] = 4; +$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true); ?> diff --git a/pandora_console/operation/agentes/estado_ultimopaquete.php b/pandora_console/operation/agentes/estado_ultimopaquete.php index 3a008887de..16795c3e85 100644 --- a/pandora_console/operation/agentes/estado_ultimopaquete.php +++ b/pandora_console/operation/agentes/estado_ultimopaquete.php @@ -340,8 +340,12 @@ foreach ($modules as $module) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($module["id_policy_module"] != 0) { $linked = policies_is_module_linked($module['id_agente_modulo']); - $id_policy = db_get_value_sql('SELECT id_policy FROM tpolicy_modules WHERE id = '.$module["id_policy_module"]); - $name_policy = db_get_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy); + $id_policy = db_get_value_sql('SELECT id_policy + FROM tpolicy_modules + WHERE id = '.$module["id_policy_module"]); + $name_policy = db_get_value_sql('SELECT name + FROM tpolicies + WHERE id = '.$id_policy); $policyInfo = policies_info_module_policy($module["id_policy_module"]); $adopt = false; @@ -393,6 +397,10 @@ foreach ($modules as $module) { } $nombre_tipo_modulo = modules_get_moduletype_name ($module["id_tipo_modulo"]); echo ""; + if ($module['quiet']) { + html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => "")); + echo " "; + } ui_print_string_substr ($module["nombre"], 35, false, 10); echo " "; diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 264c99633d..502e26e924 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -709,22 +709,21 @@ foreach($config['extensions'] as $extension) { } } - - //RHEV extension is only available for RHEV Virtual Machines - if ($extension['extension_ope_tab']['id'] === "rhev_manager") { - - //Get id for remote field "rhev_type" + + //RHEV extension is only available for RHEV Virtual Machines + if ($extension['extension_ope_tab']['id'] === "rhev_manager") { + //Get id for remote field "rhev_type" $id_remote_field = db_get_value("id_field", "tagent_custom_fields", "name", "rhev_type"); - + //Get rhev type for this agent $rhev_type = db_get_value_filter ("description", "tagent_custom_data", array ("id_field" => $id_remote_field, "id_agent" => $agent['id_agente'])); - + //Check if rhev type is a vm - if ($rhev_type != "vm") { - continue; - } - } - + if ($rhev_type != "vm") { + continue; + } + } + $image = $extension['extension_ope_tab']['icon']; $name = $extension['extension_ope_tab']['name']; diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 02790474c2..a9fb414559 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -226,8 +226,9 @@ CREATE TABLE tagente_modulo ( wizard_level VARCHAR2(100) default 'nowizard' NOT NULL, macros CLOB default '', critical_instructions CLOB default '', - warning_instructions CLOB default '', - unknown_instructions CLOB default '', + warning_instructions CLOB default '', + unknown_instructions CLOB default '', + quiet NUMBER(5, 0) default 0 NOT NULL, CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard')) ); CREATE INDEX tagente_modulo_id_agente_idx ON tagente_modulo(id_agente); diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 73bf520f53..b58d8b4958 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -219,7 +219,8 @@ CREATE TABLE "tagente_modulo" ( "macros" TEXT default '', "critical_instructions" TEXT default '', "warning_instructions" TEXT default '', - "unknown_instructions" TEXT default '' + "unknown_instructions" TEXT default '', + "quiet" SMALLINT NOT NULL default 0 ); CREATE INDEX "tagente_modulo_id_agente_idx" ON "tagente_modulo"("id_agente"); CREATE INDEX "tagente_modulo_id_tipo_modulo_idx" ON "tagente_modulo"("id_tipo_modulo"); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 79c4ad3b2f..02d30e2a7d 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -220,6 +220,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `critical_instructions` text, `warning_instructions` text, `unknown_instructions` text, + `quiet` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id_agente_modulo`), KEY `main_idx` (`id_agente_modulo`,`id_agente`), KEY `tam_agente` (`id_agente`),