From 0fc33f3fa265614326e7bdefd3161eb5b96547e1 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 23 Feb 2018 14:38:26 +0100 Subject: [PATCH 01/19] Fixed module filter in view events --- pandora_console/operation/events/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index a7e6523c7e..9564e87b5e 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -275,7 +275,7 @@ if ($id_agent != 0) { } $text_module = (string) get_parameter('module_search', ''); -$id_agent_module = get_parameter('module_search_hidden', 0); +$id_agent_module = get_parameter('module_search_hidden', get_parameter('id_agent_module',0)); if ($id_agent_module != 0) { $text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); if ($text_module == false) { From 3ee2f8615ff63f002faf9921e0f259788ef031ab Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 26 Feb 2018 19:10:53 +0100 Subject: [PATCH 02/19] API and CLI apply template components - #983 --- pandora_console/include/functions_api.php | 143 ++++++++++++++++++++++ pandora_server/util/pandora_manage.pl | 98 ++++++++++++++- 2 files changed, 240 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e6d247b421..1d800fe386 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -10142,4 +10142,147 @@ function api_set_metaconsole_synch($keys) { } +function api_set_apply_module_template($id_template, $id_agent, $thrash3, $thrash4) { + + if (isset ($id_template)) { + // Take agent data + $row = db_get_row ("tagente", "id_agente", $id_agent); + + if ($row !== false) { + $intervalo = $row["intervalo"]; + $nombre_agente = $row["nombre"]; + $direccion_agente =$row["direccion"]; + $ultima_act = $row["ultimo_contacto"]; + $ultima_act_remota =$row["ultimo_contacto_remoto"]; + $comentarios = $row["comentarios"]; + $id_grupo = $row["id_grupo"]; + $id_os= $row["id_os"]; + $os_version = $row["os_version"]; + $agent_version = $row["agent_version"]; + $disabled= $row["disabled"]; + } + else { + return; + } + + $id_np = $id_template; + $name_template = db_get_value ('name', 'tnetwork_profile', 'id_np', $id_np); + $npc = db_get_all_rows_field_filter ("tnetwork_profile_component", "id_np", $id_np); + + if ($npc === false) { + $npc = array (); + } + + $success_count = $error_count = 0; + $modules_already_added = array(); + + foreach ($npc as $row) { + $nc = db_get_all_rows_field_filter ("tnetwork_component", "id_nc", $row["id_nc"]); + + if ($nc === false) { + $nc = array (); + } + foreach ($nc as $row2) { + // Insert each module from tnetwork_component into agent + $values = array( + 'id_agente' => $id_agent, + 'id_tipo_modulo' => $row2["type"], + 'descripcion' => __('Created by template ').$name_template. ' . '.$row2["description"], + 'max' => $row2["max"], + 'min' => $row2["min"], + 'module_interval' => $row2["module_interval"], + 'tcp_port' => $row2["tcp_port"], + 'tcp_send' => $row2["tcp_send"], + 'tcp_rcv' => $row2["tcp_rcv"], + 'snmp_community' => $row2["snmp_community"], + 'snmp_oid' => $row2["snmp_oid"], + 'ip_target' => $direccion_agente, + 'id_module_group' => $row2["id_module_group"], + 'id_modulo' => $row2["id_modulo"], + 'plugin_user' => $row2["plugin_user"], + 'plugin_pass' => $row2["plugin_pass"], + 'plugin_parameter' => $row2["plugin_parameter"], + 'unit' => $row2["unit"], + 'max_timeout' => $row2["max_timeout"], + 'max_retries' => $row2["max_retries"], + 'id_plugin' => $row2['id_plugin'], + 'post_process' => $row2['post_process'], + 'dynamic_interval' => $row2['dynamic_interval'], + 'dynamic_max' => $row2['dynamic_max'], + 'dynamic_min' => $row2['dynamic_min'], + 'dynamic_two_tailed' => $row2['dynamic_two_tailed'], + 'min_warning' => $row2['min_warning'], + 'max_warning' => $row2['max_warning'], + 'str_warning' => $row2['str_warning'], + 'min_critical' => $row2['min_critical'], + 'max_critical' => $row2['max_critical'], + 'str_critical' => $row2['str_critical'], + 'critical_inverse' => $row2['critical_inverse'], + 'warning_inverse' => $row2['warning_inverse'], + 'critical_instructions' => $row2['critical_instructions'], + 'warning_instructions' => $row2['warning_instructions'], + 'unknown_instructions' => $row2['unknown_instructions'], + 'id_category' => $row2['id_category'], + 'macros' => $row2['macros'], + 'each_ff' => $row2['each_ff'], + 'min_ff_event' => $row2['min_ff_event'], + 'min_ff_event_normal' => $row2['min_ff_event_normal'], + 'min_ff_event_warning' => $row2['min_ff_event_warning'], + 'min_ff_event_critical' => $row2['min_ff_event_critical'] + ); + + $name = $row2["name"]; + + // Put tags in array if the component has to add them later + if(!empty($row2["tags"])) { + $tags = explode(',', $row2["tags"]); + } + else { + $tags = array(); + } + + // Check if this module exists in the agent + $module_name_check = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('delete_pending' => 0, 'nombre' => $name, 'id_agente' => $id_agent)); + + if ($module_name_check !== false) { + $modules_already_added[] = $row2["name"]; + $error_count++; + } + else { + $id_agente_modulo = modules_create_agent_module($id_agent, $name, $values); + + if ($id_agente_modulo === false) { + $error_count++; + } + else { + if(!empty($tags)) { + // Creating tags + $tag_ids = array(); + foreach ($tags as $tag_name) { + $tag_id = tags_get_id($tag_name); + + //If tag exists in the system we store to create it + $tag_ids[] = $tag_id; + } + + tags_insert_module_tag ($id_agente_modulo, $tag_ids); + } + + $success_count++; + } + } + } + } + if ($error_count > 0) { + if (empty($modules_already_added)) + ui_print_error_message(__('Error adding modules') . sprintf(' (%s)', $error_count)); + else + ui_print_error_message(__('Error adding modules. The following errors already exists: ') . implode(', ', $modules_already_added)); + } + if ($success_count > 0) + ui_print_success_message(__('Modules successfully added')); + } + +} + ?> diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 90db5fa2f7..c07d838da8 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.719 PS180226"; +my $version = "7.0NG.719 PS180219"; # save program name for logging my $progname = basename($0); @@ -6066,6 +6066,10 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 3, 2); cli_export_visual_console(); } + elsif ($param eq '--apply_module_template') { + param_check($ltotal, 2, 2); + cli_apply_module_template(); + } else { print_log "[ERROR] Invalid option '$param'.\n\n"; $param = ''; @@ -6436,3 +6440,95 @@ sub cli_add_tag_to_module() { my $result = api_call(\%conf, 'set', 'add_tag_module', $module_id, $tag_id); print "\n$result\n"; } + +sub cli_apply_module_template() { + my ($id_template, $id_agent) = @ARGV[2..3]; + + my @row = get_db_rows ($dbh,"select * from tagente where id_agente = ".$id_agent); + + return if (scalar (@row) == 0); + + my $name_template = get_db_value ($dbh,'select name from tnetwork_profile where id_np = '.$id_template); + + my @npc = get_db_rows($dbh,"select * from tnetwork_profile_component where id_np = ".$id_template); + + foreach my $component (@npc) { + + my @template_values = get_db_rows ($dbh,"SELECT * FROM tnetwork_component where id_nc = ".$component->{'id_nc'}); + + return if (scalar (@template_values) == 0); + + foreach my $element (@template_values) { + my $agent_values; + $agent_values->{'id_agente'} = $id_agent; + $agent_values->{'id_tipo_modulo'} = $element->{"type"}; + $agent_values->{'descripcion'} = 'Created by template '.$name_template.' '.$element->{"description"}; + $agent_values->{'max'} = $element->{"max"}; + $agent_values->{'min'} = $element->{"min"}; + $agent_values->{'module_interval'} = $element->{"module_interval"}; + $agent_values->{'tcp_port'} = $element->{"tcp_port"}; + $agent_values->{'tcp_send'} = $element->{"tcp_send"}; + $agent_values->{'tcp_rcv'} = $element->{"tcp_rcv"}; + $agent_values->{'snmp_community'} = $element->{"snmp_community"}; + $agent_values->{'snmp_oid'} = $element->{"snmp_oid"}; + $agent_values->{'ip_target'} = $row[0]->{"direccion"}; + $agent_values->{'id_module_group'} = $element->{"id_module_group"}; + $agent_values->{'id_modulo'} = $element->{"id_modulo"}; + $agent_values->{'plugin_user'} = $element->{"plugin_user"}; + $agent_values->{'plugin_pass'} = $element->{"plugin_pass"}; + $agent_values->{'plugin_parameter'} = $element->{"plugin_parameter"}; + $agent_values->{'unit'} = $element->{"unit"}; + $agent_values->{'max_timeout'} = $element->{"max_timeout"}; + $agent_values->{'max_retries'} = $element->{"max_retries"}; + $agent_values->{'id_plugin'} = $element->{"id_plugin"}; + $agent_values->{'post_process'} = $element->{"post_process"}; + $agent_values->{'dynamic_interval'} = $element->{"dynamic_interval"}; + $agent_values->{'dynamic_max'} = $element->{"dynamic_max"}; + $agent_values->{'dynamic_min'} = $element->{"dynamic_min"}; + $agent_values->{'dynamic_two_tailed'} = $element->{"dynamic_two_tailed"}; + $agent_values->{'min_warning'} = $element->{"min_warning"}; + $agent_values->{'max_warning'} = $element->{"max_warning"}; + $agent_values->{'str_warning'} = $element->{"str_warning"}; + $agent_values->{'min_critical'} = $element->{"min_critical"}; + $agent_values->{'max_critical'} = $element->{"max_critical"}; + $agent_values->{'str_critical'} = $element->{"str_critical"}; + $agent_values->{'critical_inverse'} = $element->{"critical_inverse"}; + $agent_values->{'warning_inverse'} = $element->{"warning_inverse"}; + $agent_values->{'critical_instructions'} = $element->{"critical_instructions"}; + $agent_values->{'warning_instructions'} = $element->{"warning_instructions"}; + $agent_values->{'unknown_instructions'} = $element->{"unknown_instructions"}; + $agent_values->{'id_category'} = $element->{"id_category"}; + $agent_values->{'macros'} = $element->{"macros"}; + $agent_values->{'each_ff'} = $element->{"each_ff"}; + $agent_values->{'min_ff_event'} = $element->{"min_ff_event"}; + $agent_values->{'min_ff_event_normal'} = $element->{"min_ff_event_normal"}; + $agent_values->{'min_ff_event_warning'} = $element->{"min_ff_event_warning"}; + $agent_values->{'min_ff_event_critical'} = $element->{"min_ff_event_critical"}; + $agent_values->{'nombre'} = $element->{"name"}; + + my @tags; + if($element->{"tags"} ne '') { + @tags = split(',', $element->{"tags"}); + } + + my $module_name_check = get_db_value ($dbh,'select id_agente_modulo from tagente_modulo where delete_pending = 0 and nombre ="'.$agent_values->{'nombre'}.'" and id_agente = '.$id_agent); + + if (!defined($module_name_check)) { + + my $id_agente_modulo = pandora_create_module_from_hash(\%conf,$agent_values,$dbh); + + if ($id_agente_modulo != -1) { + + foreach my $tag_name (@tags) { + + my $tag_id = get_db_value($dbh,'select id_tag from ttag where name = "'.$tag_name.'"'); + + db_do($dbh,'insert into ttag_module (id_tag,id_agente_modulo) values ("'.$tag_id.'","'.$id_agente_modulo.'")'); + + } + } + } + } + } +} + From 9a4ea419420db3732596b81a11b53c35021f5117 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 7 Mar 2018 16:18:35 +0100 Subject: [PATCH 03/19] Add search bar to cluster agent aggregator - #1866 --- .../operation/agentes/ver_agente.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index b94a7733db..6058b90724 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -44,12 +44,16 @@ if (is_ajax ()) { $get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip"); $get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip"); $get_agent_id = (bool) get_parameter ("get_agent_id"); + $cluster_mode = (bool) get_parameter ("cluster_mode",0); + $agent_alias = get_parameter('alias', ''); + $agents_inserted = get_parameter('agents_inserted', array()); $id_group = (int) get_parameter('id_group'); if ($get_agents_group_json) { $id_group = (int) get_parameter('id_group'); $recursion = get_parameter ('recursion'); $id_os = get_parameter('id_os', ''); $agent_name = get_parameter('name', ''); + $privilege = (string) get_parameter ('privilege', "AR"); // Is is possible add keys prefix to avoid auto sorting in js object conversion $keys_prefix = (string) get_parameter ('keys_prefix', ''); @@ -75,6 +79,8 @@ if (is_ajax ()) { $filter['id_os'] = $id_os; if (!empty($agent_name)) $filter['nombre'] = '%' . $agent_name . '%'; + if (!empty($agent_alias)) + $filter['alias'] = '%' . $agent_alias . '%'; switch ($status_agents) { case AGENT_STATUS_NORMAL: @@ -98,6 +104,43 @@ if (is_ajax ()) { } $filter['order'] = "alias ASC"; + if($cluster_mode){ + + $agent_id_os = db_get_all_rows_sql('select id_os from tconfig_os where id_os != 21'); + + foreach ($agent_id_os as $key => $value) { + $agent_id_os_array[] = $agent_id_os[$key]['id_os']; + } + + $filter['id_os'] = $agent_id_os_array; + + if($agents_inserted[0] != ''){ + + $agents_id_list = ''; + + foreach($agents_inserted as $elem) { + + if ($elem === end($agents_inserted)) { + $agents_id_list .= $elem; + } + else{ + $agents_id_list .= $elem.','; + } + + } + + $agent_id_agente = db_get_all_rows_sql('select id_agente from tagente where id_agente not in ('.$agents_id_list.')'); + + foreach ($agent_id_agente as $key => $value) { + $agent_id_agente_array[] = $agent_id_agente[$key]['id_agente']; + } + + $filter['id_agente'] = $agent_id_agente_array; + + } + + } + // Build fields $fields = array('id_agente', 'alias'); From 97bcaec72050c8926d42dff895dc1ce59472fc75 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 8 Mar 2018 11:58:31 +0100 Subject: [PATCH 04/19] Not blink separator dots for digital clocks - #2026 --- pandora_console/include/graphs/pandora.d3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 98d4a54557..300ff0b665 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -2334,7 +2334,7 @@ var digitPattern = [ digit.select("path:nth-child(5)").classed("lit", function(d) { return digitPattern[4][d]; }); digit.select("path:nth-child(6)").classed("lit", function(d) { return digitPattern[5][d]; }); digit.select("path:nth-child(7)").classed("lit", function(d) { return digitPattern[6][d]; }); - separator.classed("lit", seconds & 1); + separator.classed("lit", seconds); setTimeout(tick, 1000 - now % 1000); })(); From 753d10920ab6e28e7794d68365b2e9f06953f80f Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 13 Mar 2018 12:46:27 +0100 Subject: [PATCH 05/19] Hide password custom fields data in agent custom fileds section - #2030 --- .../operation/agentes/custom_fields.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pandora_console/operation/agentes/custom_fields.php b/pandora_console/operation/agentes/custom_fields.php index b9f33aa672..607ab06360 100644 --- a/pandora_console/operation/agentes/custom_fields.php +++ b/pandora_console/operation/agentes/custom_fields.php @@ -78,19 +78,22 @@ else { $data[1] = html_print_image('images/delete.png', true); } - $custom_value = db_get_value_filter('description', - 'tagent_custom_data', array( - 'id_field' => $field['id_field'], - 'id_agent' => $id_agente)); - - if ($custom_value === false || $custom_value == '') { - $custom_value = '-'.__('empty').'-'; + $custom_value = db_get_all_rows_sql("select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields + INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = ".$field['id_field']." and tagent_custom_data.id_agent = ".$id_agente); + + if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') { + $custom_value[0]['description'] = '-'.__('empty').'-'; } else { - $custom_value = ui_bbcode_to_html($custom_value); + $custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']); } - $data[2] = $custom_value; + if($custom_value[0]['is_password_type']){ + $data[2] = '••••••••'; + } + else{ + $data[2] = $custom_value[0]['description']; + } array_push ($table->data, $data); } From d38df88c79656117162e131628a0b7b1b73821ea Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 13 Mar 2018 19:07:31 +0100 Subject: [PATCH 06/19] [Pie charts] Adding more space in legend --- pandora_console/include/graphs/functions_pchart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index fcbd67f00a..0114d36e32 100644 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -522,7 +522,7 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width, if ($legend_position != 'hidden') { // This is a hardcore adjustment to match most of the graphs, please don't alter - $legend_with_aprox = 32 + (4.5 * $max_chars); + $legend_with_aprox = 32 + (9.5 * $max_chars); $PieChart->drawPieLegend($width - $legend_with_aprox, 5, array("R"=>255,"G"=>255,"B"=>255, "BoxSize"=>10)); } From 690ad81a6265f31376f2a651d3b23fe051bc1354 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 14 Mar 2018 13:31:54 +0100 Subject: [PATCH 07/19] [Visual Console] Changed simple select by group select in restricted group advanced fieldin static graph --- .../include/functions_visual_map_editor.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index c9e8074dc1..b5f39f80d6 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -735,7 +735,17 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'icon', 'label', 'datos'); $form_items_advance['element_group_row']['html'] = ''. __('Restrict access to group') . '' . - '' . html_print_select($user_groups, 'element_group', '', '', '', 0, true) . + '' . + html_print_select_groups( + $config['id_user'], + "VR", + true, + 'element_group', + __('All'), + '', + '', + 0, + true) . ui_print_help_tip ( __("If selected, restrict visualization of this item in the visual console to users who have access to selected group. This is also used on calculating child visual consoles."), true) . ''; From a8cb366508d944d6ff0ba8b64c64bb80ad64a5f1 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 14 Mar 2018 17:24:34 +0100 Subject: [PATCH 08/19] [Alerts view] Fixed validation in alerts view --- pandora_console/include/functions_ui.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 751b1bf34e..caffcad739 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -961,9 +961,15 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f if (!defined('METACONSOLE')) { if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { $data[$index['validate']] = ''; - - - $data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true); + + $data[$index['validate']] .= html_print_checkbox ( + "validate[]", + $alert["id"], + false, + true, + false, + '', + true); } } From 1001240cf460375f22dd1adb92729bda3626a485 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 15 Mar 2018 16:03:46 +0100 Subject: [PATCH 09/19] [SNMP] Fixed translation of custom mibs, added custom description data and change style of OID details --- .../extensions/realtime_graphs.php | 2 +- .../agentes/module_manager_editor_network.php | 2 +- .../include/functions_snmp_browser.php | 41 +++++++++++-------- .../javascript/pandora_snmp_browser.js | 3 +- pandora_console/include/styles/pandora.css | 9 +++- 5 files changed, 35 insertions(+), 22 deletions(-) diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index b4fade177d..a218d59710 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -122,7 +122,7 @@ function pandora_realtime_graphs () { echo ''; // Define a custom action to save the OID selected in the SNMP browser to the form - html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); + html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); html_print_input_hidden ('incremental_base', '0'); echo ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 915d1b542a..557b17f388 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -27,7 +27,7 @@ html_print_input_hidden ('ajax_url', ui_get_full_url("ajax.php"), false); html_print_input_hidden ('search_matches_translation', __("Search matches"), false); // Define a custom action to save the OID selected in the SNMP browser to the form -html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); +html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); $isFunctionPolicies = enterprise_include_once('include/functions_policies.php'); diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 390d6ec151..f101faee0f 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -383,7 +383,7 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid, $version = ' else { $snmptranslate_bin = $config['snmptranslate']; } - exec ($snmptranslate_bin . " -Td " . escapeshellarg($oid), + exec ($snmptranslate_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . " -Td " . escapeshellarg($oid), $translate_output); foreach ($translate_output as $line) { if (preg_match ('/SYNTAX\s+(.*)/', $line, $matches) == 1) { @@ -399,13 +399,18 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid, $version = ' $oid_data['display_hint'] = $matches[1]; } } - - // Parse the description - $translate_output = implode ('', $translate_output); - if (preg_match ('/DESCRIPTION\s+\"(.*)\"/', $translate_output, $matches) == 1) { - $oid_data['description'] = $matches[1]; + + // Parse the description. First search for it in custom values + $custom_data = db_get_row('ttrap_custom_values', 'oid', $oid); + if ($custom_data === false) { + $translate_output = implode ('', $translate_output); + if (preg_match ('/DESCRIPTION\s+\"(.*)\"/', $translate_output, $matches) == 1) { + $oid_data['description'] = $matches[1]; + } + } else { + $oid_data['description'] = $custom_data['description']; } - + $full_value = explode (':', trim ($full_oid[1])); if (! isset ($full_value[1])) { $oid_data['value'] = trim ($full_oid[1]); @@ -482,26 +487,26 @@ function snmp_browser_print_oid ($oid = array(), $custom_action = '', $table->data[$i][1] = $oid['status']; $i++; } - + $closer = ''; $closer .= html_print_image ("images/blade.png", true, array ("title" => __('Close'), "style" => 'vertical-align: middle;'), false); $closer .= ''; - - $table->head[0] = $closer; - $table->head[1] = __('OID Information'); - + // Add a span for custom actions if ($custom_action != '') { - $output .= '' . $closer . $custom_action . ''; + $table->head[0] = '' . $closer . $custom_action . ''; + } else { + $table->head[0] = $closer; } - + + $table->head[1] = __('OID Information'); $output .= html_print_table($table, true); - + $url = "index.php?" . "sec=gmodules&" . "sec2=godmode/modules/manage_network_components"; - $output .= '
'; + $output .= ''; $output .= html_print_input_hidden('create_network_from_snmp_browser', 1, true); $output .= html_print_input_hidden('id_component_type', 2, true); $output .= html_print_input_hidden('type', 17, true); @@ -519,7 +524,7 @@ function snmp_browser_print_oid ($oid = array(), $custom_action = '', $output .= html_print_input_hidden('snmp_community', $community, true); $output .= html_print_input_hidden('snmp_version', $snmp_version, true); $output .= html_print_submit_button(__('Create network component'), - '', false, '', true); + '', false, 'class="sub add"', true); $output .= '
'; if ($return) { @@ -672,7 +677,7 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height $output .= ''; $output .= ''; $output .= '
'; - $output .= '
'; + $output .= '
'; $output .= ''; $output .= ''; $output .= ''; diff --git a/pandora_console/include/javascript/pandora_snmp_browser.js b/pandora_console/include/javascript/pandora_snmp_browser.js index fd202ad4dc..60f914c9e9 100644 --- a/pandora_console/include/javascript/pandora_snmp_browser.js +++ b/pandora_console/include/javascript/pandora_snmp_browser.js @@ -203,8 +203,9 @@ function hideOIDData() { // Empty previous OID data $("#snmp_data").empty(); - + $("#snmp_data").css('display', 'none'); + $(".forced_title_layer").css('display', 'none'); } // Search the SNMP tree for a matching string diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 28c6e3691d..6601807581 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -4619,4 +4619,11 @@ form ul.form_flex li ul li{ .events_bar { margin:0 auto; -} \ No newline at end of file +} + +#snmp_data { + background: #f9faf9; +} +#snmp_data .databox { + border: 0px; +} From 39ce3605206ead960fe52ca5802222d0f90dbb92 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 16 Mar 2018 11:12:19 +0100 Subject: [PATCH 10/19] [Logs] Scaped CDATAs on logs of windows agent --- pandora_agents/win32/modules/pandora_module.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index d7d5fb63c0..eac38c8fa1 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -532,6 +532,7 @@ Pandora_Module::getXml () { try { data_clean = strreplace (this->getDataOutput (data), "%", "%%" ); + data_clean = strreplace (data_clean, "]]>", "]]>front (); try { data_clean = strreplace (this->getDataOutput (data), "%", "%%" ); + data_clean = strreplace (data_clean, "]]>", "]]> Date: Fri, 16 Mar 2018 11:48:59 +0100 Subject: [PATCH 11/19] [Logs] Scaped CDATAs on logs of linux plugin --- pandora_agents/unix/plugins/grep_log_module | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_agents/unix/plugins/grep_log_module b/pandora_agents/unix/plugins/grep_log_module index 0769128cbd..6fc1cff239 100755 --- a/pandora_agents/unix/plugins/grep_log_module +++ b/pandora_agents/unix/plugins/grep_log_module @@ -215,6 +215,7 @@ sub print_log (@) { $output .= "\n"; $output .= ""; @@ -229,6 +230,7 @@ sub print_log (@) { $output .= "\n"; $output .= "\n"; foreach my $line (@data) { + $line =~ s/\]\]/]]]]>\n"; } $output .= "\n"; From d881e0028d4fcb1642dbfd18d8ef21e83876334e Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 16 Mar 2018 12:03:51 +0100 Subject: [PATCH 12/19] fixed errors detected SLA --- pandora_console/include/functions_modules.php | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index b940072a6a..dfe09384b7 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1087,21 +1087,14 @@ function modules_get_agentmodule_descripcion ($id_agente_modulo) { * * @return string Module type of the given agent module. */ -function modules_get_agentmodule_type ($id_agentmodule, $metaconsole = false, $id_server = null) { - - if ($metaconsole) { - $server = db_get_row('tmetaconsole_setup', 'id', $id_server); - - $return = db_get_value ('id_tipo_modulo', - 'tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); - - metaconsole_restore_db(); - } - else { - $return = db_get_value ('id_tipo_modulo', - 'tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); - } - +function modules_get_agentmodule_type ($id_agentmodule) { + $return = db_get_value ( + 'id_tipo_modulo', + 'tagente_modulo', + 'id_agente_modulo', + (int) $id_agentmodule + ); + return (int) $return; } @@ -2318,10 +2311,10 @@ function modules_change_relation_lock ($id_relation) { */ function modules_get_first_date($id_agent_module, $datelimit = 0) { global $config; - + //check datatype string or normal $table = "tagente_datos"; - $module_type_str = modules_get_type_name ($id_agent_module); + $module_type_str = modules_get_agentmodule_type($id_agent_module); if (strstr ($module_type_str, 'string') !== false) { $table = "tagente_datos_string"; } From 4aa57b23666b8252b567d9344a5a7552c3e951e8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Mar 2018 11:59:53 +0100 Subject: [PATCH 13/19] Fixed plugin path in pandora_update_version --- extras/pandora_update_version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 2b77dd8e02..17870d36e0 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -65,7 +65,7 @@ $PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \ $PANDHOME_ENT/pandora_plugins/Informix/informix.pl \ $PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \ $PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \ -$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl " +$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl " PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm" # Update version in spec files From 19b566d4c28dd7b2e9e845dee41993cd3ca040c8 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 20 Mar 2018 15:42:37 +0100 Subject: [PATCH 14/19] Fix cluster id_os bug - #2090 --- pandora_console/extras/mr/14.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 pandora_console/extras/mr/14.sql diff --git a/pandora_console/extras/mr/14.sql b/pandora_console/extras/mr/14.sql new file mode 100644 index 0000000000..46e66e3ab5 --- /dev/null +++ b/pandora_console/extras/mr/14.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from `tconfig_os` WHERE `id_os` = 21 and `name` = 'Cluster'); + +DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster'; + +COMMIT; \ No newline at end of file From 364daa8579fa3ee89d64bab9e6209f201fc92327 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 21 Mar 2018 16:51:08 +0100 Subject: [PATCH 15/19] Added group_id in cron job(mr and migrate) --- pandora_console/extras/mr/14.sql | 10 ++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 1 + 2 files changed, 11 insertions(+) diff --git a/pandora_console/extras/mr/14.sql b/pandora_console/extras/mr/14.sql index 46e66e3ab5..837eb40bd5 100644 --- a/pandora_console/extras/mr/14.sql +++ b/pandora_console/extras/mr/14.sql @@ -4,4 +4,14 @@ UPDATE `tagente` SET `id_os` = 100 WHERE `id_os` = 21 and (select `id_os` from ` DELETE FROM `tconfig_os` where `id_os` = 21 and `name` = 'Cluster'; +SET @st_oum721 = (SELECT IF( + (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled') > 0, + "ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0)", + "0" +)); + +PREPARE pr_oum721 FROM @st_oum721; +EXECUTE pr_oum721; +DEALLOCATE PREPARE pr_oum721; + COMMIT; \ No newline at end of file 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 4d67628920..87781d7a5f 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 @@ -1368,6 +1368,7 @@ END IF; SET @vv2 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tuser_task_scheduled'); IF @vv2>0 THEN ALTER TABLE tuser_task_scheduled MODIFY args TEXT NOT NULL; + ALTER TABLE tuser_task_scheduled ADD (id_grupo int(10) unsigned NOT NULL Default 0); END IF; END; // From f5e8d4f90ff86a25a41893da49b54be0d89631fe Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 21 Mar 2018 19:18:24 +0100 Subject: [PATCH 16/19] Help icon in module creator - #2081 --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 3e0aac7af1..1dc4daea66 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -555,7 +555,7 @@ if ($id_agente) { $help_header = 'plugins_tab'; break; case "module": - $type_module_t = (int) get_parameter ('moduletype', ''); + $type_module_t = get_parameter ('moduletype', ''); $tab_description = '- '. __('Modules'); if($type_module_t == 'webux'){ $help_header = 'wux_console'; From 243e24e56eb747c2ad23d383a16f30090ec21859 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 22 Mar 2018 00:01:23 +0100 Subject: [PATCH 17/19] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 998d883c51..5af97851a6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.720-180321 +Version: 7.0NG.720-180322 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index cd8f91a9fd..827e42a56e 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.720-180321" +pandora_version="7.0NG.720-180322" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 2867fcbc66..130c867a06 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.720'; -use constant AGENT_BUILD => '180321'; +use constant AGENT_BUILD => '180322'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 0bb6b96b3c..ec109b6c68 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.720 -%define release 180321 +%define release 180322 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3de5e65d15..727d3d6cba 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.720 -%define release 180321 +%define release 180322 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 690f0e5e52..9a367e6c91 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.720" -PI_BUILD="180321" +PI_BUILD="180322" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ecf3f1fadc..734cecfe42 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180321} +{180322} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 49c1c7d9b2..188d7454c9 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.720(Build 180321)") +#define PANDORA_VERSION ("7.0NG.720(Build 180322)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a20eb79e32..3de8f1551a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.720(Build 180321))" + VALUE "ProductVersion", "(7.0NG.720(Build 180322))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d441d4207c..aa7f25f878 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.720-180321 +Version: 7.0NG.720-180322 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 82e7e40b1f..2c9364762c 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.720-180321" +pandora_version="7.0NG.720-180322" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index c654b48fd2..05eb0ab0e8 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180321'; +$build_version = 'PC180322'; $pandora_version = 'v7.0NG.720'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0a3ac1acf9..3725bf6847 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index c7f2e5d382..9a87ae5704 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.720 -%define release 180321 +%define release 180322 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a190e8b030..80a197e3b4 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.720 -%define release 180321 +%define release 180322 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index cfa1cf7d0f..5b362ab884 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.720" -PI_BUILD="180321" +PI_BUILD="180322" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 87db9b804f..dbf37ee39f 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -33,7 +33,7 @@ use PandoraFMS::Tools; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.720 PS180321"; +my $version = "7.0NG.720 PS180322"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 201ce190ba..cdb88b534d 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.720 PS180321"; +my $version = "7.0NG.720 PS180322"; # save program name for logging my $progname = basename($0); From 632845c9b3896f5eed550778611eebdb674a5797 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 22 Mar 2018 11:04:19 +0100 Subject: [PATCH 18/19] Adapt search bar to cluster id_os 100 - #1866 --- pandora_console/operation/agentes/ver_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 6058b90724..52ad3766bc 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -106,7 +106,7 @@ if (is_ajax ()) { if($cluster_mode){ - $agent_id_os = db_get_all_rows_sql('select id_os from tconfig_os where id_os != 21'); + $agent_id_os = db_get_all_rows_sql('select id_os from tconfig_os where id_os != 100'); foreach ($agent_id_os as $key => $value) { $agent_id_os_array[] = $agent_id_os[$key]['id_os']; From dd02b6e2b83408145c46ae14b517bc83f78f43b1 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 22 Mar 2018 12:07:08 +0100 Subject: [PATCH 19/19] Check create_web_modules CLI functions - #2101 --- pandora_server/util/pandora_manage.pl | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index cdb88b534d..699dad757e 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -195,7 +195,6 @@ sub help_screen{ \n\t ]", 'Add snmp network module to policy'); help_screen_line('--create_policy_plugin_module', " \n\t [ \n\t \n\t \n\t \n\t \n\t \n\t ]", 'Add plug-in module to policy'); help_screen_line('--create_policy_data_module_from_local_component', ' '); - help_screen_line('--create_policy_web_module_from_local_component', ' '); help_screen_line('--add_collection_to_policy', " "); help_screen_line('--validate_policy_alerts', '', 'Validate the alerts of a given policy'); help_screen_line('--get_policy_modules', '', 'Get the modules of a policy'); @@ -5828,10 +5827,6 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 2, 2); cli_create_policy_data_module_from_local_component(); } - elsif ($param eq '--create_policy_web_module_from_local_component') { - param_check($ltotal, 2, 2); - cli_create_policy_web_module_from_local_component(); - } elsif ($param eq '--create_policy') { param_check($ltotal, 3, 2); cli_create_policy(); @@ -6275,25 +6270,6 @@ sub cli_create_policy_data_module_from_local_component() { enterprise_hook('pandora_create_policy_data_module_from_local_component',[$conf, $component, $policy_id, $dbh]); } -############################################################################## -# Create policy web module from local component. -# Related option: --create_policy_web_module_from_local_component -############################################################################## -sub cli_create_policy_web_module_from_local_component() { - my ($policy_name, $component_name) = @ARGV[2..3]; - - my $policy_id = enterprise_hook('get_policy_id',[$dbh, safe_input($policy_name)]); - exist_check($policy_id,'policy',$policy_name); - - my $lc_id = pandora_get_local_component_id($dbh, $component_name); - exist_check($lc_id,'local component',$component_name); - - # Get local component web - my $component = get_db_single_row ($dbh, 'SELECT * FROM tlocal_component WHERE id = ?', $lc_id); - - enterprise_hook('pandora_create_policy_web_module_from_local_component',[$conf, $component, $policy_id, $dbh]); -} - ############################################################################## # Create local component. # Related option: --create_local_component