From 92af61ce8327020b2aa075e908e1366f9be9aba4 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 15 Mar 2017 16:26:59 +0100 Subject: [PATCH 01/97] Added disk free (in MB) in percent disk free native windows module --- pandora_agents/win32/modules/pandora_module_factory.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc index a2a25e5f3b..23ebaaf7e8 100644 --- a/pandora_agents/win32/modules/pandora_module_factory.cc +++ b/pandora_agents/win32/modules/pandora_module_factory.cc @@ -38,6 +38,7 @@ #include "pandora_module_plugin.h" #include "pandora_module_ping.h" #include "pandora_module_snmpget.h" +#include "../windows/pandora_wmi.h" #include "../pandora_strutils.h" #include @@ -1137,6 +1138,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { } else if (module_freedisk_percent != "") { module = new Pandora_Module_Freedisk_Percent (module_name, module_freedisk_percent); + // Added a description with the memory free + char buffer[100]; + unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent); + if (sprintf(buffer, "Free memory %s %dMB", + module_freedisk_percent.c_str(), memory) > 0) { + module->setDescription(buffer); + } } else if (module_freememory != "") { module = new Pandora_Module_Freememory (module_name); } else if (module_freememory_percent != "") { From 5d1088dfa919a4c70fc1d889e6ef1f617c5dd57d Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 15 Mar 2017 17:18:53 +0100 Subject: [PATCH 02/97] Fixed problems with backgrounds when add visual console in dashboards. Gitlab: #533 --- .../include/functions_visual_map.php | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index ad38e4a4e9..6941e435ba 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -2434,12 +2434,9 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $proportion_height = 0; $proportion_width = 0; - - if (!is_null($height) && !is_null($width)) { $resizedMap = true; - if ($keep_aspect_ratio) { $ratio = min($width / $layout['width'], $height / $layout['height']); $mapWidth = $ratio * $layout['width']; @@ -2453,49 +2450,48 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $dif_height = $layout["height"] - $mapHeight; $dif_width = $layout["width"] - $mapWidth; - $proportion_height = $mapHeight / $layout["height"]; $proportion_width = $mapWidth / $layout["width"]; - - if (is_metaconsole()) { - $backgroundImage = - '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . - $config['homeurl'] . 'images/console/background/' . - $layout["background"]; - } - else { - $backgroundImage = - '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . - $config['homedir'] . '/images/console/background/' . - ($layout["background"]); + if ($layout["background"] != 'None.png' ) { + if (is_metaconsole()) { + $backgroundImage = + '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . + $config['homeurl'] . 'images/console/background/' . + $layout["background"]; + } + else { + $backgroundImage = + '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . + $config['homedir'] . '/images/console/background/' . + ($layout["background"]); + } } } else { $mapWidth = $layout["width"]; $mapHeight = $layout["height"]; - $backgroundImage = $metaconsole_hack . 'images/console/background/' . - $layout["background"]; + $backgroundImage = ''; + if ($layout["background"] != 'None.png' ) + $backgroundImage = $metaconsole_hack . 'images/console/background/' . + $layout["background"]; } if (defined('METACONSOLE')) { echo "
"; } - echo '
'; - echo ""; + height:' . $mapHeight . 'px; + background-color:'.$layout["background_color"].';">'; + + if ($layout["background"] != 'None.png' ) + echo ""; $layout_datas = db_get_all_rows_field_filter('tlayout_data', From b937db8f35f836a8e2f9442435a9da2dc67a5210 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 16 Mar 2017 09:10:22 +0100 Subject: [PATCH 03/97] remove debug console.log traces. --- .../include/ajax/visual_console.ajax.php | 4 ++-- pandora_console/include/graphs/flot/pandora.flot.js | 13 ++++--------- pandora_console/include/javascript/pandora.js | 2 -- .../include/javascript/pandora_events.js | 1 - pandora_console/operation/agentes/estado_agente.php | 1 - 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/ajax/visual_console.ajax.php b/pandora_console/include/ajax/visual_console.ajax.php index 789398139c..d736a71374 100644 --- a/pandora_console/include/ajax/visual_console.ajax.php +++ b/pandora_console/include/ajax/visual_console.ajax.php @@ -39,8 +39,8 @@ $render_map = (bool)get_parameter('render_map', false); $graph_javascript = (bool)get_parameter('graph_javascript', false); if ($render_map) { - $width = (int)get_parameter('width', '400'); - $height = (int)get_parameter('height', '400'); + $width = (int) get_parameter('width', '400'); + $height = (int) get_parameter('height', '400'); $keep_aspect_ratio = (bool) get_parameter('keep_aspect_ratio'); visual_map_print_visual_map($id_visual_console, true, true, $width, diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index b6f1eb2308..af8875d8b3 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1923,11 +1923,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (thresholded) { $.each(data_base, function() { - // Prepared to turning series - //if(showed[this.id.split('_')[1]]) { - datas.push(this); - //} + datas.push(this); }); + plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { yaxis: {max: max_draw}, @@ -1935,7 +1933,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, thresholded = false; } else { - var max_draw = plot.getAxes().yaxis.datamax; if (max_draw < red_threshold || max_draw < yellow_threshold) { @@ -1945,7 +1942,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $.extend(true, {}, options, { yaxis: {max: maxim_data + (maxim_data*0.5)}, })); - } else { + } + else { plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { yaxis: {max: plot.getAxes().yaxis.max}, @@ -1954,13 +1952,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, yellow_threshold, red_threshold, extremes, red_up); thresholded = true; - } plot.setData(datas); plot.draw(); - - //~ plot.setSelection(currentRanges); }); $('#menu_cancelzoom_' + graph_id).click(function() { diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index b46e6a4b18..d762d399e1 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -401,8 +401,6 @@ function alert_templates_changed_by_multiple_agents_with_alerts (event, id_agent templates.push($(val).val()); }); - console.log(templates); - $('#module').attr ('disabled', 1); $('#module').empty (); $('#module').append ($('').html ("Loading...").attr ("value", 0)); diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 7b78c0a637..bef17eda6e 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -542,7 +542,6 @@ function show_events_group_agent (id_insert, id_agent, server_id) { data: parameter, dataType: 'html', success: function (data) { - console.log(data); $("#"+id_insert).html(data); $("#"+id_insert).toggle(); } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 1d711398d6..7028394fd9 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -652,7 +652,6 @@ else { + - + @@ -295,6 +296,13 @@ $interface_traffic_modules = array( + From 77ee30df203cc80f993ef9a2486b9a75d834ed7e Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Tue, 21 Mar 2017 13:44:41 +0100 Subject: [PATCH 07/97] Fixed merge request --- pandora_console/include/functions_db.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 2ded4e7adb..da29447ff7 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1720,10 +1720,20 @@ function db_check_minor_relase_available () { * * @return bool Return if minor release is available or not */ -function db_check_minor_relase_available_to_um ($package) { +function db_check_minor_relase_available_to_um ($package, $ent, $offline) { global $config; - $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; + if (!$ent) { + $dir = $config['attachment_store'] . "/last_package/downloads/extras/mr"; + } + else { + if ($offline) { + $dir = $package . "/extras/mr"; + } + else { + $dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr"; + } + } $have_minor_release = false; From 145c521c11594a54f3699f6328537df1a43202fb Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Tue, 21 Mar 2017 16:50:27 +0100 Subject: [PATCH 08/97] Fixed name of agents in report Agents/Modules. Gitlab: #553 --- pandora_console/include/functions_reporting_html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 52fd213915..fa96b10c7f 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1361,7 +1361,7 @@ function reporting_html_agent_module($table, $item) { break; } - $file_name = ui_print_truncate_text($row['agent_alias'], 'agent_small', + $file_name = ui_print_truncate_text($row['agent_name'], 'agent_small', false, true, false, '...'); $table_data .= "" . $file_name . ""; From 62541482ab438947d97460508db8d5bf1f119423 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 22 Mar 2017 10:10:56 +0100 Subject: [PATCH 09/97] Filter custom graph size in visual console editor, autoset size - #99 --- pandora_console/general/cg_items.php | 7 +++ .../visual_console_builder.editor.js | 36 ++++++++++++++ .../include/functions_visual_map_editor.php | 48 ++++++++++++++++++- .../include/graphs/functions_flot.php | 2 +- .../operation/visual_console/render_view.php | 5 +- 5 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 pandora_console/general/cg_items.php diff --git a/pandora_console/general/cg_items.php b/pandora_console/general/cg_items.php new file mode 100644 index 0000000000..bb76299e07 --- /dev/null +++ b/pandora_console/general/cg_items.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index dbca48c15c..268720fb80 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -298,6 +298,26 @@ function update_button_palette_callback() { break; case 'module_graph': + + if($('#dir_items').html() == 'horizontal'){ + if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width')) + || parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){ + + alert($('#count_items').html()+' joined graph items are wider than background'); + return false; + + } + } + + if($('#dir_items').html() == 'vertical'){ + if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){ + alert($('#count_items').html()+' joined graph items are higher than background'); + return false; + + } + } + + if($('input[name=width_module_graph]').val() == ''){ alert('Undefined width'); return false; @@ -1151,6 +1171,8 @@ function loadFieldsFromDB(item) { }); + $('#count_items').html(1); + if (data.type == 6 || data.type == 7 || data.type == 8 || data.type == 1) { $("#period_row." + item).css('display', ''); @@ -1169,6 +1191,20 @@ function loadFieldsFromDB(item) { } else { + + jQuery.get ("ajax.php", + {"page": "general/cg_items","data": data.id_custom_graph}, + function (data, status) { + if(data.split(",")[0] == 4){ + $('#count_items').html(data.split(",")[1]); + $('#dir_items').html('vertical'); + } + else if (data.split(",")[0] == 5) { + $('#count_items').html(data.split(",")[1]); + $('#dir_items').html('horizontal'); + + } + }); $("input[name='radio_choice'][value='custom_graph']") .prop('checked', true); diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 8fa3306927..47ce7665ce 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -446,7 +446,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { html_print_input_text('width_module_graph', 300, '', 3, 5, true) . ' X ' . html_print_input_text('height_module_graph', 180, '', 3, 5, true) . - ''; + ' X ' . + '1 '. + ' item/s + '; //Insert and modify before the buttons to create or update. @@ -587,6 +590,49 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $(".border_color").attachColorPicker(); $(".fill_color").attachColorPicker(); $(".line_color").attachColorPicker(); + + $("input[name=radio_choice]").change(function(){ + $('#count_items').html(1); + }); + + $("#custom_graph").click(function(){ + $('#count_items').html(1); + jQuery.get ("ajax.php", + {"page": "general/cg_items","data": $(this).val()}, + function (data, status) { + if(data.split(",")[0] == 8){ + size = 400+(data.split(",")[1] * 50); + if(data.split(",")[1]>3){ + size = 400+(3 * 50); + } + $('#text-width_module_graph').val(size); + $('#text-height_module_graph').val(180); + + } + else if (data.split(",")[0] == 4) { + size = data.split(",")[1]; + if(data.split(",")[1] > 1){ + $('#count_items').html(data.split(",")[1]); + $('#dir_items').html('vertical'); + } + $('#text-width_module_graph').val(300); + $('#text-height_module_graph').val(50); + } + else if (data.split(",")[0] == 5) { + size = data.split(",")[1]; + if(data.split(",")[1] > 1){ + $('#count_items').html(data.split(",")[1]); + $('#dir_items').html('horizontal'); + } + $('#text-width_module_graph').val(100); + $('#text-height_module_graph').val(100); + } + + }); + + }); + + });
"; + $return = "
"; if ($water_mark != '') { $return .= ""; diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index fa507a1d55..5aff41f3e2 100755 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -302,9 +302,8 @@ $ignored_params['refr'] = ''; } }); - $(".graph").each(function(){ - height = parseInt($(this).css("height")) - 30; - + $(".graph:not([class~='noresizevc'])").each(function(){ + height = parseInt($(this).css("height")) - 30; $(this).css('height', height); }); From c014e00f336f5abd5f18892ff88bc7305b95dd11 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 22 Mar 2017 11:30:41 +0100 Subject: [PATCH 10/97] Fit thresholds on module graphs --- .../include/graphs/flot/pandora.flot.js | 109 +++++++++++++++--- 1 file changed, 92 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index b6f1eb2308..f6fc5e8baf 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1649,8 +1649,21 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (thresholded) { var zoom_data_threshold = new Array (); + var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, + red_threshold, extremes, red_up); + plot = $.plot($('#' + graph_id), data_base, + $.extend(true, {}, options, { + yaxis: { + max: y_recal.max, + min: y_recal.min + }, + xaxis: { + min: plot.getAxes().xaxis.min, + max: plot.getAxes().xaxis.max + } + })); zoom_data_threshold = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, - yellow_threshold, red_threshold, extremes, red_up); + red_threshold, extremes, red_up); plot.setData(zoom_data_threshold); plot.draw(); } @@ -1931,28 +1944,32 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { yaxis: {max: max_draw}, + xaxis: { + min: plot.getAxes().xaxis.min, + max: plot.getAxes().xaxis.max + } })); thresholded = false; } else { var max_draw = plot.getAxes().yaxis.datamax; - if (max_draw < red_threshold || max_draw < yellow_threshold) { - - var maxim_data = (red_threshold < yellow_threshold) ? yellow_threshold : red_threshold - - plot = $.plot($('#' + graph_id), data_base, - $.extend(true, {}, options, { - yaxis: {max: maxim_data + (maxim_data*0.5)}, - })); - } else { - plot = $.plot($('#' + graph_id), data_base, - $.extend(true, {}, options, { - yaxis: {max: plot.getAxes().yaxis.max}, - })); - } + // Recalculate the y axis + var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, + red_threshold, extremes, red_up); + plot = $.plot($('#' + graph_id), data_base, + $.extend(true, {}, options, { + yaxis: { + max: y_recal.max, + min: y_recal.min + }, + xaxis: { + min: plot.getAxes().xaxis.min, + max: plot.getAxes().xaxis.max + } + })); datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, - yellow_threshold, red_threshold, extremes, red_up); + red_threshold, extremes, red_up); thresholded = true; } @@ -2143,7 +2160,65 @@ function number_format(number, force_integer, unit) { return number + ' ' + shorts[pos] + unit; } -function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshold, +// Recalculate the threshold data depends on warning and critical +function axis_thresholded (threshold_data, y_min, y_max, red_threshold, extremes, red_up) { + + var y = { + min: 0, + max: 0 + }; + + // Default values + var yaxis_resize = { + up: null, + normal_up: 0, + normal_down: 0, + down: null + }; + // Resize the y axis to display all intervals + $.each(threshold_data, function() { + if (/_up/.test(this.id)){ + yaxis_resize['up'] = this.data[0][1]; + } + if (/_down/.test(this.id)){ + if (/critical/.test(this.id)) { + yaxis_resize['down'] = red_threshold; + } else { + yaxis_resize['down'] = extremes[this.id]; + } + } + if (/_normal/.test(this.id)){ + var end; + if (/critical/.test(this.id)) { + end = red_up; + } else { + end = extremes[this.id + '_2']; + } + if (yaxis_resize['normal_up'] < end) yaxis_resize['normal_up'] = end; + if (yaxis_resize['normal_down'] > this.data[0][1]) yaxis_resize['normal_down'] = this.data[0][1]; + } + }); + + // If you need to display a up or a down bar, display 10% of data height + var margin_up_or_down = (y_max - y_min)*0.10; + + // Calculate the new axis + y['max'] = yaxis_resize['normal_up'] > y_max ? yaxis_resize['normal_up'] : y_max; + y['min'] = yaxis_resize['normal_down'] > y_min ? yaxis_resize['normal_down'] : y_min; + if (yaxis_resize['up'] !== null) { + y['max'] = (yaxis_resize['up'] + margin_up_or_down) < y_max + ? y_max + : yaxis_resize['up'] + margin_up_or_down; + } + if (yaxis_resize['down'] !== null) { + y['min'] = (yaxis_resize['down'] - margin_up_or_down) < y_min + ? yaxis_resize['up'] + margin_up_or_down + : y_min; + } + + return y; +} +function add_threshold (data_base, threshold_data, y_min, y_max, red_threshold, extremes, red_up) { var datas = new Array (); From e2567f7b6a23ca764611774960040f54c3847a39 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 22 Mar 2017 12:06:29 +0100 Subject: [PATCH 11/97] Resolve jquery library bug (holagram dashboard) - #546 --- .../include/javascript/jquery.jquery-ui-1.10.0.custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/jquery.jquery-ui-1.10.0.custom.js b/pandora_console/include/javascript/jquery.jquery-ui-1.10.0.custom.js index bfdf34624b..97f51207c8 100755 --- a/pandora_console/include/javascript/jquery.jquery-ui-1.10.0.custom.js +++ b/pandora_console/include/javascript/jquery.jquery-ui-1.10.0.custom.js @@ -5727,7 +5727,7 @@ $.widget( "ui.dialog", { if ( !$( event.target ).closest(".ui-dialog").length ) { event.preventDefault(); $(".ui-dialog:visible:last .ui-dialog-content") - .data("ui-dialog")._focusTabbable(); + .data("ui-dialog"); } } }); From 22af4e703a300978c001886696ceb2a9e33b8447 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Thu, 23 Mar 2017 10:31:04 +0100 Subject: [PATCH 12/97] Alert in sound console with snmp alerts events - #38 --- pandora_console/include/functions_alerts.php | 21 ++++++++++++++------ pandora_console/operation/events/events.php | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 2b166cd331..8e87eee5b3 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -145,10 +145,22 @@ function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query = else { $temp = array(); foreach ($type as $item) { - $temp[] = '"' . $item . '"'; + array_push ( $temp , $item ); } - $typeWhere = ' AND event_type IN (' . implode(',', $temp) . ')'; + $typeWhere = ' AND event_type IN ('; + + foreach ($temp as $ele) { + $typeWhere .= "'".$ele."'"; + + if($ele != end($temp)){ + $typeWhere .= ","; + } + + } + + $typeWhere .= ')'; + } if ($agents == null) { @@ -160,14 +172,11 @@ function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query = else { $idAgents = array_values($agents); - if($type=='alert_fired'){ - $idAgents = array_keys($agents); - } } $result = db_get_all_rows_sql('SELECT id_evento FROM tevento - WHERE estado = 0 AND id_agente IN (' . implode(',', $idAgents) . ') ' . $typeWhere . $query . ' + WHERE estado = 0 AND id_agente IN (0,' . implode(',', $idAgents) . ') ' . $typeWhere . $query . ' ORDER BY id_evento DESC LIMIT 1'); if ($result === false) { diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 29abba5543..52d0abfe8f 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -139,7 +139,7 @@ if (is_ajax ()) { $alert = get_parameter('alert_fired'); if ($alert == 'true') { $resultAlert = alerts_get_event_status_group($idGroup, - 'alert_fired', $query, $agents); + array('alert_fired','alert_ceased'), $query, $agents); } $critical = get_parameter('critical'); if ($critical == 'true') { From 0660d28ed3211a9ec361a0d1345220cd85f6c041 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 23 Mar 2017 11:54:04 +0100 Subject: [PATCH 13/97] Fixed pdf netflow reports --- pandora_console/include/functions_graph.php | 2 +- .../include/functions_reporting.php | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d5e5fa9bb2..8582655e82 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4242,7 +4242,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit = $sources, array (), ui_get_full_url("images/image_problem.opaque.png", false, false, false), "", $unit, $homeurl, $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size'], $unit, 2); + $config['fontpath'], $config['font_size'], $unit, $ttl); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8927d87420..3d05c2099f 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -311,7 +311,8 @@ function reporting_make_reporting_data($report = null, $id_report, $type, $force_width_chart, $force_height_chart, - 'netflow_area'); + 'netflow_area', + $pdf); break; case 'netflow_pie': $report['contents'][] = reporting_netflow( @@ -320,7 +321,8 @@ function reporting_make_reporting_data($report = null, $id_report, $type, $force_width_chart, $force_height_chart, - 'netflow_pie'); + 'netflow_pie', + $pdf); break; case 'netflow_data': $report['contents'][] = reporting_netflow( @@ -329,7 +331,8 @@ function reporting_make_reporting_data($report = null, $id_report, $type, $force_width_chart, $force_height_chart, - 'netflow_data'); + 'netflow_data', + $pdf); break; case 'netflow_statistics': $report['contents'][] = reporting_netflow( @@ -338,7 +341,8 @@ function reporting_make_reporting_data($report = null, $id_report, $type, $force_width_chart, $force_height_chart, - 'netflow_statistics'); + 'netflow_statistics', + $pdf); break; case 'netflow_summary': $report['contents'][] = reporting_netflow( @@ -347,7 +351,8 @@ function reporting_make_reporting_data($report = null, $id_report, $type, $force_width_chart, $force_height_chart, - 'netflow_summary'); + 'netflow_summary', + $pdf); break; case 'monitor_report': $report['contents'][] = reporting_monitor_report( @@ -3241,7 +3246,7 @@ function reporting_monitor_report($report, $content) { } function reporting_netflow($report, $content, $type, - $force_width_chart, $force_height_chart, $type_netflow = null) { + $force_width_chart, $force_height_chart, $type_netflow = null, $pdf = false) { global $config; @@ -3315,7 +3320,7 @@ function reporting_netflow($report, $content, $type, $filter, $content['top_n_value'], $content ['server_name'], - 'HTML'); + $pdf ? 'PDF' : 'HTML'); break; case 'data': break; From 6948a2fa567d6a2f8132cbf541a277aafe1a8988 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 23 Mar 2017 12:32:30 +0100 Subject: [PATCH 14/97] Added start time in snmp interface graphics --- .../agentes/interface_traffic_graph_win.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 2c2ffdf7c7..5dce55b101 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -143,6 +143,7 @@ $interface_traffic_modules = array( $width = (int) get_parameter("width", 555); $height = (int) get_parameter("height", 245); $start_date = (string) get_parameter("start_date", date("Y-m-d")); + $start_time = get_parameter ("start_time", date("H:i:s")); $zoom = (int) get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_percentil = get_parameter ("show_percentil", 0); @@ -154,12 +155,19 @@ $interface_traffic_modules = array( echo ""; } - $current = date("Y-m-d"); + /*$current = date("Y-m-d"); if ($start_date != $current) $date = strtotime($start_date); else $date = $utime; + */ + $date = strtotime("$start_date $start_time"); + $now = time(); + + if ($date > $now){ + $date = $now; + } $urlImage = ui_get_full_url(false); @@ -230,6 +238,12 @@ $interface_traffic_modules = array( $table->data[] = $data; $table->rowclass[] = ''; + $data = array(); + $data[0] = __('Begin time'); + $data[1] = html_print_input_text ("start_time", $start_time,'', 10, 10, true); + $table->data[] = $data; + $table->rowclass[] = ''; + $data = array(); $data[0] = __('Time range'); $data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true); @@ -333,6 +347,7 @@ ui_include_time_picker(true); $("#text-start_date").datepicker({ dateFormat: "" }); + $("#text-start_time").timepicker({ showSecond: true, timeFormat: '', From d006c81eb06488e539cd4ab76955119e71ee03b9 Mon Sep 17 00:00:00 2001 From: vanessa gil Date: Thu, 23 Mar 2017 15:53:44 +0100 Subject: [PATCH 15/97] delete files. --- pandora_console/extras/mr/2.sql | 11 ----------- pandora_console/extras/mr/3.sql | 11 ----------- pandora_console/extras/mr/4.sql | 11 ----------- 3 files changed, 33 deletions(-) delete mode 100644 pandora_console/extras/mr/2.sql delete mode 100644 pandora_console/extras/mr/3.sql delete mode 100644 pandora_console/extras/mr/4.sql diff --git a/pandora_console/extras/mr/2.sql b/pandora_console/extras/mr/2.sql deleted file mode 100644 index 71e7ae46d4..0000000000 --- a/pandora_console/extras/mr/2.sql +++ /dev/null @@ -1,11 +0,0 @@ -START TRANSACTION; - -CREATE TABLE IF NOT EXISTS `ttable_test2` ( - `id` int(10) unsigned NOT NULL auto_increment, - `field1` varchar(60) NOT NULL default '', - `field2` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `tusuario` ADD COLUMN `test_nuevo2` tinyint(1) NOT NULL DEFAULT 0; - -COMMIT; diff --git a/pandora_console/extras/mr/3.sql b/pandora_console/extras/mr/3.sql deleted file mode 100644 index dd762ab02c..0000000000 --- a/pandora_console/extras/mr/3.sql +++ /dev/null @@ -1,11 +0,0 @@ -START TRANSACTION; - -CREATE TABLE IF NOT EXISTS `ttable_test3` ( - `id` int(10) unsigned NOT NULL auto_increment, - `field1` varchar(60) NOT NULL default '', - `field2` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `tusuario` ADD COLUMN `test3` tinyint(1) NOT NULL DEFAULT 0; - -COMMIT; diff --git a/pandora_console/extras/mr/4.sql b/pandora_console/extras/mr/4.sql deleted file mode 100644 index 013936a493..0000000000 --- a/pandora_console/extras/mr/4.sql +++ /dev/null @@ -1,11 +0,0 @@ -START TRANSACTION; - -CREATE TABLE IF NOT EXISTS `ttable_test4` ( - `id` int(10) unsigned NOT NULL auto_increment, - `field1` varchar(60) NOT NULL default '', - `field2` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `tusuario` ADD COLUMN `test4` asdfasdfa; - -COMMIT; From 895ec34a4ff92f2a3d3e7b8860e8a614021672bb Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 23 Mar 2017 16:13:18 +0100 Subject: [PATCH 16/97] Remove the layer 2 recon script from the DB (not from the disk yet, for upgrades). --- pandora_console/pandoradb_data.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 711f72cd67..d4c1440939 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1128,8 +1128,6 @@ INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (4, 'Group vi INSERT INTO `trecon_script` VALUES (2,'IPMI Recon','Specific Pandora FMS Intel DCM Discovery (c) Artica ST 2011 <info@artica.es> Usage: ./ipmi-recon.pl <task_id> <group_id> <create_incident_flag> <custom_field1> <custom_field2> <custom_field3> <custom_field4> * custom_field1 = Network i.e.: 192.168.100.0/24 * custom_field2 = Username * custom_field3 = Password * custom_field4 = Additional parameters i.e.: -D LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.: 192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional parameters\",\"help\":\"Optional additional parameters such as -D LAN_2_0 to use IPMI ver 2.0 instead of 1.5. These options will also be passed to the IPMI plugin when the current values are read.\",\"value\":\"\",\"hide\":\"\"}}'); -INSERT INTO `trecon_script` VALUES (4,'SNMP L2 Recon','Pandora FMS SNMP Recon Plugin for level 2 network topology discovery. (c) Artica ST 2014 <info@artica.es> Usage: ./snmp-recon.pl <task_id> <group_id> <create_incident> <custom_field1> <custom_field2> [custom_field3] [custom_field4] * custom_field1 = comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24) * custom_field2 = comma separated list of snmp communities to try. * custom_field3 = a router in the network. Optional but recommended. * custom_field4 = set to -a to add all network interfaces (by default only interfaces that are up are added). Additional information: When the script is called from a recon task the task_id, group_id and create_incident parameters are automatically filled by the Pandora FMS Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"Comma separated list of networks (i.e.: 192.168.1.0/24,192.168.2.0/24)\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"Comma separated list of snmp communities to try.\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Router\",\"help\":\"A router in the network. Optional but recommended.\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Optional parameter\",\"help\":\"Set to -a to add all network interfaces (by default only interfaces that are up are added).\",\"value\":\"\",\"hide\":\"\"}}'); - INSERT INTO `trecon_script` VALUES (5,'WMI Recon Script','This script is used to automatically gather host information via WMI. Available parameters: * Network = network to scan (e.g. 192.168.100.0/24). * WMI auth = comma separated list of WMI authentication tokens in the format username%password (e.g. Administrador%pass). See the documentation for more information.','/usr/share/pandora_server/util/recon_scripts/wmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"WMI auth\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}'); INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `plugin_type`, `macros`, `parameters`) VALUES (1,'IPMI Plugin','Plugin to get IPMI monitors from a IPMI Device.',0,'/usr/share/pandora_server/util/plugin/ipmi-plugin.pl',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"true\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Sensor\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Additional Options\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','-h _field1_ -u _field2_ -p _field3_ -s _field4_ -- _field5_'); @@ -1250,4 +1248,4 @@ INSERT INTO `tpolicy_modules` (`id_policy`, `configuration_data`, `id_tipo_modul -- -- Dumping data for table `tprofile_view` -- -INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*', '*','*'); \ No newline at end of file +INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*', '*','*'); From e5d29d4c3b9f372f82cbbb4e49b4e4fa31b9fa5f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 23 Mar 2017 16:14:31 +0100 Subject: [PATCH 17/97] Small speed optimization. Check parent_detection from the outer loop. --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index e35540400d..f06ff3c381 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1154,7 +1154,7 @@ sub scan($) { # Get a list of found hosts. my @hosts = @{$self->get_hosts()}; - if (scalar(@hosts) > 0) { + if (scalar(@hosts) > 0 && $self->{'parent_detection'} == 1) { # Delete previous connections. $self->call('delete_connections'); From 644eeaa7aa514603665ed11eaee0edafee1f0951 Mon Sep 17 00:00:00 2001 From: vanessa gil Date: Thu, 23 Mar 2017 16:51:00 +0100 Subject: [PATCH 18/97] delete file --- pandora_console/extras/mr/1.sql | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 pandora_console/extras/mr/1.sql diff --git a/pandora_console/extras/mr/1.sql b/pandora_console/extras/mr/1.sql deleted file mode 100644 index 4379665881..0000000000 --- a/pandora_console/extras/mr/1.sql +++ /dev/null @@ -1,11 +0,0 @@ -START TRANSACTION; - -CREATE TABLE IF NOT EXISTS `ttable_test` ( - `id` int(10) unsigned NOT NULL auto_increment, - `field1` varchar(60) NOT NULL default '', - `field2` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `tusuario` ADD COLUMN `test` tinyint(1) NOT NULL DEFAULT 0; - -COMMIT; From bac8b24853de70d339becec54a372925e0f205a2 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 24 Mar 2017 00:01:21 +0100 Subject: [PATCH 19/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2cdd80550d..f71633ff58 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170323 +Version: 7.0NG-170324 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 becb38c025..36313a71a8 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-170323" +pandora_version="7.0NG-170324" 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 301c4a9f9a..2cdcf08919 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170323'; +use constant AGENT_BUILD => '170324'; # 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 9e6b270a49..e68c032572 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 -%define release 170323 +%define release 170324 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 45e33c21c6..001b257b2e 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 -%define release 170323 +%define release 170324 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 e3a8f04b30..9f854edb5e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170323" +PI_BUILD="170324" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d3dff796c8..f73442a347 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170323} +{170324} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3c5c0cb38a..69f0e52de0 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(Build 170323)") +#define PANDORA_VERSION ("7.0NG(Build 170324)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 309588d0da..82b71fcd81 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(Build 170323))" + VALUE "ProductVersion", "(7.0NG(Build 170324))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b3f97d9732..2fd5639dc0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170323 +Version: 7.0NG-170324 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 8f1eb7c5a6..e74da0314d 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-170323" +pandora_version="7.0NG-170324" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1e0678adb6..9ac04e46e8 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 = 'PC170323'; +$build_version = 'PC170324'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9baa09fae7..e3d2e9dcdd 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Fri, 24 Mar 2017 10:46:41 +0100 Subject: [PATCH 20/97] Added safe output to free search at loading event filter --- pandora_console/operation/events/events_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 703a76c14f..13c8bbd296 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -57,6 +57,7 @@ if (is_ajax()) { $event_filter = events_get_event_filter($id_filter); + $event_filter['search'] = io_safe_output($event_filter['search']); $event_filter['id_name'] = io_safe_output($event_filter['id_name']); $event_filter['tag_with'] = base64_encode(io_safe_output($event_filter['tag_with'])); $event_filter['tag_without'] = base64_encode(io_safe_output($event_filter['tag_without'])); From b574a92f3539900d516b33a4e6992ea44e00aafb Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 24 Mar 2017 11:00:49 +0100 Subject: [PATCH 21/97] Fix a typo. --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index f06ff3c381..1236054528 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -249,8 +249,8 @@ sub are_connected($$$$$) { $if_1 = "ping" if $if_1 eq ''; $if_2 = "ping" if $if_2 eq ''; - if (defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t{$if_2}"}) || - defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t{$if_1}"})) { + if (defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t${if_2}"}) || + defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t${if_1}"})) { return 1; } From 277a3b656d1e91dacfc2bed764c12190b483bf8a Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 24 Mar 2017 11:22:30 +0100 Subject: [PATCH 22/97] Fixed mr and um mix in um online open --- .../include/ajax/rolling_release.ajax.php | 3 +-- pandora_console/include/functions.php | 2 +- pandora_console/include/functions_db.php | 3 +-- .../include/javascript/update_manager.js | 17 ++++++----------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/ajax/rolling_release.ajax.php b/pandora_console/include/ajax/rolling_release.ajax.php index e44c4cccdf..0af275d497 100644 --- a/pandora_console/include/ajax/rolling_release.ajax.php +++ b/pandora_console/include/ajax/rolling_release.ajax.php @@ -27,7 +27,7 @@ if (is_ajax ()) { $ent = get_parameter('ent'); $offline = get_parameter('offline'); if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { @@ -38,7 +38,6 @@ if (is_ajax ()) { } } $file = "$dir/$number.sql"; - $dangerous_query = false; $mr_file = fopen($file, "r"); while (!feof($mr_file)) { diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 06fb6f9edb..3ce4eed8da 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2687,7 +2687,7 @@ function get_number_of_mr($package, $ent, $offline) { global $config; if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 5dc6e6ad87..e682e1e138 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1724,7 +1724,7 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) { global $config; if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { @@ -1736,7 +1736,6 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) { } $have_minor_release = false; - if (file_exists($dir) && is_dir($dir)) { if (is_readable($dir)) { $files = scandir($dir); // Get all the files from the directory ordered by asc diff --git a/pandora_console/include/javascript/update_manager.js b/pandora_console/include/javascript/update_manager.js index 03d2dda856..b5fdde9121 100644 --- a/pandora_console/include/javascript/update_manager.js +++ b/pandora_console/include/javascript/update_manager.js @@ -872,7 +872,6 @@ function update_last_package(package, version, homeurl) { parameters, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -888,7 +887,6 @@ function update_last_package(package, version, homeurl) { parameters2, function (data) { if (data['correct']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -981,9 +979,7 @@ function install_free_package_prev_step(package, version, homeurl) { home_url + "ajax.php", parameters, function (data) { - $("#box_online .loading").hide(); $("#box_online .downloading_package").hide(); - if (data['have_minor']) { $("
").dialog ({ resizable: true, @@ -999,7 +995,6 @@ function install_free_package_prev_step(package, version, homeurl) { "Apply MR": function () { var err = []; err = apply_minor_release(data['mr'], package, 0, 0); - if (!err['error']) { if (err['message'] == 'bad_mr_filename') { $("#mr_dialog2").dialog("close"); @@ -1054,7 +1049,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1070,6 +1064,8 @@ function install_free_package_prev_step(package, version, homeurl) { }, "json" ); + + remove_rr_file_to_extras(); }, "Cancel": function () { $(this).dialog("close"); @@ -1155,7 +1151,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1172,7 +1167,7 @@ function install_free_package_prev_step(package, version, homeurl) { "json" ); - remove_rr_file(data['mr']); + remove_rr_file_to_extras(); } } else { @@ -1252,7 +1247,7 @@ function install_free_package_prev_step(package, version, homeurl) { dialog_have_mr_text = dialog_have_mr_text + "

" + text2_mr_file + "" + text3_mr_file + "" + text4_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + "
"; - $('#mr_dialog2').html(dialog_have_mr_mr_text); + $('#mr_dialog2').html(dialog_have_mr_text); $('#mr_dialog2').dialog('open'); } else { @@ -1267,7 +1262,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1286,7 +1280,8 @@ function install_free_package_prev_step(package, version, homeurl) { remove_rr_file_to_extras(); } - } + }, + "json" ); }, "Cancel": function () { From 2c3412a8a2e30d472b99665feee413b3ac85190b Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 24 Mar 2017 12:47:28 +0100 Subject: [PATCH 23/97] Init to show all mm links (between the same agent) --- pandora_console/include/functions_pandora_networkmap.php | 6 +++--- .../include/javascript/functions_pandora_networkmap.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index c0e7afc1c8..48ac7df1ea 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -1038,7 +1038,7 @@ function clean_duplicate_links ($relations) { if (enterprise_installed()) { delete_link($segregation_links['mm'][$index_to_del]); } - unset($segregation_links['mm'][$index_to_del]); + //unset($segregation_links['mm'][$index_to_del]); } $index_to_del++; } @@ -1142,8 +1142,8 @@ function clean_duplicate_links ($relations) { } $final_links3['aa'] = $final_links2['aa']; - $final_links3['mm'] = $final_links2['mm']; - $final_links3['am'] = $final_links2['am']; + $final_links3['mm'] = $segregation_links['mm']; + $final_links3['am'] = $segregation_links['am']; $final_links3['ff'] = $final_links2['ff']; $cleaned_links = array(); diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index c0742e65d4..bade82c1d2 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -2786,9 +2786,9 @@ function myMouseoutRhombusFunction(node_id) { function draw_elements_graph() { link = link.data(force.links(), function(d) { - return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id; + return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id + Math.random(); }); - + console.log(link); link_temp = link.enter() .append("g") .attr("id", function(d) { From 15749e323f7222fc3cb1749a27a03154f469e504 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 24 Mar 2017 13:07:49 +0100 Subject: [PATCH 24/97] Change sec param in policies section, gpolicies to gmodules / 7 / open - #562 --- pandora_console/godmode/agentes/module_manager.php | 2 +- pandora_console/godmode/alerts/alert_list.list.php | 2 +- pandora_console/godmode/alerts/alert_view.php | 2 +- pandora_console/include/ajax/module.php | 2 +- pandora_console/include/functions_ui.php | 2 +- pandora_console/operation/agentes/status_monitor.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 715dcf30ec..acbf762210 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -694,7 +694,7 @@ foreach ($modules as $module) { } } - $data[1] = '' . + $data[1] = '' . html_print_image($img,true, array('title' => $title)) . ''; } diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 62ab5b3ca9..aec32ad0ae 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -688,7 +688,7 @@ foreach ($simple_alerts as $alert) { else { $img = 'images/policies.png'; - $data[3] .= '  ' . + $data[3] .= '  ' . html_print_image($img, true, array('title' => $policyInfo['name'])) . ''; } diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index 5d2db04207..f420ea168c 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -115,7 +115,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) { else { $img = 'images/policies.png'; - $policy = '' . + $policy = '' . html_print_image($img, true, array('title' => $policyInfo['name'])) . ''; } diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index df85ab81e8..6eb5b0e17a 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -851,7 +851,7 @@ if ($list_modules) { } } - $data[1] = '' . + $data[1] = '' . html_print_image($img,true, array('title' => $title)) . ''; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 9e138b446d..8b9c377f1b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -813,7 +813,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f else { $img = 'images/policies.png'; - $data[$index['policy']] = '' . + $data[$index['policy']] = '' . html_print_image($img,true, array('title' => $policyInfo['name'])) . ''; } diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 3f010a25c6..e4bcec7dd8 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1050,7 +1050,7 @@ if (!empty($result)) { } } - $data[0] = '' . + $data[0] = '' . html_print_image($img,true, array('title' => $title)) . ''; } From f3b5e3bb03ab65cc60fc990bb6c6c8cd72a3a37f Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 24 Mar 2017 15:08:35 +0100 Subject: [PATCH 25/97] Adjust area graph position in vconsole dashboard / open - #566 --- .../godmode/reporting/visual_console_builder.editor.js | 7 +++---- pandora_console/include/graphs/functions_flot.php | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index dbca48c15c..ee03bfdaf3 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -3125,9 +3125,8 @@ function move_elements_resize(original_width, original_height, width, height) { } function unselectAll() { - $("#background").css('border', '1px lightgray solid'); - - $(".item").each(function(){ + $("#background").css('border', '1px lightgray solid'); + $(".item").each(function(){ $(this).css('border', ''); if($(this).attr('withborder') == 'true'){ $(this).css('top', '+=1'); @@ -3136,7 +3135,7 @@ function unselectAll() { } }); - + selectedItem = null; } function click_button_toolbox(id) { diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d3bf902fd9..ff05611534 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -265,7 +265,9 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, } $return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true); $return .= ""; - $return .= "
"; + $return .= "
"; if ($menu) { $height = 100; } From d1c4512977c0a8c95e630361765f6e46a154b608 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 25 Mar 2017 00:01:19 +0100 Subject: [PATCH 26/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f71633ff58..e2fd4a70b2 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170324 +Version: 7.0NG-170325 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 36313a71a8..aa7de81b3c 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-170324" +pandora_version="7.0NG-170325" 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 2cdcf08919..265078c390 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170324'; +use constant AGENT_BUILD => '170325'; # 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 e68c032572..2f4feeb687 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 -%define release 170324 +%define release 170325 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 001b257b2e..1d1187aaff 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 -%define release 170324 +%define release 170325 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 9f854edb5e..58b6a41316 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170324" +PI_BUILD="170325" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f73442a347..19de173928 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170324} +{170325} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 69f0e52de0..1737cf892f 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(Build 170324)") +#define PANDORA_VERSION ("7.0NG(Build 170325)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 82b71fcd81..c061fff96a 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(Build 170324))" + VALUE "ProductVersion", "(7.0NG(Build 170325))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2fd5639dc0..c7c57494c3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170324 +Version: 7.0NG-170325 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 e74da0314d..faa9c7e2db 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-170324" +pandora_version="7.0NG-170325" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9ac04e46e8..7ff40e7925 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 = 'PC170324'; +$build_version = 'PC170325'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e3d2e9dcdd..bd2e68dca8 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Sun, 26 Mar 2017 00:01:17 +0100 Subject: [PATCH 27/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e2fd4a70b2..10915c86e2 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170325 +Version: 7.0NG-170326 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 aa7de81b3c..2c9cf220b4 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-170325" +pandora_version="7.0NG-170326" 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 265078c390..f2ef0cfeac 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170325'; +use constant AGENT_BUILD => '170326'; # 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 2f4feeb687..e18fa65ab7 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 -%define release 170325 +%define release 170326 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 1d1187aaff..c3824fe6ff 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 -%define release 170325 +%define release 170326 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 58b6a41316..fd7588d1b0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170325" +PI_BUILD="170326" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 19de173928..6640a65a67 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170325} +{170326} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1737cf892f..d70aa715d7 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(Build 170325)") +#define PANDORA_VERSION ("7.0NG(Build 170326)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c061fff96a..18c3099ff7 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(Build 170325))" + VALUE "ProductVersion", "(7.0NG(Build 170326))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c7c57494c3..13820f60ba 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170325 +Version: 7.0NG-170326 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 faa9c7e2db..2c4cc77f9f 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-170325" +pandora_version="7.0NG-170326" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7ff40e7925..ae4bb1b073 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 = 'PC170325'; +$build_version = 'PC170326'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index bd2e68dca8..2401b03189 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Mon, 27 Mar 2017 00:01:16 +0200 Subject: [PATCH 28/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 10915c86e2..77aab2bff7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170326 +Version: 7.0NG-170327 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 2c9cf220b4..74be72a134 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-170326" +pandora_version="7.0NG-170327" 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 f2ef0cfeac..dfc3fccc3a 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170326'; +use constant AGENT_BUILD => '170327'; # 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 e18fa65ab7..0d037d3cb1 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 -%define release 170326 +%define release 170327 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 c3824fe6ff..06f5be2540 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 -%define release 170326 +%define release 170327 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 fd7588d1b0..dc5198fcc3 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170326" +PI_BUILD="170327" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 6640a65a67..5fbd9f1b2a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170326} +{170327} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d70aa715d7..fa700fa4a5 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(Build 170326)") +#define PANDORA_VERSION ("7.0NG(Build 170327)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 18c3099ff7..65e5c6e3a0 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(Build 170326))" + VALUE "ProductVersion", "(7.0NG(Build 170327))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 13820f60ba..44222590c8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170326 +Version: 7.0NG-170327 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 2c4cc77f9f..da285e6d26 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-170326" +pandora_version="7.0NG-170327" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ae4bb1b073..b347456355 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 = 'PC170326'; +$build_version = 'PC170327'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2401b03189..068f03c693 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Mon, 27 Mar 2017 12:01:31 +0200 Subject: [PATCH 29/97] fixed custom logo login --- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 5 +++++ 1 file changed, 5 insertions(+) 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 ed2b52115c..6b514e5bbd 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 @@ -1294,3 +1294,8 @@ DELETE FROM twidget WHERE unique_name = 'graph_availability'; -- Table `tbackup` -- --------------------------------------------------------------------- ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT ""; + +-- --------------------------------------------------------------------- +-- Table `tconfig` +-- --------------------------------------------------------------------- +UPDATE `tconfig` SET `value` = 'login_logo_v7.png' where `token`='custom_logo_login'; From fc7afffb2c9b8adf1405dcec7aeaf9f0e0d8a8c0 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 14:28:11 +0200 Subject: [PATCH 30/97] Added curved lines to networkmap to support more than 1 MM edges between the same node --- .../functions_pandora_networkmap.js | 77 +++++++++++++++++-- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index bade82c1d2..c0b361b25e 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -1145,18 +1145,79 @@ function zoom(manual) { function set_positions_graph() { link.selectAll("path.link") .attr("d", function(d) { - - return "M " + d.source.x + " " + d.source.y + - " L " + d.target.x + " " + d.target.y; - }); + if (d.arrow_end == "module" && d.arrow_start == "module") { + return arcPath(true, d); + } + else { + return "M " + d.source.x + " " + d.source.y + " L " + d.target.x + " " + d.target.y; + } + }) + .style("fill", "none"); link.selectAll("path.link_reverse") .attr("d", function(d) { - - return "M " + d.target.x + " " + d.target.y + - " L " + d.source.x + " " + d.source.y; - }); + if (d.arrow_end == "module" && d.arrow_start == "module") { + return arcPath(false, d); + } + else { + return "M " + d.target.x + " " + d.target.y + " L " + d.source.x + " " + d.source.y; + } + }) + .style("fill", "none"); + function arcPath(leftHand, d) { + var x1 = leftHand ? d.source.x : d.target.x, + y1 = leftHand ? d.source.y : d.target.y, + x2 = leftHand ? d.target.x : d.source.x, + y2 = leftHand ? d.target.y : d.source.y, + dx = x2 - x1, + dy = y2 - y1, + dr = Math.sqrt(dx * dx + dy * dy), + drx = dr, + dry = dr, + sweep = leftHand ? 0 : 1; + siblingCount = countSiblingLinks(d.source, d.target) + xRotation = 0, + largeArc = 0; + + if (siblingCount > 1) { + var siblings = getSiblingLinks(d.source, d.target); + var arcScale = d3.scale.ordinal() + .domain(siblings) + .rangePoints([1, siblingCount]); + drx = drx/(1 + (1/siblingCount) * (arcScale(d.text_start) - 1)); + dry = dry/(1 + (1/siblingCount) * (arcScale(d.text_start) - 1)); + + return "M" + x1 + "," + y1 + "A" + drx + ", " + dry + " " + xRotation + ", " + largeArc + ", " + sweep + " " + x2 + "," + y2; + } + else { + if (leftHand) { + return "M " + d.source.x + " " + d.source.y + " L " + d.target.x + " " + d.target.y; + } + else { + return "M " + d.target.x + " " + d.target.y + " L " + d.source.x + " " + d.source.y; + } + } + } + + function countSiblingLinks (source, target) { + var count = 0; + for(var i = 0; i < graph.links.length; ++i){ + if( (graph.links[i].source.id == source.id && graph.links[i].target.id == target.id) || (graph.links[i].source.id == target.id && graph.links[i].target.id == source.id) ) + count++; + } + return count; + } + + function getSiblingLinks (source, target) { + var siblings = []; + for(var i = 0; i < graph.links.length; ++i){ + if( (graph.links[i].source.id == source.id && graph.links[i].target.id == target.id) || (graph.links[i].source.id == target.id && graph.links[i].target.id == source.id) ) + siblings.push(graph.links[i].text_start); + } + return siblings; + } + node.selectAll(".node_shape_circle") .attr("cx", function(d) { return d.x; From 949fbc3660275ab50858fbbb427d3a2396da555e Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 15:33:27 +0200 Subject: [PATCH 31/97] Added the second interface text --- .../javascript/functions_pandora_networkmap.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index c0b361b25e..bf2969e261 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -2849,7 +2849,7 @@ function draw_elements_graph() { link = link.data(force.links(), function(d) { return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id + Math.random(); }); - console.log(link); + link_temp = link.enter() .append("g") .attr("id", function(d) { @@ -2875,7 +2875,7 @@ function draw_elements_graph() { link_temp.append("path") .attr("id", function(d) { - return "link_id_" + d.id_db + networkmap_id; + return "link_id_text_" + d.id_db + networkmap_id; }) .attr("class", function(d) { var holding_area_text = ""; @@ -2926,10 +2926,10 @@ function draw_elements_graph() { }); //Add the reverse line for the end marker, it is invisible - link_temp.append("path") - .attr("id", function(d) { - return "link_reverse_id_" + d.id_db; - }) + link_temp.append("path") + .attr("id", function(d) { + return "link_reverse_id_" + d.id_db + networkmap_id; + }) .attr("stroke-width", 0) .attr("d", null) .attr("class", function(d) { @@ -2940,7 +2940,7 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_id_" + d.id_db; + return "#link_id_text_" + d.id_db + networkmap_id; }) .append("tspan") .attr("style", "font-size: 12px; " + @@ -2952,7 +2952,7 @@ function draw_elements_graph() { "fill:#000000; " + "fill-opacity:1; " + "stroke:none; " + - "text-align:end; ") + "text-align:start; ") .text(function(d) { var text_link = ""; if (d.text_start) { @@ -2966,7 +2966,7 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_reverse_id_" + d.id_db; + return "#link_reverse_id_" + d.id_db + networkmap_id; }) .append("tspan") .attr("style", "font-size: 12px; " + From 9512d61e1681131a8364bc3f755a6c9a2af04308 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 16:03:25 +0200 Subject: [PATCH 32/97] Added interface text to add i.link or u.link --- .../include/javascript/functions_pandora_networkmap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index bf2969e261..dfc8cd2a94 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -532,6 +532,9 @@ function update_link(row_index, id_link) { temp_link["status_start"] = "0"; temp_link["status_end"] = "0"; + temp_link["text_start"] = data["text_start"]; + temp_link["text_end"] = data["text_end"]; + $.each(graph.nodes, function(k, node) { if (node['id_agent'] == data['id_db_target']) { temp_link["target"] = graph.nodes[k]; @@ -1924,8 +1927,8 @@ function add_interface_link_js () { temp_link['status_end'] = "0"; - //temp_link['text_start'] = link['text_start']; - //temp_link['text_end'] = link['text_end']; + temp_link['text_start'] = data['text_start']; + temp_link['text_end'] = data['text_end']; jQuery.each(graph.nodes, function(j, node) { if (node['id_agent'] == data['id_db_target']) { From 311143067a2a193ffa552d1949883f25d074d2f1 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 16:28:24 +0200 Subject: [PATCH 33/97] Fixed identical text to multiple links delimiter --- .../include/javascript/functions_pandora_networkmap.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index dfc8cd2a94..b9476a195e 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -172,7 +172,6 @@ function delete_link(source_id, source_module_id, target_id, target_module_id, i init_drag_and_drop(); set_positions_graph(); } - $("#dialog_node_edit").dialog("close"); } }); @@ -1188,8 +1187,8 @@ function set_positions_graph() { var arcScale = d3.scale.ordinal() .domain(siblings) .rangePoints([1, siblingCount]); - drx = drx/(1 + (1/siblingCount) * (arcScale(d.text_start) - 1)); - dry = dry/(1 + (1/siblingCount) * (arcScale(d.text_start) - 1)); + drx = drx/(1 + (1/siblingCount) * (arcScale(d.text_start + d.id_db + networkmap_id) - 1)); + dry = dry/(1 + (1/siblingCount) * (arcScale(d.text_start + d.id_db + networkmap_id) - 1)); return "M" + x1 + "," + y1 + "A" + drx + ", " + dry + " " + xRotation + ", " + largeArc + ", " + sweep + " " + x2 + "," + y2; } @@ -1216,7 +1215,7 @@ function set_positions_graph() { var siblings = []; for(var i = 0; i < graph.links.length; ++i){ if( (graph.links[i].source.id == source.id && graph.links[i].target.id == target.id) || (graph.links[i].source.id == target.id && graph.links[i].target.id == source.id) ) - siblings.push(graph.links[i].text_start); + siblings.push(graph.links[i].text_start + graph.links[i].id_db + networkmap_id); } return siblings; } From 27e8ddcdaf1941d546820a3e9f1a92e7aedabdde Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 16:37:26 +0200 Subject: [PATCH 34/97] Added AMA edges to list of links with the same parent and children --- .../include/javascript/functions_pandora_networkmap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index b9476a195e..093699da7a 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -1147,7 +1147,7 @@ function zoom(manual) { function set_positions_graph() { link.selectAll("path.link") .attr("d", function(d) { - if (d.arrow_end == "module" && d.arrow_start == "module") { + if (d.arrow_end == "module" || d.arrow_start == "module") { return arcPath(true, d); } else { @@ -1158,7 +1158,7 @@ function set_positions_graph() { link.selectAll("path.link_reverse") .attr("d", function(d) { - if (d.arrow_end == "module" && d.arrow_start == "module") { + if (d.arrow_end == "module" || d.arrow_start == "module") { return arcPath(false, d); } else { From 7dc9f9f21b82e7797386f5839950235479aa3d03 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 27 Mar 2017 17:06:55 +0200 Subject: [PATCH 35/97] Fixed styles of diferents graphs in dashboards when active mobile version. --- .../include/graphs/flot/pandora.flot.js | 315 ++++++------------ 1 file changed, 95 insertions(+), 220 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index b6f1eb2308..0e82ccded6 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -142,23 +142,31 @@ function pandoraFlotPieCustom(graph_id, values, labels, width, } var label_conf; - - label_conf = { - show: true, - radius: 0.75, - formatter: function(label, series) { - return '
' + - series.percent.toFixed(2) + '%
'; - }, - background: { - opacity: 0.5, - color: '' - } - }; - var show_legend = true; + if((width < 400) && (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) { + show_legend = false; + label_conf = { + show: false + }; + } + else { + label_conf = { + show: true, + radius: 0.75, + formatter: function(label, series) { + return '
' + + series.percent.toFixed(2) + '%
'; + }, + background: { + opacity: 0.5, + color: '' + } + }; + + } + var conf_pie = { series: { pie: { @@ -176,6 +184,9 @@ function pandoraFlotPieCustom(graph_id, values, labels, width, clickable: true } }; + if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { + conf_pie.series.pie.label = {show: false}; + } var plot = $.plot($('#'+graph_id), data, conf_pie); if (no_data == data.length) { @@ -205,17 +216,17 @@ function pandoraFlotPieCustom(graph_id, values, labels, width, var pielegends = $('#'+graph_id+' .pieLabelBackground'); pielegends.each(function () { - $(this).css('transform', "rotate(-35deg)"); + $(this).css('transform', "rotate(-35deg)").css('color', 'black'); }); var labelpielegends = $('#'+graph_id+' .pieLabel'); labelpielegends.each(function () { - $(this).css('transform', "rotate(-35deg)"); + $(this).css('transform', "rotate(-35deg)").css('color', 'black'); }); // Events $('#' + graph_id).bind('plothover', pieHover); $('#' + graph_id).bind('plotclick', Clickpie); - $('#' + graph_id).bind('mouseout',resetInteractivity); + $('#' + graph_id).bind('mouseout', resetInteractivity); $('#' + graph_id).css('margin-left', 'auto'); $('#' + graph_id).css('margin-right', 'auto'); @@ -309,15 +320,19 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark, borderWidth: 1, backgroundColor: { colors: ["#FFF", "#FFF"] } }, + xaxis: { + axisLabelUseCanvas: true, + axisLabelFontSizePixels: font_size, + axisLabelFontFamily: font+'Font', + tickFormatter: xFormatter, + }, yaxis: { - axisLabelUseCanvas: true, - axisLabelFontSizePixels: 12, - axisLabelFontFamily: font+'Font', - axisLabelPadding: 3, - ticks: yFormatter, - tickSize: 1, - color: '', - }, + axisLabelUseCanvas: true, + axisLabelFontSizePixels: font_size, + axisLabelFontFamily: font+'Font', + ticks: yFormatter, + color: '', + }, legend: { show: false } @@ -340,140 +355,37 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark, $('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-right","auto"); $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); - // Adjust the top of yaxis tick to set it in the middle of the bars - //yAxisHeight = $('#' + graph_id + ' .yAxis .tickLabel') - //.css('height').split('px')[0]; - //~ i = 0; - //~ $('#' + graph_id + ' .yAxis .tickLabel').each(function() { - //~ $(this).css('display','none'); - //~ $(this).addClass("legend_"+i); - //~ i++; - //~ }); - - $('#' + graph_id + ' .xAxis .tickLabel').each(function() { - /* - tickTop = $(this).css('top').split('px')[0]; - tickNewTop = parseInt(parseInt(tickTop) - (yAxisHeight / 2) - 3); - $(this).css('top', tickNewTop + 'px'); - - valuesNewTop = parseInt(parseInt(tickTop) - (yAxisHeight)); - - $('#value_' + i + '_' + graph_id) - .css('top',parseInt(plot.offset().top) + parseInt(valuesNewTop)); - - pixelPerValue = parseInt(plot.width()) / maxvalue; - - inCanvasValuePos = parseInt(pixelPerValue * - ($('#value_' + i + '_' + graph_id).html())); - label_width = ($('#value_' + i + '_' + graph_id) - .css('width').split('px')[0] - 3); - - label_left_offset = plot.offset().left + inCanvasValuePos + 5; //Label located on right side of bar + 5 pixels - - //If label fit into the bar just recalculate left position to fit on right side of bar - if (inCanvasValuePos > label_width) { - label_left_offset = plot.offset().left + inCanvasValuePos - - $('#value_' + i + '_' + graph_id).css('width').split('px')[0] - 3; - } - - $('#value_' + i + '_' + graph_id) - .css('left', label_left_offset); - i++; - */ - label = parseFloat($(this).text()); - text = label.toLocaleString(); - if ( label >= 1000000) - text = text.substring(0,4) + "M"; - else if (label >= 100000) - text = text.substring(0,3) + "K"; - else if (label >= 1000) - text = text.substring(0,2) + "K"; - - $(this).text(text); - - }); - /* - // When resize the window, adjust the values - $('#' + graph_id).parent().resize(function () { - i = 0; - pixelPerValue = parseInt(plot.width()) / maxvalue; - - $('#' + graph_id + ' .yAxis .tickLabel').each(function() { - inCanvasValuePos = parseInt(pixelPerValue * - ($('#value_' + i + '_' + graph_id).html())); - label_width = ($('#value_' + i + '_' + graph_id) - .css('width').split('px')[0] - 3); - - label_left_offset = plot.offset().left + inCanvasValuePos + 5; //Label located on right side of bar + 5 pixels - - //If label fit into the bar just recalculate left position to fit on right side of bar - if (inCanvasValuePos > label_width) { - label_left_offset = plot.offset().left + inCanvasValuePos - - $('#value_' + i + '_' + graph_id) - .css('width').split('px')[0] - 3; - } - - $('#value_' + i + '_' + graph_id) - .css('left', label_left_offset); - i++; - }); - }); - - // Format functions - function xFormatter(v, axis) { - if (labels[v] != undefined) { - return labels[v]; - } - else { - return ''; - } - } - - function yFormatter(v, axis) { - return v; - } - - // Events - $('#' + graph_id).bind('plothover', function (event, pos, item) { - $('.values_' + graph_id).css('font-weight', ''); - if (item != null) { - index = item.dataIndex; - $('#value_' + index + '_' + graph_id) - .css('font-weight', 'bold'); - } - }); - - if (water_mark) { - set_watermark(graph_id, plot, - $('#watermark_image_' + graph_id).attr('src')); - } - - if (maxvalue == 0) { - - // Fixed the position for the graphs with all values in - // bars is 0. - - $(".values_" + graph_id).css("left", (plot.offset().left + 5) + "px"); - } - * */ function yFormatter(v, axis) { format = new Array(); for (i = 0; i < labels_total.length; i++) { var label = labels_total[i][1]; - var shortLabel = reduceText(label, 30); + var shortLabel = reduceText(label, 25); var title = ''; if (label !== shortLabel) { title = label; label = shortLabel; } - format.push([i,'
' + format.push([i,'
' + label + '
']); } return format; } + function xFormatter(v, axis) { + label = parseFloat(v); + text = label.toLocaleString(); + if ( label >= 1000000) + text = text.substring(0,4) + "M"; + else if (label >= 100000) + text = text.substring(0,3) + "K"; + else if (label >= 1000) + text = text.substring(0,2) + "K"; + + return '
'+text+'
'; + } + if (water_mark) { set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); } @@ -600,20 +512,30 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, }, xaxis: { axisLabelUseCanvas: true, - axisLabelFontSizePixels: 7, + axisLabelFontSizePixels: font_size, axisLabelFontFamily: font+'Font', axisLabelPadding: 0, ticks: xFormatter, labelWidth: 130, + labelHeight: 50, }, yaxis: { axisLabelUseCanvas: true, - axisLabelFontSizePixels: 7, + axisLabelFontSizePixels: font_size, axisLabelFontFamily: font+'Font', axisLabelPadding: 100, autoscaleMargin: 0.02, tickFormatter: function (v, axis) { - return v ; + label = parseFloat(v); + text = label.toLocaleString(); + if ( label >= 1000000) + text = text.substring(0,4) + "M"; + else if (label >= 100000) + text = text.substring(0,3) + "K"; + else if (label >= 1000) + text = text.substring(0,2) + "K"; + + return '
'+text+'
'; } }, legend: { @@ -630,82 +552,43 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, } }; + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) + options.xaxis.labelWidth = 100; + var plot = $.plot($('#'+graph_id),datas, options ); $('#' + graph_id).VUseTooltip(); $('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-right","auto"); - $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); - // Adjust the top of yaxis tick to set it in the middle of the bars - //yAxisHeight = $('#'+graph_id+' .yAxis .tickLabel').css('height').split('px')[0]; - - //plot.getPlaceholder().onload = function(){pruebas}; - //~ i = 0; - //~ $('#'+graph_id+' .xAxis .tickLabel').each(function() { - //~ $(this).css('display','none'); - //~ $(this).addClass("legend_"+i); - //~ i++; - //~ tickNewTop = parseInt(parseInt(tickTop) - (yAxisHeight/2)-3); - //~ $(this).css('top', tickNewTop+'px'); - //~ - //~ valuesNewTop = parseInt(parseInt(tickTop) - (yAxisHeight)); - //~ - //~ $('#value_'+i+'_'+graph_id).css('top',parseInt(plot.offset().top) + parseInt(valuesNewTop)); -//~ - //~ pixelPerValue = parseInt(plot.width()) / maxvalue; - //~ - //~ inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html())); - //~ - //~ $('#value_'+i+'_'+graph_id).css('left',plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3); - //~ }); - - // When resize the window, adjust the values - //~ $('#'+graph_id).parent().resize(function () { - //~ i = 0; - //~ pixelPerValue = parseInt(plot.width()) / maxvalue; - //~ - //~ $('#'+graph_id+' .yAxis .tickLabel').each(function() { - //~ inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html())); - //~ - //~ $('#value_'+i+'_'+graph_id).css('left',plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3); - //~ i++; - //~ }); - //~ }); - - - - $('#'+graph_id+' .yAxis .tickLabel').each(function() { - label = parseFloat($(this).text()); - text = label.toLocaleString(); - if ( label >= 1000000) - text = text.substring(0,4) + "M"; - else if (label >= 100000) - text = text.substring(0,3) + "K"; - else if (label >= 1000) - text = text.substring(0,2) + "K"; - - $(this).text(text); - }); + //~ $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); $('#'+graph_id+' .xAxis .tickLabel') .css('transform', 'rotate(-45deg)') + .css('max-width','100px') .find('div') .css('position', 'relative') .css('top', '+10px') - .css('left', '-20px'); - + .css('left', '-30px'); + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) + $('#'+graph_id+' .xAxis .tickLabel') + .find('div') + .css('top', '+0px') + .css('left', '-20px'); // Format functions function xFormatter(v, axis) { var format = new Array(); for (i = 0; i < labels_total.length; i++) { var label = labels_total[i][1]; - var shortLabel = reduceText(label, 35); + var shortLabel = reduceText(label, 28); + if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) + shortLabel = reduceText(label, 18); var title = ''; if (label !== shortLabel) { title = label; label = shortLabel; } + format.push([i, - '
' + '
' + label + '
']); } @@ -713,22 +596,13 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, } function yFormatter(v, axis) { - return v; + return '
'+v+'
'; } function lFormatter(v, axis) { - return '
'+v+'
'; + return '
'+v+'
'; } - - // Events - //~ $('#'+graph_id).bind('plothover', function (event, pos, item) { - //~ $('.values_'+graph_id).css('font-weight', ''); - //~ if(item != null) { - //~ index = item.dataIndex; - //~ $('#value_'+index+'_'+graph_id).css('font-weight', 'bold'); - //~ } - //~ }); - + if (water_mark) { set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); } @@ -1581,7 +1455,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, // Re-calculate the graph height with the legend height if (dashboard || vconsole) { var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height(); - if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ + if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ } else { $('#'+graph_id).css('height', hDiff); @@ -1874,18 +1748,18 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, if (labels[v] == undefined) { return ''; } - return '
'+labels[v]+'
'; + return '
'+labels[v]+'
'; } function yFormatter(v, axis) { axis.datamin = 0; var formatted = number_format(v,force_integer,unit); - return '
'+formatted+'
'; + return '
'+formatted+'
'; } function lFormatter(v, item) { - return '
'+v+'
'; + return '
'+v+'
'; // Prepared to turn series with a checkbox //return '
'+v+'
'; } @@ -1994,7 +1868,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, $('#legend_'+graph_id).css('margin-bottom', '10px'); parent_height = parseInt( $('#menu_'+graph_id).parent().css('height').split('px')[0]); - adjust_menu(graph_id, plot, parent_height); + adjust_menu(graph_id, plot, parent_height, width); } if (!dashboard) { @@ -2195,5 +2069,6 @@ function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshol function reduceText (text, maxLength) { if (text.length <= maxLength) return text var firstSlideEnd = parseInt((maxLength - 3) / 2); - return text.substr(0, firstSlideEnd) + '...' + text.substr(-firstSlideEnd - 3); + var str_cut = text.substr(0, firstSlideEnd); + return str_cut + '...' + text.substr(-firstSlideEnd - 3); } From a0d9ddd8e676fab8fbd264ed42a34f9a1ba2ae0e Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 27 Mar 2017 17:55:17 +0200 Subject: [PATCH 36/97] Added some changes to networkmap --- .../include/functions_pandora_networkmap.php | 14 +++++++-- .../functions_pandora_networkmap.js | 30 +++++++++---------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 48ac7df1ea..7bab4df8b8 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -519,13 +519,23 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['arrow_end'] = 'module'; $item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null); $item['id_module_end'] = (int)$id_target_module; - $item['text_end'] = io_safe_output(modules_get_agentmodule_name((int)$id_target_module)); + $text_end = io_safe_output(modules_get_agentmodule_name((int)$id_target_module)); + if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_end, $matches)) { + if ($matches[1]) { + $item['text_end'] = $matches[1]; + } + } } if ($relation['child_type'] == 1) { $item['arrow_start'] = 'module'; $item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null); $item['id_module_start'] = (int)$id_source_module; - $item['text_start'] = io_safe_output(modules_get_agentmodule_name((int)$id_source_module)); + $text_start = io_safe_output(modules_get_agentmodule_name((int)$id_source_module)); + if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_start, $matches)) { + if ($matches[1]) { + $item['text_start'] = $matches[1]; + } + } } $agent = 0; diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 093699da7a..b6f48a4dbf 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -733,10 +733,10 @@ function edit_node(data, dblClick) { $("select[name='interface_source']", template_relation_row) .attr('name', "interface_source_" + i) - .attr('id', "interface_source_" + i + networkmap_id); + .attr('id', "interface_source_" + i); $("select[name='interface_target']", template_relation_row) .attr('name', "interface_target_" + i) - .attr('id', "interface_target_" + i + networkmap_id); + .attr('id', "interface_target_" + i); $(".edit_icon_progress", template_relation_row) .attr('class', "edit_icon_progress_" + i); $(".edit_icon", template_relation_row) @@ -2617,19 +2617,19 @@ function init_graph(parameter_object) { .data(module_color_status) .enter() .append("marker") - .attr("id", function(d) { return "interface_end_" + d.status_code; }) - .attr("refX", (node_radius / 2) + (interface_radius / 2)) - .attr("refY", interface_radius) - .attr("markerWidth", (node_radius / 2) + interface_radius) - .attr("markerHeight", (node_radius / 2) + interface_radius) - .attr("orient", "auto") - .append("circle") - .attr("cx", interface_radius) - .attr("cy", interface_radius) - .attr("r", interface_radius) - .attr("style", function(d) { - return "fill: " + d.color + ";"; - }); + .attr("id", function(d) { return "interface_end_" + d.status_code; }) + .attr("refX", (node_radius / 2) + (interface_radius / 2)) + .attr("refY", interface_radius) + .attr("markerWidth", (node_radius / 2) + interface_radius) + .attr("markerHeight", (node_radius / 2) + interface_radius) + .attr("orient", "auto") + .append("circle") + .attr("cx", interface_radius) + .attr("cy", interface_radius) + .attr("r", interface_radius) + .attr("style", function(d) { + return "fill: " + d.color + ";"; + }); defs.append("marker") .attr("id", "interface_start") From f81998b294126314d85180d137bac6c4762e0303 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 28 Mar 2017 00:01:18 +0200 Subject: [PATCH 37/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 77aab2bff7..d336bed61a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170327 +Version: 7.0NG-170328 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 74be72a134..518ba2512a 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-170327" +pandora_version="7.0NG-170328" 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 dfc3fccc3a..33d21fb43a 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170327'; +use constant AGENT_BUILD => '170328'; # 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 0d037d3cb1..ab27f9bd7d 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 -%define release 170327 +%define release 170328 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 06f5be2540..cf15f1151d 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 -%define release 170327 +%define release 170328 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 dc5198fcc3..b8f01f2c28 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170327" +PI_BUILD="170328" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 5fbd9f1b2a..34b343defe 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170327} +{170328} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index fa700fa4a5..df28d3fe44 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(Build 170327)") +#define PANDORA_VERSION ("7.0NG(Build 170328)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 65e5c6e3a0..c0d0a88f45 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(Build 170327))" + VALUE "ProductVersion", "(7.0NG(Build 170328))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 44222590c8..875bfee381 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170327 +Version: 7.0NG-170328 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 da285e6d26..0972b706c0 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-170327" +pandora_version="7.0NG-170328" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b347456355..ffd5bf593d 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 = 'PC170327'; +$build_version = 'PC170328'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 068f03c693..31911600a3 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Tue, 28 Mar 2017 11:32:58 +0200 Subject: [PATCH 38/97] Added a few modifications to networkmaps --- .../functions_pandora_networkmap.js | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index b6f48a4dbf..885b44286e 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -927,16 +927,34 @@ function add_agent_node(agents) { temp_node['state'] = data['state']; graph.nodes.push(temp_node); - /* FLECHAS EMPEZADO PARA MEJORAR + jQuery.each(data['rel'], function(i, relation) { var temp_link = {}; + if (i == 0) { + var found = 0; + temp_link['source'] = graph.nodes[temp_node['id']]; + jQuery.each(graph.nodes, function(j, element) { + if (element.id_agent == relation['id_agent_end']) { + found = j; + } + }); + temp_link['target'] = graph.nodes[found]; + } + else { + var found = 0; + temp_link['target'] = graph.nodes[temp_node['id']]; + jQuery.each(graph.nodes, function(j, element) { + if (element.id_agent == relation['id_agent_start']) { + found = j; + } + }); + temp_link['source'] = graph.nodes[found]; + } temp_link['id_db'] = String(relation['id_db']); temp_link['id_agent_end'] = String(relation['id_agent_end']); temp_link['id_agent_start'] = String(relation['id_agent_start']); temp_link['id_module_end'] = relation['id_module_end']; temp_link['id_module_start'] = relation['id_module_start']; - temp_link['source'] = relation['source']; - temp_link['target'] = relation['target']; temp_link['source_in_db'] = String(relation['source_in_db']); temp_link['target_in_db'] = String(relation['target_in_db']); temp_link['arrow_end'] = relation['arrow_end']; @@ -948,7 +966,6 @@ function add_agent_node(agents) { graph.links.push(temp_link); }); - */ draw_elements_graph(); init_drag_and_drop(); @@ -1155,7 +1172,7 @@ function set_positions_graph() { } }) .style("fill", "none"); - + link.selectAll("path.link_reverse") .attr("d", function(d) { if (d.arrow_end == "module" || d.arrow_start == "module") { @@ -1179,7 +1196,7 @@ function set_positions_graph() { dry = dr, sweep = leftHand ? 0 : 1; siblingCount = countSiblingLinks(d.source, d.target) - xRotation = 0, + xRotation = 1, largeArc = 0; if (siblingCount > 1) { @@ -2033,6 +2050,23 @@ function refresh_holding_area() { graph.links.push(temp_link); }); + $("#layer_graph_links_" + networkmap_id).remove(); + $("#layer_graph_nodes_" + networkmap_id).remove(); + + window.layer_graph_links = window.layer_graph + .append("g") + .attr("id", "layer_graph_links_" + networkmap_id); + window.layer_graph_nodes = window.layer_graph + .append("g") + .attr("id", "layer_graph_nodes_" + networkmap_id); + + force.nodes(graph.nodes) + .links(graph.links) + .start(); + + window.node = layer_graph_nodes.selectAll(".node"); + window.link = layer_graph_links.selectAll(".link"); + draw_elements_graph(); init_drag_and_drop(); set_positions_graph(); From 967b43061dd12446a2fe03615ea4018147eef860 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 28 Mar 2017 11:59:30 +0200 Subject: [PATCH 39/97] Added not init state if there are no initialized modules --- pandora_console/include/functions_agents.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 5455dab2bf..d998d9ea1f 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1739,6 +1739,10 @@ function agents_get_status($id_agent = 0, $noACLs = false) { } } + if (!isset($modules) || empty($modules) || count($modules) == 0) { + return AGENT_MODULE_STATUS_NOT_INIT; + } + $modules_status = array(); $modules_async = 0; foreach ($modules as $module) { From 881b86031c684830c3fb80a9cc47cfe3a30f5d64 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Tue, 28 Mar 2017 13:01:40 +0200 Subject: [PATCH 40/97] Fixed visual of graphs in dashboardswhen used mobile version. --- pandora_console/include/graphs/flot/pandora.flot.js | 7 ++++--- pandora_console/include/graphs/functions_flot.php | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 0e82ccded6..6a5badf26f 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -144,7 +144,7 @@ function pandoraFlotPieCustom(graph_id, values, labels, width, var label_conf; var show_legend = true; - if((width < 400) && (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))) { + if((width <= 450)) { show_legend = false; label_conf = { show: false @@ -354,7 +354,7 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark, $('#' + graph_id).HUseTooltip(); $('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-right","auto"); - $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); + //~ $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); function yFormatter(v, axis) { format = new Array(); @@ -731,7 +731,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, force_integer, separator, separator2, yellow_up, red_up, yellow_inverse, red_inverse, series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) { - + var threshold = true; var thresholded = false; font = font.split("/").pop().split(".").shift(); @@ -1928,6 +1928,7 @@ function set_watermark(graph_id, plot, watermark_src) { if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) { down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0]; } + var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width; var top_pos = 6; //var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height; diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index d3bf902fd9..39eff32a48 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -54,6 +54,8 @@ function include_javascript_dependencies_flot_graph($return = false) { ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.exportdata.pandora.js') .'"> + '; $output .= " @@ -205,7 +207,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, // Parent layer $return = "
"; // Set some containers to legend, graph, timestamp tooltip, etc. - $return .= "

"; + $return .= "

"; if (!empty($threshold_data)) { $yellow_up = $threshold_data['yellow_up']; @@ -241,7 +243,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $nbuttons++; } $menu_width = 25 * $nbuttons + 15; - if ( $dashboard == false AND $vconsole == false) { + if ( if ( $dashboard == false AND $vconsole == false) {) { $return .= "'; echo '
'; diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 885b44286e..f47a8657e5 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -928,7 +928,7 @@ function add_agent_node(agents) { graph.nodes.push(temp_node); - jQuery.each(data['rel'], function(i, relation) { + /*jQuery.each(data['rel'], function(i, relation) { var temp_link = {}; if (i == 0) { var found = 0; @@ -965,7 +965,7 @@ function add_agent_node(agents) { temp_link['text_start'] = relation['text_start']; graph.links.push(temp_link); - }); + });*/ draw_elements_graph(); init_drag_and_drop(); @@ -1972,6 +1972,7 @@ function refresh_holding_area() { var pos_x = parseInt(holding_pos_x) + parseInt(node_radius); var pos_y = parseInt(holding_pos_y) + parseInt(node_radius); if (enterprise_installed) { + $('#holding_spinner_' + networkmap_id).css("display", ""); var params = []; params.push("refresh_holding_area=1"); params.push("id=" + networkmap_id); @@ -1984,16 +1985,13 @@ function refresh_holding_area() { type: 'POST', url: action="ajax.php", success: function (data) { - if (data['correct']) { window.holding_area = data['holding_area']; - var length_nodes = graph.nodes.length; - jQuery.each(holding_area.nodes, function(i, node) { var temp_node = {}; - temp_node['id'] = length_nodes + node['id']; + temp_node['id'] = graph.nodes.length; holding_area.nodes[i]['id'] = temp_node['id']; temp_node['id_db'] = node['id_db']; @@ -2070,7 +2068,12 @@ function refresh_holding_area() { draw_elements_graph(); init_drag_and_drop(); set_positions_graph(); + + $('#holding_spinner_' + networkmap_id).css("display", "none"); } + }, + error: function(){ + $('#holding_spinner_' + networkmap_id).css("display", "none"); } }); } From f2b0d28d63c3074b60590abca366eccce3508ec5 Mon Sep 17 00:00:00 2001 From: mlopez Date: Tue, 28 Mar 2017 14:54:57 +0200 Subject: [PATCH 42/97] Update functions_flot.php --- pandora_console/include/graphs/functions_flot.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 39eff32a48..0b0e405dc4 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -54,8 +54,6 @@ function include_javascript_dependencies_flot_graph($return = false) { ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.exportdata.pandora.js') .'"> - '; $output .= " From a6a9f7eff41b180e020c7c7f6b6cbcf5742f615f Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 29 Mar 2017 00:01:21 +0200 Subject: [PATCH 43/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d336bed61a..4435ce5676 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170328 +Version: 7.0NG-170329 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 518ba2512a..937cfa9c36 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-170328" +pandora_version="7.0NG-170329" 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 33d21fb43a..e8af4770d3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170328'; +use constant AGENT_BUILD => '170329'; # 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 ab27f9bd7d..ed433ae809 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 -%define release 170328 +%define release 170329 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 cf15f1151d..7482f97243 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 -%define release 170328 +%define release 170329 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 b8f01f2c28..6104f258dd 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170328" +PI_BUILD="170329" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 34b343defe..0ccd32c2cb 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170328} +{170329} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index df28d3fe44..22cc2b4ed1 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(Build 170328)") +#define PANDORA_VERSION ("7.0NG(Build 170329)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c0d0a88f45..40d650900c 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(Build 170328))" + VALUE "ProductVersion", "(7.0NG(Build 170329))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 875bfee381..34e9ee4bd7 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170328 +Version: 7.0NG-170329 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 0972b706c0..70e3be05d4 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-170328" +pandora_version="7.0NG-170329" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ffd5bf593d..75beb569a3 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 = 'PC170328'; +$build_version = 'PC170329'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 31911600a3..5199e0635d 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Wed, 29 Mar 2017 10:52:50 +0200 Subject: [PATCH 44/97] Dont show "sell" message in manage_network_component header - #107 --- pandora_console/godmode/modules/manage_network_components.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 4aedb3d568..ec448f0cf4 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -49,7 +49,7 @@ You can of course remove the warnings, that's why we include the source and do n ui_print_page_header (__('Module management') . ' » ' . __('Network component management'), "", false, - "network_component", true,"sell",true,"modulemodal"); + "network_component", true,"",true,"modulemodal"); $sec = 'gmodules'; } From ea47372c06bc32c596a04424f7211fcb56beb341 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 29 Mar 2017 11:01:15 +0200 Subject: [PATCH 45/97] Deleted white space when saving modules template --- .../godmode/modules/manage_network_templates_form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_templates_form.php b/pandora_console/godmode/modules/manage_network_templates_form.php index b2176426dc..7e8078b8c9 100644 --- a/pandora_console/godmode/modules/manage_network_templates_form.php +++ b/pandora_console/godmode/modules/manage_network_templates_form.php @@ -73,9 +73,11 @@ elseif (isset ($_GET["add_module"])) { if (isset ($_GET["create"]) || isset ($_GET["update"])) { //Submitted form - $name = get_parameter_post ("name"); + $name = io_safe_output(get_parameter_post ("name")); $description = get_parameter_post ("description"); - if ($name != "") { + + if (!empty($name) && !ctype_space($name)) { + $name = io_safe_input($name); if ($id_np > 0) { //Profile exists $values = array( From 4d4f4669ac5cc8a68b517c82143169fd8146fe1d Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 29 Mar 2017 11:25:50 +0200 Subject: [PATCH 46/97] Show quotes in module template managment items description - #108 --- pandora_console/include/functions_ui.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 9e138b446d..cda5bb48b1 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -124,7 +124,7 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI } } if ($showTextInAToopTip) { - $truncateText = $truncateText . ui_print_help_tip($text, true); + $truncateText = $truncateText . ui_print_help_tip(htmlspecialchars($text), true); } else { if ($style !== false) { From a0d16eff764592ea77c804766dc7c09afab48ca6 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 29 Mar 2017 13:30:43 +0200 Subject: [PATCH 47/97] Make case insensitive search bar in agent manager - #33 --- pandora_console/godmode/agentes/modificar_agente.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 534b4efba0..9487a5519c 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -293,8 +293,8 @@ if ($search != "") { $search_sql .= ")"; }else{ $search_sql = " AND ( nombre " . $order_collation . " - LIKE '%$search%' OR alias " . $order_collation . " - LIKE '%$search%') "; + LIKE LOWER('%$search%') OR alias " . $order_collation . " + LIKE LOWER('%$search%')) "; } } From da175328890759425cff7b51c4119562f3476fb0 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 30 Mar 2017 00:01:18 +0200 Subject: [PATCH 48/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4435ce5676..8818a1000c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170329 +Version: 7.0NG-170330 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 937cfa9c36..5d9235b6eb 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-170329" +pandora_version="7.0NG-170330" 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 e8af4770d3..31059fce91 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170329'; +use constant AGENT_BUILD => '170330'; # 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 ed433ae809..36bf83a2b8 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 -%define release 170329 +%define release 170330 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 7482f97243..a21d8d94ef 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 -%define release 170329 +%define release 170330 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 6104f258dd..a38df7dcb7 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170329" +PI_BUILD="170330" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0ccd32c2cb..749db11aed 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170329} +{170330} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 22cc2b4ed1..935a923c50 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(Build 170329)") +#define PANDORA_VERSION ("7.0NG(Build 170330)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 40d650900c..b0753ea9b9 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(Build 170329))" + VALUE "ProductVersion", "(7.0NG(Build 170330))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 34e9ee4bd7..34f1384ec5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170329 +Version: 7.0NG-170330 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 70e3be05d4..4cc2149493 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-170329" +pandora_version="7.0NG-170330" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 75beb569a3..e2ed5df5d6 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 = 'PC170329'; +$build_version = 'PC170330'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5199e0635d..92b2668e14 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Thu, 30 Mar 2017 09:47:00 +0200 Subject: [PATCH 49/97] Add support for the new metaconsole licensing mode. --- pandora_server/lib/PandoraFMS/Config.pm | 6 ++++++ pandora_server/lib/PandoraFMS/Tools.pm | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 3ddf7ee052..8bd0145d0d 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -170,6 +170,11 @@ sub pandora_get_sharedconfig ($$) { #Public url $pa_config->{'public_url'} = pandora_get_tconfig_token ($dbh, 'public_url', 'http://localhost/pandora_console'); + # Node with a metaconsole license. + # NOTE: This must be read when checking license limits! + #$pa_config->{"node_metaconsole"} = pandora_get_tconfig_token ($dbh, 'node_metaconsole', 0); + + if ($pa_config->{'include_agents'} eq '') { $pa_config->{'include_agents'} = 0; } @@ -400,6 +405,7 @@ sub pandora_load_config { $pa_config->{"stats_interval"} = 300; $pa_config->{"agentaccess"} = 1; $pa_config->{"event_storm_protection"} = 0; + $pa_config->{"node_metaconsole"} = 0; # > 7.0NG # ------------------------------------------------------------------------- #SNMP Forwarding tokens diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index a562f13b99..8ce468acb2 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -1459,7 +1459,9 @@ sub valid_regex ($) { sub is_metaconsole ($) { my ($pa_config) = @_; - if (defined($pa_config->{"license_type"}) && $pa_config->{"license_type"} == METACONSOLE_LICENSE) { + if (defined($pa_config->{"license_type"}) && + $pa_config->{"license_type"} == METACONSOLE_LICENSE && + $pa_config->{"node_metaconsole"} == 0) { return 1; } From ce5b5dab6635b880e00c3a8a956ffc3e62a01cc1 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 30 Mar 2017 13:23:30 +0200 Subject: [PATCH 50/97] Fixed images. Only simple images in item Agent/modules report --- .../include/functions_reporting_html.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index fa96b10c7f..f6acad7fbe 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1379,7 +1379,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : NORMAL", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; case AGENT_STATUS_CRITICAL: $table_data .= ui_print_status_image( @@ -1387,7 +1388,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : CRITICAL", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; case AGENT_STATUS_WARNING: $table_data .= ui_print_status_image( @@ -1395,7 +1397,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : WARNING", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; case AGENT_STATUS_UNKNOWN: $table_data .= ui_print_status_image( @@ -1403,7 +1406,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : UNKNOWN", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; case AGENT_MODULE_STATUS_NORMAL_ALERT: case AGENT_MODULE_STATUS_WARNING_ALERT: @@ -1413,7 +1417,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : ALERTS FIRED", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; case 4: $table_data .= ui_print_status_image( @@ -1421,7 +1426,8 @@ function reporting_html_agent_module($table, $item) { __("%s in %s : Not initialize", $module_name, $row['agent_name']), - true, array('width' => '20px', 'height' => '20px')); + true, array('width' => '20px', 'height' => '20px'), + 'images/status_sets/default/'); break; } $table_data .= ""; From a67d40a447fd37d84f396ba0c80e66b5b9749a1c Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 30 Mar 2017 15:56:00 +0200 Subject: [PATCH 51/97] Added a few modifications to move the footer when nodes table is too long and recolocate interface text with every movement to see it well --- .../functions_pandora_networkmap.js | 45 +++++++++++++++++-- .../agentes/pandora_networkmap.view.php | 15 +++++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index f47a8657e5..d1649f8628 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -2310,6 +2310,7 @@ function init_drag_and_drop() { graph.nodes[d.id].py = d.py + delta[1]; }); + draw_elements_graph(); set_positions_graph(); d3.event.sourceEvent.stopPropagation(); @@ -2979,8 +2980,27 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_id_text_" + d.id_db + networkmap_id; + if (d.source.x < d.target.x) { + return "#link_id_text_" + d.id_db + networkmap_id; + } + else { + return "#link_reverse_id_" + d.id_db + networkmap_id; + } }) + .attr("startOffset", function(d) { + if (d.source.x < d.target.x) { + return ""; + } + else { + return "85%"; + }}) + .attr("text-anchor", function(d) { + if (d.source.x < d.target.x) { + return ""; + } + else { + return "end"; + }}) .append("tspan") .attr("style", "font-size: 12px; " + "font-style:normal; " + @@ -3005,8 +3025,27 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_reverse_id_" + d.id_db + networkmap_id; + if (d.source.x < d.target.x) { + return "#link_id_text_" + d.id_db + networkmap_id; + } + else { + return "#link_reverse_id_" + d.id_db + networkmap_id; + } }) + .attr("startOffset", function(d) { + if (d.source.x < d.target.x) { + return "85%"; + } + else { + return ""; + }}) + .attr("text-anchor", function(d) { + if (d.source.x < d.target.x) { + return "end"; + } + else { + return ""; + }}) .append("tspan") .attr("style", "font-size: 12px; " + "font-style:normal; " + @@ -3026,7 +3065,7 @@ function draw_elements_graph() { return (Array(25).join(" ")) + text_link; }); - + node = node.data(force.nodes(), function(d) { return d.id;}); node_temp = node.enter() diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 960cab857c..4896ad2e64 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -759,3 +759,18 @@ else { show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details); } ?> + + \ No newline at end of file From 4178343313a3de8f240a18c302cae5af1f29a6f6 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 30 Mar 2017 17:11:49 +0200 Subject: [PATCH 52/97] Added procedure to avoid migrate fail in tbackup --- .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 6b514e5bbd..b11c67f51a 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 @@ -1291,9 +1291,19 @@ UPDATE twidget_dashboard SET id_widget = (SELECT id FROM twidget WHERE unique_na DELETE FROM twidget WHERE unique_name = 'graph_availability'; -- --------------------------------------------------------------------- --- Table `tbackup` +-- Table `tbackup` (Extension table. Modify only if exists) -- --------------------------------------------------------------------- -ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT ""; +delimiter // +CREATE PROCEDURE addcol() +BEGIN +SET @vv1 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tbackup'); +IF @vv1>0 THEN + ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT ""; +END IF; +END; +// +CALL addcol(); +DROP PROCEDURE addcol; -- --------------------------------------------------------------------- -- Table `tconfig` From 599a8b7e111ca83b7d104da09a30def295961951 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 30 Mar 2017 17:27:19 +0200 Subject: [PATCH 53/97] Fixed problems with remote config view files of conf about server and satellite. --- .../godmode/servers/modificar_server.php | 7 ++++--- .../godmode/servers/servers.build_table.php | 13 +++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 11e98a1004..721b1597c6 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -55,12 +55,12 @@ if (isset($_GET["server"])) { } elseif (isset($_GET["server_remote"])) { - // Headers $id_server= get_parameter_get ("server_remote"); + $ext = get_parameter ("ext", ''); ui_print_page_header (__('Remote Configuration'), "images/gm_servers.png", false, "servers", true); enterprise_include("godmode/servers/server_disk_conf_editor.php"); - } +} else { // Header ui_print_page_header (__('Pandora servers'), "images/gm_servers.png", false, "servers", true); @@ -119,7 +119,8 @@ else { $correct = false; $id_server = get_parameter ("id_server"); - $server_md5 = md5(io_safe_output(servers_get_name ($id_server,'none')), FALSE); + $ext = get_parameter ("ext", ''); + $server_md5 = md5(io_safe_output(servers_get_name ($id_server,'none') . $ext), FALSE); if (file_exists ($config["remote_config"] . "/md5/" . $server_md5 . ".srv.md5")) { // Server remote configuration editor diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 5f03a29c64..0c8f542f2d 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -124,9 +124,14 @@ foreach ($servers as $server) { } $data[7] = ui_print_timestamp ($server['keepalive'], true); + + $ext = '_server'; + if ($server['type'] != 'data') + $ext = ''; + $safe_server_name = servers_get_name($server["id_server"]); - if (!isset($names_servers[$safe_server_name])){ - if (servers_check_remote_config ($safe_server_name) && enterprise_installed()) { + if (($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) { + if (servers_check_remote_config ($safe_server_name . $ext) && enterprise_installed()) { $names_servers[$safe_server_name] = true; } else { $names_servers[$safe_server_name] = false; @@ -154,8 +159,8 @@ foreach ($servers as $server) { array('title' => __('Edit'))); $data[8] .= ''; - if ($names_servers[$safe_server_name] === true) { - $data[8] .= ''; + if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) { + $data[8] .= ''; $data[8] .= html_print_image ('images/remote_configuration.png', true, array('title' => __('Remote configuration'))); $data[8] .= ''; From 3d1bdc799ef92eb9b4091d28254a09bc043a637e Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 31 Mar 2017 00:01:19 +0200 Subject: [PATCH 54/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8818a1000c..5bd64c5423 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170330 +Version: 7.0NG-170331 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 5d9235b6eb..caa361c43b 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-170330" +pandora_version="7.0NG-170331" 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 31059fce91..efab1e3a40 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170330'; +use constant AGENT_BUILD => '170331'; # 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 36bf83a2b8..61a71a0456 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 -%define release 170330 +%define release 170331 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 a21d8d94ef..a6200e5cb7 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 -%define release 170330 +%define release 170331 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 a38df7dcb7..26e9d85634 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170330" +PI_BUILD="170331" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 749db11aed..017b7ee304 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170330} +{170331} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 935a923c50..967411f0da 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(Build 170330)") +#define PANDORA_VERSION ("7.0NG(Build 170331)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b0753ea9b9..5a175689c1 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(Build 170330))" + VALUE "ProductVersion", "(7.0NG(Build 170331))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 34f1384ec5..fc1395f622 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170330 +Version: 7.0NG-170331 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 4cc2149493..dfa5464601 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-170330" +pandora_version="7.0NG-170331" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e2ed5df5d6..6bcc31f39a 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 = 'PC170330'; +$build_version = 'PC170331'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 92b2668e14..7e280015de 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Fri, 31 Mar 2017 10:36:05 +0200 Subject: [PATCH 55/97] new file. --- pandora_console/extras/mr/1.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pandora_console/extras/mr/1.sql diff --git a/pandora_console/extras/mr/1.sql b/pandora_console/extras/mr/1.sql new file mode 100644 index 0000000000..3731fa4de7 --- /dev/null +++ b/pandora_console/extras/mr/1.sql @@ -0,0 +1,11 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `ttable_test` ( + `id` int(10) unsigned NOT NULL auto_increment, + `field1` varchar(60) NOT NULL default '', + `field2` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE `tusuario` ADD COLUMN `test_nuevo` tinyint(1) NOT NULL DEFAULT 0; + +COMMIT; From 03b0b3cb33b8711b275c58aebecb3588853e0862 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 31 Mar 2017 11:39:25 +0200 Subject: [PATCH 56/97] Metaconsole nodes will always sync the agent cache. --- pandora_server/bin/pandora_server | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 3 --- pandora_server/lib/PandoraFMS/Core.pm | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 0730bc4f03..9690791386 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -102,7 +102,7 @@ sub pandora_startup () { $Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]); # Update the agent cache. - enterprise_hook('update_agent_cache', [\%Config, $DBH]) if ($Config{'metaconsole_agent_cache'} == 1); + enterprise_hook('update_agent_cache', [\%Config, $DBH]) if ($Config{'node_metaconsole'} == 1); pandora_audit (\%Config, 'Pandora FMS Server Daemon starting', 'SYSTEM', 'System', $DBH); diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 8bd0145d0d..c22e6ab5a4 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -160,9 +160,6 @@ sub pandora_get_sharedconfig ($$) { # Pandora FMS Console's attachment directory $pa_config->{"attachment_dir"} = pandora_get_tconfig_token ($dbh, 'attachment_store', '/var/www/pandora_console/attachment'); - # Metaconsole agent cache. - $pa_config->{"metaconsole_agent_cache"} = pandora_get_tconfig_token ($dbh, 'metaconsole_agent_cache', 0); - #Limit of events replicate in metaconsole $pa_config->{'replication_limit'} = pandora_get_tconfig_token ($dbh, 'replication_limit', 1000); $pa_config->{'include_agents'} = pandora_get_tconfig_token ($dbh, 'include_agents', 0); diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f66f968d02..6ccaece0c0 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4994,7 +4994,7 @@ sub pandora_update_agent_module_count ($$$) { ') WHERE id_agente = ' . $agent_id); # Sync the agent cache every time the module count is updated. - enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'metaconsole_agent_cache'} == 1); + enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'node_metaconsole'} == 1); } ########################################################################## @@ -5008,7 +5008,7 @@ sub pandora_update_agent_alert_count ($$$) { ') WHERE id_agente = ' . $agent_id); # Sync the agent cache every time the module count is updated. - enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'metaconsole_agent_cache'} == 1); + enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'node_metaconsole'} == 1); } ######################################################################## From 5f29a8f8315c6b0fce681e76d3695dc615d67d92 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 31 Mar 2017 13:18:28 +0200 Subject: [PATCH 57/97] Added visual changes to module nodes in networkmap and added a new option to change the node name --- .../include/functions_pandora_networkmap.php | 7 +++ .../functions_pandora_networkmap.js | 56 +++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 3cd6ca62b3..beaf806953 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -1428,6 +1428,13 @@ if (empty($list_networkmaps)) html_print_image('images/dot_green.png', true) . '' . ''; + $table->data["node_name"][0] = __('Name'); + $table->data["node_name"][1] = html_print_input_text('edit_name_node', + '', __('name node'), '20', '50', true); + $table->data["node_name"][2] = + html_print_button(__('Update node'), '', false, + '', 'class="sub"', true); + $table->data["fictional_node_name"][0] = __('Name'); $table->data["fictional_node_name"][1] = html_print_input_text('edit_name_fictional_node', '', __('name fictional node'), '20', '50', true); diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index d1649f8628..2c31e7baa3 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -218,6 +218,43 @@ function update_fictional_node(id_db_node) { } } +function update_node_name (id_db_node) { + if (enterprise_installed) { + var name = $("input[name='edit_name_node']").val(); + + var params = []; + params.push("update_node_name=1"); + params.push("networkmap_id=" + networkmap_id); + params.push("node_id=" + id_db_node); + params.push("name=" + name); + params.push("page=enterprise/operation/agentes/pandora_networkmap.view"); + + jQuery.ajax ({ + data: params.join ("&"), + dataType: 'json', + type: 'POST', + url: action="ajax.php", + success: function (data) { + if (data['correct']) { + $("#dialog_node_edit").dialog("close"); + + jQuery.each(graph.nodes, function(i, element) { + if (element.id_db == id_db_node) { + graph.nodes[i].text = name; + + $("#id_node_" + i + networkmap_id + " title").html(name); + $("#id_node_" + i + networkmap_id + " tspan").html(name); + } + }); + + draw_elements_graph(); + set_positions_graph(); + } + } + }); + } +} + function change_shape(id_db_node) { if (enterprise_installed) { var shape = $("select[name='shape']").val(); @@ -623,6 +660,9 @@ function edit_node(data, dblClick) { "javascript: change_shape(" + data.id_db + ");"); $("#node_options-fictional_node_update_button-1 input") .attr("onclick", "update_fictional_node(" + data.id_db + ");"); + + $("#node_options-node_name-2 input") + .attr("onclick", "update_node_name(" + data.id_db + ");"); $("#node_details-0-1").html('' + data["text"] + ''); var params = []; @@ -691,7 +731,7 @@ function edit_node(data, dblClick) { dialog_node_edit_title.replace("%s", data.text)); $("#dialog_node_edit").dialog("open"); - if (data.id_agent == -2) { + if (data.id_agent == undefined || data.id_agent == -2) { //Fictional node $("#node_options-fictional_node_name") .css("display", ""); @@ -703,14 +743,22 @@ function edit_node(data, dblClick) { .val(data.networkmap_id); $("#node_options-fictional_node_update_button") .css("display", ""); + $("#node_options-node_name") + .css("display", "none"); + $("#node_options-node_update_button") + .css("display", "none"); } else { + $("input[name='edit_name_node']") + .val(data.text); $("#node_options-fictional_node_name") .css("display", "none"); $("#node_options-fictional_node_networkmap_link") .css("display", "none"); $("#node_options-fictional_node_update_button") .css("display", "none"); + $("#node_options-node_name") + .css("display", ""); } //Clean @@ -2425,7 +2473,7 @@ function init_graph(parameter_object) { if (typeof(parameter_object.node_radius) != "undefined") { window.node_radius = parameter_object.node_radius; } - window.interface_radius = 5; + window.interface_radius = 3; window.disabled_drag_zoom = false; window.key_multiple_selection = 17; //CTRL key window.flag_multiple_selection = false; @@ -2644,7 +2692,7 @@ function init_graph(parameter_object) { .attr("markerHeight", (node_radius / 2) + interface_radius) .attr("orient", "auto") .append("circle") - .attr("cx", (node_radius / 2) - (interface_radius / 2)) + .attr("cx", (node_radius / 2.3) - (interface_radius / 2.3)) .attr("cy", interface_radius) .attr("r", interface_radius) .attr("style", function(d) { @@ -2656,7 +2704,7 @@ function init_graph(parameter_object) { .enter() .append("marker") .attr("id", function(d) { return "interface_end_" + d.status_code; }) - .attr("refX", (node_radius / 2) + (interface_radius / 2)) + .attr("refX", (node_radius / 2.3) + (interface_radius / 2.3)) .attr("refY", interface_radius) .attr("markerWidth", (node_radius / 2) + interface_radius) .attr("markerHeight", (node_radius / 2) + interface_radius) From 3d89007adb53c1e08ade06d3b2ad634b88fe01a9 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 31 Mar 2017 14:16:52 +0200 Subject: [PATCH 58/97] Reposition of footer after load ajax elements in networkmap dialog - #112 --- .../functions_pandora_networkmap.js | 4 +++ .../agentes/pandora_networkmap.view.php | 25 +++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index d1649f8628..254516c590 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -642,6 +642,10 @@ function edit_node(data, dblClick) { $("#node_details-1-1").html(adressess); $("#node_details-2-1").html(data["os"]); $("#node_details-3-1").html(data["group"]); + }, + success: function(){ + $('[aria-describedby=dialog_node_edit]').css({'top':'200px'}); + $('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'}); } }); diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 4896ad2e64..5b34ee442c 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -762,15 +762,24 @@ else { \ No newline at end of file From 1121f8ffc5c767e074ea6b2e7980692171bc4976 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 1 Apr 2017 00:01:18 +0200 Subject: [PATCH 59/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5bd64c5423..6a35faba3c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170331 +Version: 7.0NG-170401 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 caa361c43b..38fd94a3f8 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-170331" +pandora_version="7.0NG-170401" 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 efab1e3a40..f7478250c3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170331'; +use constant AGENT_BUILD => '170401'; # 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 61a71a0456..0674025cef 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 -%define release 170331 +%define release 170401 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 a6200e5cb7..83ace27f3a 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 -%define release 170331 +%define release 170401 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 26e9d85634..a48a6e6ca6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170331" +PI_BUILD="170401" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 017b7ee304..316452ed3f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170331} +{170401} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 967411f0da..0682391321 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(Build 170331)") +#define PANDORA_VERSION ("7.0NG(Build 170401)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5a175689c1..5ce0f47af5 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(Build 170331))" + VALUE "ProductVersion", "(7.0NG(Build 170401))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fc1395f622..88aa0c029a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170331 +Version: 7.0NG-170401 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 dfa5464601..344579b95f 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-170331" +pandora_version="7.0NG-170401" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6bcc31f39a..2380492b47 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 = 'PC170331'; +$build_version = 'PC170401'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7e280015de..059d1b2e51 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Sun, 2 Apr 2017 00:01:18 +0200 Subject: [PATCH 60/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6a35faba3c..5602700bab 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170401 +Version: 7.0NG-170402 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 38fd94a3f8..76bff9fced 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-170401" +pandora_version="7.0NG-170402" 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 f7478250c3..b126c6a93b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170401'; +use constant AGENT_BUILD => '170402'; # 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 0674025cef..c6bb0b5c1b 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 -%define release 170401 +%define release 170402 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 83ace27f3a..b310fe9456 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 -%define release 170401 +%define release 170402 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 a48a6e6ca6..6db093615f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170401" +PI_BUILD="170402" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 316452ed3f..a20b7237cd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170401} +{170402} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0682391321..2ff0df726c 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(Build 170401)") +#define PANDORA_VERSION ("7.0NG(Build 170402)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5ce0f47af5..f0319cf1dd 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(Build 170401))" + VALUE "ProductVersion", "(7.0NG(Build 170402))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 88aa0c029a..0938ccaaea 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170401 +Version: 7.0NG-170402 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 344579b95f..8d0d9c6791 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-170401" +pandora_version="7.0NG-170402" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2380492b47..6430ce1bdf 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 = 'PC170401'; +$build_version = 'PC170402'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 059d1b2e51..d2417b57e7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Mon, 3 Apr 2017 00:01:17 +0200 Subject: [PATCH 61/97] 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/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 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5602700bab..c8eca462a2 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG-170402 +Version: 7.0NG-170403 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 76bff9fced..54daf6406a 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-170402" +pandora_version="7.0NG-170403" 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 b126c6a93b..803bd14d74 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG'; -use constant AGENT_BUILD => '170402'; +use constant AGENT_BUILD => '170403'; # 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 c6bb0b5c1b..fc56fd2f13 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 -%define release 170402 +%define release 170403 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 b310fe9456..e2afb1b83b 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 -%define release 170402 +%define release 170403 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 6db093615f..4bdf56612e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG" -PI_BUILD="170402" +PI_BUILD="170403" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a20b7237cd..e829719a13 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170402} +{170403} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2ff0df726c..bbce685cd8 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(Build 170402)") +#define PANDORA_VERSION ("7.0NG(Build 170403)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f0319cf1dd..23bd218004 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(Build 170402))" + VALUE "ProductVersion", "(7.0NG(Build 170403))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 0938ccaaea..4201aeb200 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG-170402 +Version: 7.0NG-170403 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 8d0d9c6791..c100fb431b 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-170402" +pandora_version="7.0NG-170403" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6430ce1bdf..7fde07efaa 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 = 'PC170402'; +$build_version = 'PC170403'; $pandora_version = 'v7.0NG'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d2417b57e7..da71710d23 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
Date: Mon, 3 Apr 2017 14:20:11 +0200 Subject: [PATCH 62/97] Added time improvements to networkmaps --- .../include/functions_pandora_networkmap.php | 3 - .../functions_pandora_networkmap.js | 337 +++++++++--------- 2 files changed, 167 insertions(+), 173 deletions(-) diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index beaf806953..a0897f0602 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -1335,7 +1335,6 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations = //////////////////////////////////////////////////////////////////////// $(document).ready(function() { init_graph({ - refesh_period: networkmap_refresh_time, graph: networkmap, networkmap_center: networkmap_center, networkmap_dimensions: networkmap_dimensions, @@ -1348,8 +1347,6 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations = init_minimap(); function_open_minimap(); - window.interval_obj = setInterval(update_networkmap, networkmap_refresh_time); - $(document.body).on("mouseleave", ".context-menu-list", function(e) { diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 767e637fa2..86ab6bd914 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -618,7 +618,7 @@ function add_new_link (new_link) { graph.links.push(new_link); } -function edit_node(data, dblClick) { +function edit_node(data_node, dblClick) { if (enterprise_installed) { var flag_edit_node = true; var edit_node = null @@ -633,7 +633,7 @@ function edit_node(data, dblClick) { edit_node = selection[0].pop(); } else if (dblClick){ - edit_node = d3.select("#id_node_" + data['id'] + networkmap_id); + edit_node = d3.select("#id_node_" + data_node['id'] + networkmap_id); edit_node = edit_node[0][0]; } else { @@ -654,21 +654,22 @@ function edit_node(data, dblClick) { selected_links = get_relations(node_selected); - $("select[name='shape'] option[value='" + data.shape + "']") + $("select[name='shape'] option[value='" + node_selected.shape + "']") .prop("selected", true); $("select[name='shape']").attr("onchange", - "javascript: change_shape(" + data.id_db + ");"); + "javascript: change_shape(" + node_selected.id_db + ");"); $("#node_options-fictional_node_update_button-1 input") - .attr("onclick", "update_fictional_node(" + data.id_db + ");"); + .attr("onclick", "update_fictional_node(" + node_selected.id_db + ");"); $("#node_options-node_name-2 input") - .attr("onclick", "update_node_name(" + data.id_db + ");"); + .attr("onclick", "update_node_name(" + node_selected.id_db + ");"); - $("#node_details-0-1").html('' + data["text"] + ''); + $("#node_details-0-1").html('' + node_selected["text"] + ''); var params = []; params.push("get_agent_info=1"); - params.push("id_agent=" + data["id_agent"]); + params.push("id_agent=" + node_selected["id_agent"]); params.push("page=enterprise/operation/agentes/pandora_networkmap.view"); + jQuery.ajax ({ data: params.join ("&"), dataType: 'json', @@ -682,69 +683,29 @@ function edit_node(data, dblClick) { $("#node_details-1-1").html(adressess); $("#node_details-2-1").html(data["os"]); $("#node_details-3-1").html(data["group"]); - }, - success: function(){ + $('[aria-describedby=dialog_node_edit]').css({'top':'200px'}); $('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'}); - } - }); - - $("#interface_information").find("tr:gt(0)").remove(); - - var params = []; - params.push("get_interface_info=1"); - params.push("id_agent=" + data["id_agent"]); - params.push("page=enterprise/operation/agentes/pandora_networkmap.view"); - jQuery.ajax ({ - data: params.join ("&"), - dataType: 'json', - type: 'POST', - url: action="ajax.php", - success: function (data) { - if (data.length == 0) { - $("#interface_information").find('tbody') - .append($('').html("

It has no interface to display

")); - } - else { - jQuery.each(data, function(j, interface) { - $("#interface_information").find('tbody') - .append($('') - .append($('') - .html(interface['name']) - ) - .append($('') - .html(interface['status']) - ) - .append($('') - .html(interface['graph']) - ) - .append($('') - .html(interface['ip']) - ) - .append($('') - .html(interface['mac']) - ) - ); - }); - } + + get_interface_data_to_table(node_selected, selected_links); } }); $("#dialog_node_edit" ) .dialog( "option", "title", - dialog_node_edit_title.replace("%s", data.text)); + dialog_node_edit_title.replace("%s", node_selected.text)); $("#dialog_node_edit").dialog("open"); - if (data.id_agent == undefined || data.id_agent == -2) { + if (node_selected.id_agent == undefined || node_selected.id_agent == -2) { //Fictional node $("#node_options-fictional_node_name") .css("display", ""); $("input[name='edit_name_fictional_node']") - .val(data.text); + .val(node_selected.text); $("#node_options-fictional_node_networkmap_link") .css("display", ""); $("#edit_networkmap_to_link") - .val(data.networkmap_id); + .val(node_selected.networkmap_id); $("#node_options-fictional_node_update_button") .css("display", ""); $("#node_options-node_name") @@ -754,7 +715,7 @@ function edit_node(data, dblClick) { } else { $("input[name='edit_name_node']") - .val(data.text); + .val(node_selected.text); $("#node_options-fictional_node_name") .css("display", "none"); $("#node_options-fictional_node_networkmap_link") @@ -770,124 +731,160 @@ function edit_node(data, dblClick) { //Show the no relations $("#relations_table-loading").css('display', 'none'); $("#relations_table-no_relations").css('display', ''); - - - jQuery.each(selected_links, function(i, link_each) { - - $("#relations_table-no_relations").css('display', 'none'); - $("#relations_table-loading").css('display', ''); - - var template_relation_row = $("#relations_table-template_row") - .clone(); - - $(template_relation_row).css('display', ''); - $(template_relation_row).attr('class', 'relation_link_row'); - - $("select[name='interface_source']", template_relation_row) - .attr('name', "interface_source_" + i) - .attr('id', "interface_source_" + i); - $("select[name='interface_target']", template_relation_row) - .attr('name', "interface_target_" + i) - .attr('id', "interface_target_" + i); - $(".edit_icon_progress", template_relation_row) - .attr('class', "edit_icon_progress_" + i); - $(".edit_icon", template_relation_row) - .attr('class', "edit_icon_" + i); - $(".edit_icon_correct", template_relation_row) - .attr('class', "edit_icon_correct_" + i); - $(".edit_icon_fail", template_relation_row) - .attr('class', "edit_icon_fail_" + i); - $(".edit_icon_link", template_relation_row) - .attr('class', "edit_icon_link_" + i) - .click(function() { - update_link(i, link_each.id_db); - } - ); - - var params = []; - params.push("get_intefaces=1"); - params.push("id_agent=" + link_each.source.id_agent); - params.push("page=enterprise/operation/agentes/pandora_networkmap.view"); - - jQuery.ajax ({ - data: params.join ("&"), - dataType: 'json', - type: 'POST', - url: action="ajax.php", - success: function (data) { - if (data['correct']) { - $("select[name='interface_source_" + i + "']", template_relation_row).empty(); - $("select[name='interface_source_" + i + "']", template_relation_row).append(''); - jQuery.each(data['interfaces'], function(j, interface) { - - $("select[name='interface_source_" + i + "']", template_relation_row) - .append($("'); - jQuery.each(data['interfaces'], function(j, interface) { - $("select[name='interface_target_" + i + "']", template_relation_row) - .append($("'); + + $("select[name='interface_source_" + i + "']", template_relation_row).empty(); + $("select[name='interface_source_" + i + "']", template_relation_row).append(''); + jQuery.each(data['target_interfaces'], function(j, interface) { + $("select[name='interface_target_" + i + "']", template_relation_row) + .append($("