From 8eb3a982e1f785ed4e22aac3c8398391004ccf1a Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 1 Jun 2020 14:48:53 +0200 Subject: [PATCH 001/117] Fixed error in gauges --- pandora_console/include/chart_generator.php | 1 + pandora_console/include/functions_graph.php | 9 +++++- pandora_console/include/graphs/fgraph.php | 6 ++-- .../include/graphs/functions_d3.php | 5 +-- pandora_console/include/graphs/pandora.d3.js | 32 +++++++++++-------- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index edd8208b05..7a61677b85 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -189,6 +189,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) { echo '
'; switch ($type_graph_pdf) { case 'combined': + $params['pdf'] = true; echo graphic_combined_module( $module_list, $params, diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5a1d482e1d..1f45714edb 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2003,6 +2003,12 @@ function graphic_combined_module( } } + if (isset($params['pdf']) === true && $params['pdf'] === true) { + $transitionDuration = 0; + } else { + $transitionDuration = 500; + } + $output = stacked_gauge( $graph_values, $new_width, @@ -2018,7 +2024,8 @@ function graphic_combined_module( $config['fontpath'], $fixed_font_size, '', - $homeurl + $homeurl, + $transitionDuration ); break; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 1d79129610..6f341381c5 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -638,7 +638,8 @@ function stacked_gauge( $font='', $font_size='', $unit='', - $homeurl='' + $homeurl='', + $transitionDuration=500 ) { include_once 'functions_d3.php'; @@ -656,7 +657,8 @@ function stacked_gauge( $unit, $font, ($font_size + 2), - $no_data_image + $no_data_image, + $transitionDuration ); } diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php index 659270744a..8719531abc 100644 --- a/pandora_console/include/graphs/functions_d3.php +++ b/pandora_console/include/graphs/functions_d3.php @@ -294,7 +294,8 @@ function d3_gauges( $unit, $font, $font_size, - $no_data_image + $no_data_image, + $transitionDuration ) { global $config; @@ -310,7 +311,7 @@ function d3_gauges( $output .= ""; return $output; diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index bfebebe99c..d308514ce3 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -1005,7 +1005,8 @@ function createGauge( critical_inverse, font_size, height, - font + font, + transitionDuration ) { var gauges; @@ -1014,7 +1015,8 @@ function createGauge( label: etiqueta, min: undefined != min ? min : 0, max: undefined != max ? max : 100, - font_size: font_size + font_size: font_size, + transitionDuration: transitionDuration }; if (value == null) { @@ -1128,7 +1130,7 @@ function createGauge( gauges = new Gauge(name, config, font); gauges.render(); - gauges.redraw(value); + gauges.redraw(value, config.transitionDuration); $(".gauge>text").each(function() { label = $(this).text(); @@ -1155,12 +1157,17 @@ function createGauge( $(this).text(text); } }); - config = false; - max_warning2 = false; - min_warning2 = false; } -function createGauges(data, width, height, font_size, no_data_image, font) { +function createGauges( + data, + width, + height, + font_size, + no_data_image, + font, + transitionDuration +) { var nombre, label, minimun_warning, @@ -1211,7 +1218,8 @@ function createGauges(data, width, height, font_size, no_data_image, font) { critical_inverse, font_size, height, - font + font, + transitionDuration ); } } @@ -1247,7 +1255,7 @@ function Gauge(placeholderName, configuration, font) { this.config.yellowColor = configuration.yellowColor || "#FF9900"; this.config.redColor = configuration.redColor || "#DC3912"; - this.config.transitionDuration = configuration.transitionDuration || 500; + this.config.transitionDuration = configuration.transitionDuration; }; this.render = function() { @@ -1481,11 +1489,7 @@ function Gauge(placeholderName, configuration, font) { var pointer = pointerContainer.selectAll("path"); pointer .transition() - .duration( - undefined != transitionDuration - ? transitionDuration - : this.config.transitionDuration - ) + .duration(undefined != transitionDuration ? transitionDuration : 0) //.delay(0) //.ease("linear") //.attr("transform", function(d) From 4493e8452921f040e431dab21d94a18a54247ca7 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 2 Jun 2020 09:48:59 +0200 Subject: [PATCH 002/117] fixed image not found --- pandora_console/general/mysqlerr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/general/mysqlerr.php b/pandora_console/general/mysqlerr.php index 67d38c56f8..79e6372c33 100644 --- a/pandora_console/general/mysqlerr.php +++ b/pandora_console/general/mysqlerr.php @@ -106,7 +106,7 @@ img.modalclose { - images/icono_cerrar.png'> + /images/icono_cerrar.png'>
From 7676852bd0ea3ca27b434dde9d3ed67f14a34c52 Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 2 Jun 2020 17:26:43 +0200 Subject: [PATCH 003/117] set event in progress on api --- pandora_console/include/functions_api.php | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 76e10533aa..82538fa1ee 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -16021,3 +16021,49 @@ function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType) return; } } + + +/** + * Function to set events in progress status. + * + * @param [int] $event_id Id event (Node or Meta). + * @param [int] $server_id Id node event in tmetaconsole_event. + * @param [string] $trash2 don't use. + * @param [string] $returnType + * + * Example + * http://172.17.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora + * + * @return void + */ +function api_set_event_in_progress($event_id, $server_id, $trash2, $returnType) +{ + global $config; + + if (is_metaconsole()) { + $event = db_process_sql_update( + 'tmetaconsole_event', + ['estado' => 2], + [ + 'id_source_event' => $event_id, + 'server_id' => $server_id, + ] + ); + if ($event !== false) { + returnData($returnType, ['type' => 'string', 'data' => $event]); + } else { + returnError('id_not_found', 'string'); + } + } else { + $event = db_process_sql_update( + 'tevento', + ['estado' => 2], + ['id_evento' => $event_id] + ); + if ($event !== false) { + returnData($returnType, ['type' => 'string', 'data' => $event]); + } else { + returnError('id_not_found', 'string'); + } + } +} From e270776a01011015ccdca34de347a6a9e95ce27d Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 3 Jun 2020 15:56:19 +0200 Subject: [PATCH 004/117] create new api/cli function to set event on progress --- pandora_console/include/functions_api.php | 8 ++++---- pandora_server/util/pandora_manage.pl | 24 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 82538fa1ee..f5fb12ee1d 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -16027,12 +16027,12 @@ function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType) * Function to set events in progress status. * * @param [int] $event_id Id event (Node or Meta). - * @param [int] $server_id Id node event in tmetaconsole_event. + * @param [int] $server_id Id node event in tmetaconsole_event (optional). * @param [string] $trash2 don't use. * @param [string] $returnType * * Example - * http://172.17.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora + * http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora * * @return void */ @@ -16045,8 +16045,8 @@ function api_set_event_in_progress($event_id, $server_id, $trash2, $returnType) 'tmetaconsole_event', ['estado' => 2], [ - 'id_source_event' => $event_id, - 'server_id' => $server_id, + 'server_id' => $server_id, + 'id_evento' => $event_id, ] ); if ($event !== false) { diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 839d937db3..ee7ea1586b 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -243,6 +243,8 @@ sub help_screen{ help_screen_line('--duplicate_visual_console', ' []', 'Duplicate a visual console'); help_screen_line('--export_json_visual_console', ' [] []', 'Creates a json with the visual console elements information'); + print "\nEVENTS\n\n" unless $param ne ''; + help_screen_line('--event_in_progress', ' ', 'Set event in progress'); print "\n"; exit; @@ -254,7 +256,7 @@ sub help_screen{ sub api_call($$$;$$$$) { my ($pa_config, $op, $op2, $id, $id2, $other, $return_type) = @_; my $content = undef; - + eval { # Set the parameters for the POST request. my $params = {}; @@ -7676,6 +7678,9 @@ sub pandora_manage_main ($$$) { elsif ($param eq '--reset_agent_counts') { param_check($ltotal, 1, 0); cli_reset_agent_counts(); + }elsif ($param eq '--event_in_progress') { + param_check($ltotal, 2, 0); + cli_event_in_progress(); } else { print_log "[ERROR] Invalid option '$param'.\n\n"; @@ -8325,3 +8330,20 @@ sub cli_reset_agent_counts() { print "$result \n\n "; } + + +############################################################################## +# Set an event in progress. +# Related option: --event_in_progress +############################################################################## + +sub cli_event_in_progress() { + my ($event_id, $server_id) = @ARGV[2..3]; + + # Call the API. + my $result = api_call( + $conf, 'set', 'event_in_progress', $event_id, $server_id + ); + + print "\n$result\n"; +} \ No newline at end of file From 165e3663a62dfac640784d8f770bd600cf6e84a2 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 3 Jun 2020 16:23:01 +0200 Subject: [PATCH 005/117] fixed error --- pandora_console/operation/search_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php index 718fd45be5..b28da67611 100644 --- a/pandora_console/operation/search_main.php +++ b/pandora_console/operation/search_main.php @@ -23,7 +23,7 @@ $searchUsers = check_acl($config['id_user'], 0, 'UM'); $searchPolicies = check_acl($config['id_user'], 0, 'AW'); $searchHelps = true; -echo '
'; +echo '
'; $anyfound = false; From 4904718c414aa961778017af198e47c29476556e Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 4 Jun 2020 11:08:51 +0200 Subject: [PATCH 006/117] add confirm dialog when delete one item in events table --- .../include/javascript/pandora_events.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index e176b863ad..c9af47ed2b 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -712,7 +712,7 @@ function update_event(table, id_evento, type, event_rep, row) { values[this.name] = $(this).val(); }); var t1 = new Date(); - + console.log("al ajax directo"); // Update events matching current filters and id_evento selected. $.ajax({ async: true, @@ -791,10 +791,25 @@ function delete_event(table, id_evento, event_rep, row) { processed += 1; return; } - - button.children[0]; - button.children[0].src = "images/spinner.gif"; - return update_event(table, id_evento, { delete_event: 1 }, event_rep, row); + confirmDialog({ + title: "ATTENTION", + message: + "

Are you sure?

", + cancel: "Cancel", + ok: "Ok", + onAccept: function() { + // Continue execution. + button.children[0]; + button.children[0].src = "images/spinner.gif"; + return update_event( + table, + id_evento, + { delete_event: 1 }, + event_rep, + row + ); + } + }); } // Imported from old files. From 67d5a2834646bfbcd5582590a0646d93dc563cff Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 4 Jun 2020 13:50:36 +0200 Subject: [PATCH 007/117] add confirm dialog on meta and node recursive --- .../include/javascript/pandora_events.js | 245 ++++++++++-------- 1 file changed, 140 insertions(+), 105 deletions(-) diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index c9af47ed2b..ddd2f42578 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -712,8 +712,7 @@ function update_event(table, id_evento, type, event_rep, row) { values[this.name] = $(this).val(); }); var t1 = new Date(); - console.log("al ajax directo"); - // Update events matching current filters and id_evento selected. + $.ajax({ async: true, type: "POST", @@ -751,6 +750,7 @@ function update_event(table, id_evento, type, event_rep, row) { } }); } +// Update events matching current filters and id_evento selected. function validate_event(table, id_evento, event_rep, row) { var button = document.getElementById("val-" + id_evento); @@ -791,14 +791,16 @@ function delete_event(table, id_evento, event_rep, row) { processed += 1; return; } + button.children[0]; + button.children[0].src = "images/spinner.gif"; + var message = + "

Are you sure?

"; confirmDialog({ title: "ATTENTION", - message: - "

Are you sure?

", + message: message, cancel: "Cancel", ok: "Ok", onAccept: function() { - // Continue execution. button.children[0]; button.children[0].src = "images/spinner.gif"; return update_event( @@ -808,116 +810,149 @@ function delete_event(table, id_evento, event_rep, row) { event_rep, row ); + }, + onDeny: function() { + button.children[0]; + button.children[0].src = "images/cross.png"; + return; } }); } -// Imported from old files. -function execute_event_response(event_list_btn) { - processed = 0; - $("#max_custom_event_resp_msg").hide(); - $("#max_custom_selected").hide(); - - var response_id = $("select[name=response_id]").val(); - - var total_checked = $(".chk_val:checked").length; - - // Check select an event. - if (total_checked == 0) { - $("#max_custom_selected").show(); +function execute_delete_event_reponse(table, id_evento, event_rep, row) { + var button = document.getElementById("del-" + id_evento); + if (!button) { + // Button does not exist. Ignore. + processed += 1; return; } + button.children[0]; + button.children[0].src = "images/spinner.gif"; + return update_event(table, id_evento, { delete_event: 1 }, event_rep, row); +} - if (!isNaN(response_id)) { - // It is a custom response - var response = get_response(response_id); +// Imported from old files. +function execute_event_response(event_list_btn) { + var message = + "

Are you sure?

"; + confirmDialog({ + title: "ATTENTION", + message: message, + cancel: "Cancel", + ok: "Ok", + onAccept: function() { + // Continue execution. + processed = 0; + $("#max_custom_event_resp_msg").hide(); + $("#max_custom_selected").hide(); - // If cannot get response abort it - if (response == null) { + var response_id = $("select[name=response_id]").val(); + + var total_checked = $(".chk_val:checked").length; + + // Check select an event. + if (total_checked == 0) { + $("#max_custom_selected").show(); + return; + } + + if (!isNaN(response_id)) { + // It is a custom response + var response = get_response(response_id); + + // If cannot get response abort it + if (response == null) { + return; + } + + // Limit number of events to apply custom responses + // due performance reasons. + if (total_checked > $("#max_execution_event_response").val()) { + $("#max_custom_event_resp_msg").show(); + return; + } + + var response_command = []; + $(".response_command_input").each(function() { + response_command[$(this).attr("name")] = $(this).val(); + }); + + if (event_list_btn) { + $("#button-submit_event_response").hide(function() { + $("#response_loading_dialog").show(function() { + var check_params = get_response_params(response_id); + + if (check_params[0] !== "") { + show_event_response_command_dialog( + response_id, + response, + total_checked + ); + } else { + check_massive_response_event( + response_id, + response, + total_checked, + response_command + ); + } + }); + }); + } else { + $("#button-btn_str").hide(function() { + $("#execute_again_loading").show(function() { + check_massive_response_event( + response_id, + response, + total_checked, + response_command + ); + }); + }); + } + } else { + // It is not a custom response + switch (response_id) { + case "in_progress_selected": + $(".chk_val:checked").each(function() { + // Parent: TD. GrandParent: TR. + in_process_event( + dt_events, + $(this).val(), + $(this).attr("event_rep"), + this.parentElement.parentElement + ); + }); + break; + case "validate_selected": + $(".chk_val:checked").each(function() { + validate_event( + dt_events, + $(this).val(), + $(this).attr("event_rep"), + this.parentElement.parentElement + ); + }); + break; + case "delete_selected": + console.log($(this)); + $(".chk_val:checked").each(function() { + execute_delete_event_reponse( + dt_events, + $(this).val(), + $(this).attr("event_rep"), + this.parentElement.parentElement + ); + }); + break; + } + } + }, + onDeny: function() { + processed += 1; return; } - - // Limit number of events to apply custom responses - // due performance reasons. - if (total_checked > $("#max_execution_event_response").val()) { - $("#max_custom_event_resp_msg").show(); - return; - } - - var response_command = []; - $(".response_command_input").each(function() { - response_command[$(this).attr("name")] = $(this).val(); - }); - - if (event_list_btn) { - $("#button-submit_event_response").hide(function() { - $("#response_loading_dialog").show(function() { - var check_params = get_response_params(response_id); - - if (check_params[0] !== "") { - show_event_response_command_dialog( - response_id, - response, - total_checked - ); - } else { - check_massive_response_event( - response_id, - response, - total_checked, - response_command - ); - } - }); - }); - } else { - $("#button-btn_str").hide(function() { - $("#execute_again_loading").show(function() { - check_massive_response_event( - response_id, - response, - total_checked, - response_command - ); - }); - }); - } - } else { - // It is not a custom response - switch (response_id) { - case "in_progress_selected": - $(".chk_val:checked").each(function() { - // Parent: TD. GrandParent: TR. - in_process_event( - dt_events, - $(this).val(), - $(this).attr("event_rep"), - this.parentElement.parentElement - ); - }); - break; - case "validate_selected": - $(".chk_val:checked").each(function() { - validate_event( - dt_events, - $(this).val(), - $(this).attr("event_rep"), - this.parentElement.parentElement - ); - }); - break; - case "delete_selected": - $(".chk_val:checked").each(function() { - delete_event( - dt_events, - $(this).val(), - $(this).attr("event_rep"), - this.parentElement.parentElement - ); - }); - break; - } - } + }); } function check_massive_response_event( From 07593e446625cb2e5069a6ab31aee09ecbc2139f Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 4 Jun 2020 14:00:30 +0200 Subject: [PATCH 008/117] fixed code --- pandora_console/include/javascript/pandora_events.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index ddd2f42578..a5e5b0c36e 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -791,8 +791,6 @@ function delete_event(table, id_evento, event_rep, row) { processed += 1; return; } - button.children[0]; - button.children[0].src = "images/spinner.gif"; var message = "

Are you sure?

"; confirmDialog({ From 6690bfdad854c51cf687373bbbf23a715c540e06 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 4 Jun 2020 21:07:53 +0200 Subject: [PATCH 009/117] Blocked create and update of remote component group when meta has centralized management --- .../godmode/modules/manage_nc_groups.php | 55 ++++++++++++------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index 16a9cccaad..c4ba21febc 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -46,14 +46,15 @@ if (defined('METACONSOLE')) { $sec = 'gmodules'; } - -$create = (bool) get_parameter('create'); -$update = (bool) get_parameter('update'); -$delete = (bool) get_parameter('delete'); -$new = (bool) get_parameter('new'); -$id = (int) get_parameter('id'); -$multiple_delete = (bool) get_parameter('multiple_delete', 0); -$pure = get_parameter('pure', 0); +if (is_management_allowed() === true) { + $create = (bool) get_parameter('create'); + $update = (bool) get_parameter('update'); + $delete = (bool) get_parameter('delete'); + $new = (bool) get_parameter('new'); + $id = (int) get_parameter('id'); + $multiple_delete = (bool) get_parameter('multiple_delete', 0); + $pure = get_parameter('pure', 0); +} if ($create) { $name = (string) get_parameter('name'); @@ -186,7 +187,7 @@ if ($multiple_delete) { ); } -if (($id || $new) && !$delete && !$multiple_delete) { +if (($id || $new) && !$delete && !$multiple_delete && is_management_allowed() === true) { include_once 'manage_nc_groups_form.php'; return; } @@ -229,7 +230,10 @@ $table->class = 'info_table'; $table->head = []; $table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); $table->head[0] = __('Name'); -$table->head[1] = __('Action'); +if (is_management_allowed() === true) { + $table->head[1] = __('Action'); +} + $table->style = []; $table->style[0] = 'font-weight: bold'; $table->align = []; @@ -258,31 +262,42 @@ foreach ($groups as $group) { } $table->cellclass[][1] = 'action_buttons'; - $data[1] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''; + } array_push($table->data, $data); } +if (is_management_allowed() === false) { + ui_print_warning_message(__('This node is configured with centralized mode. This page is for read only. Go to metaconsole to manage the component groups.')); +} + if (isset($data)) { echo "
"; html_print_input_hidden('multiple_delete', 1); html_print_table($table); - echo "
"; - html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); - echo '
'; + if (is_management_allowed() === true) { + echo "
"; + html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); + echo '
'; + } + echo '
'; } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined component groups') ]); } +if (is_management_allowed() === true) { + echo '
'; + echo '
'; + html_print_input_hidden('new', 1); + html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); + echo '
'; + echo '
'; +} -echo '
'; -echo '
'; -html_print_input_hidden('new', 1); -html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); -echo '
'; -echo '
'; enterprise_hook('close_meta_frame'); ?> From 44b2c59572f7aa63edecd8c1c68390c74e5e178c Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Fri, 5 Jun 2020 11:01:00 +0200 Subject: [PATCH 010/117] Fixed error link builder in VC --- pandora_console/godmode/reporting/map_builder.php | 6 ------ .../godmode/reporting/visual_console_favorite.php | 7 ------- 2 files changed, 13 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 1a17896383..75aaa35d2d 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -71,12 +71,6 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) { 'active' => false, 'text' => ''.html_print_image('images/wand.png', true, ['title' => __('Visual Console Template Wizard')]).'', ]; - if ($is_metaconsole) { - $buttons['visual_console_manager'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/builder.png', true, ['title' => __('Visual Console Manager')]).'', - ]; - } } if (!$is_metaconsole) { diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index 201fdab148..b9f4fe28d7 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -64,13 +64,6 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) { 'active' => false, 'text' => ''.html_print_image('images/wand.png', true, ['title' => __('Visual Console Template Wizard')]).'', ]; - - if ($is_metaconsole) { - $buttons['visual_console_manager'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/builder.png', true, ['title' => __('Visual Console Manager')]).'', - ]; - } } if (!$is_metaconsole) { From 4e75219371b405175312a5d5c6052a9b02ba0a22 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Fri, 5 Jun 2020 11:09:40 +0200 Subject: [PATCH 011/117] Added missing _id_module_ macro in Plugin server --- pandora_server/lib/PandoraFMS/PluginServer.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index 666ac88c58..4fec47bb14 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -227,6 +227,7 @@ sub data_consumer ($$) { _moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '', _modulestatus_ => undef, _moduletags_ => undef, + _id_module_ => (defined ($module)) ? $module->{'id_agente_modulo'} : '', _id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '', _id_group_ => (defined ($group)) ? $group->{'id_grupo'} : '', _interval_ => (defined ($module) && $module->{'module_interval'} != 0) ? $module->{'module_interval'} : (defined ($agent)) ? $agent->{'intervalo'} : '', From 7c3f30a277355e028255940bb841d963f52b6ab8 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 8 Jun 2020 16:44:09 +0200 Subject: [PATCH 012/117] Get the name of policy in tpolicies --- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 58c990019c..7304344d9a 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1190,7 +1190,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { _server_name_ => (defined ($agent)) ? $agent->{'server_name'} : '', _target_ip_ => (defined ($module)) ? $module->{'ip_target'} : '', _target_port_ => (defined ($module)) ? $module->{'tcp_port'} : '', - _policy_ => undef, + _policy_ => (defined ($module)) ? get_db_value ($dbh, "SELECT name FROM tpolicies WHERE id = ?", $module->{'id_policy_module'}) : '', _plugin_parameters_ => (defined ($module)) ? $module->{'plugin_parameter'} : '', _email_tag_ => undef, _phone_tag_ => undef, From 599445ad4dd7af50b3e3fc7d90979328cd6d6ffa Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 9 Jun 2020 16:05:24 +0200 Subject: [PATCH 013/117] Solved issue with thresholds in prediction modules --- .../godmode/agentes/module_manager_editor_common.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 9948554591..b812e5b8b0 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1290,7 +1290,7 @@ ui_require_jquery_file('json'); + '; + } + // NOTE: jquery.flot.threshold is not te original file. Is patched to allow multiple thresholds and filled area - $output = ' + $output .= ' diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index b7844d9e9a..2495885c98 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -31,7 +31,7 @@ class Tactical $this->correct_acl = false; } - include_javascript_dependencies_flot_graph(); + include_javascript_dependencies_flot_graph(false, true); } From da3a7a98049cace7d7ba3a40697da7697488df95 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 15 Jun 2020 16:43:17 +0200 Subject: [PATCH 021/117] fixed pdf status field --- 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 9a4ed439fa..34e6322639 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2686,7 +2686,7 @@ function reporting_html_agent_configuration( $row['description'] = $module['description']; $row['interval'] = $module['interval']; $row['unit'] = $module['unit']; - $row['status'] = $module['status_icon']; + $row['status'] = ($pdf === 0) ? $module['status_icon'] : $module['status']; $row['tags'] = implode(',', $module['tags']); $table1->data[] = $row; From 65789ff431e70b83c79e94ff5f08c0dd7aeaf4a5 Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 15 Jun 2020 16:57:19 +0200 Subject: [PATCH 022/117] fixed error --- pandora_console/include/functions_html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 98f3d5f581..0b364a6eba 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2808,7 +2808,11 @@ function html_print_table(&$table, $return=false) $style[$key] = ''; } - $output .= ''.$item.''."\n"; + if ($class === 'datos5' && $key === 1) { + $output .= ''.$item.''."\n"; + } else { + $output .= ''.$item.''."\n"; + } } $output .= ''."\n"; From ca281bac18b53b37196587f7c8221fe1dd16978d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 16 Jun 2020 12:44:10 +0200 Subject: [PATCH 023/117] fix default refresh time in visual console public link --- pandora_console/operation/visual_console/legacy_public_view.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/visual_console/legacy_public_view.php b/pandora_console/operation/visual_console/legacy_public_view.php index 4a316eee60..0f2b8876ed 100644 --- a/pandora_console/operation/visual_console/legacy_public_view.php +++ b/pandora_console/operation/visual_console/legacy_public_view.php @@ -57,7 +57,7 @@ if ($myhash != $hash) { exit; } -$refr = (int) get_parameter('refr', 0); +$refr = (int) get_parameter('refr', $config['refr']); $layout = db_get_row('tlayout', 'id', $id_layout); if (! $layout) { From 98b358e7adc2f660bd9e5cb7ef038aa298653f76 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 16 Jun 2020 17:27:53 +0200 Subject: [PATCH 024/117] fix vulnerability --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a5b442d69c..89c4d87f05 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4750,7 +4750,7 @@ function events_page_comments($event, $ajax=false) foreach ($comm as $c) { $data[0] = ''.$c['action'].' by '.$c['id_user'].''; $data[0] .= '

'.date($config['date_format'], $c['utimestamp']).''; - $data[1] = '

'.stripslashes(str_replace(['\n', '\r'], '
', $c['comment'])).'

'; + $data[1] = '

'.strip_tags($c['comment'], '
').'

'; $table_comments->data[] = $data; } break; From eed12be28181d6d818aad0f87cf09628423ba72e Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 17 Jun 2020 13:05:04 +0200 Subject: [PATCH 025/117] Deleted columns s, options and m on csv datatables events --- pandora_console/include/functions_ui.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index c67091f47f..5ce9da555a 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3408,6 +3408,14 @@ function ui_print_datatable(array $parameters) $js .= $parameters['drawCallback']; } + for ($i = 1; $i <= (count($parameters['columns']) - 3); $i++) { + if ($i != (count($parameters['columns']) - 3)) { + $columns .= $i.','; + } else { + $columns .= $i; + } + } + $js .= ' if (dt_'.$table_id.'.page.info().pages > 1) { $("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").show() @@ -3438,7 +3446,8 @@ function ui_print_datatable(array $parameters) order : "current", page : "All", search : "applied" - } + }, + columns: [1,'.$columns.'] } } ], From f3de739a7ce7a98cb79c37a54eb70523279a6643 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 18 Jun 2020 15:30:55 +0200 Subject: [PATCH 026/117] fixed visual error tag meta --- pandora_console/godmode/tag/tag.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/tag/tag.php b/pandora_console/godmode/tag/tag.php index 26fb885a42..3b0bb68650 100644 --- a/pandora_console/godmode/tag/tag.php +++ b/pandora_console/godmode/tag/tag.php @@ -35,6 +35,10 @@ if ($delete != 0 && is_metaconsole()) { open_meta_frame(); } +if ($tag_name != '' && is_metaconsole()) { + open_meta_frame(); +} + // Metaconsole nodes $servers = false; if (is_metaconsole()) { @@ -182,7 +186,7 @@ $row[] = $filter_button; $table->data[] = $row; -$filter_form = '
'; +$filter_form = ''; $filter_form .= html_print_table($table, true); $filter_form .= '
'; // End of filter form From 1b0d40f88ac629634d50771188bd25cccf5ad0e9 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 18 Jun 2020 16:16:37 +0200 Subject: [PATCH 027/117] fixed visual style repsonse buttons --- pandora_console/include/functions_events.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a5b442d69c..6a5fe3c319 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3424,7 +3424,7 @@ function events_page_responses($event, $childrens_ids=[]) 'owner_button', false, 'event_change_owner();', - 'class="sub next"', + 'class="sub next w70p"', true ); @@ -3504,7 +3504,7 @@ function events_page_responses($event, $childrens_ids=[]) 'status_button', false, 'event_change_status(\''.$event['similar_ids'].'\');', - 'class="sub next"', + 'class="sub next w70p"', true ); } @@ -3520,7 +3520,7 @@ function events_page_responses($event, $childrens_ids=[]) 'comment_button', false, '$(\'#link_comments\').trigger(\'click\');', - 'class="sub next"', + 'class="sub next w70p"', true ); @@ -3544,7 +3544,7 @@ function events_page_responses($event, $childrens_ids=[]) 'delete_button', false, 'if(!confirm(\''.__('Are you sure?').'\')) { return false; } this.form.submit();', - 'class="sub cancel"', + 'class="sub cancel w70p"', true ); $data[2] .= html_print_input_hidden('delete', 1, true); @@ -3599,7 +3599,7 @@ function events_page_responses($event, $childrens_ids=[]) 'custom_response_button', false, 'execute_response('.$event['id_evento'].','.$server_id.')', - "class='sub next'", + "class='sub next w70p'", true ); } From 1805a0910eb07537f46eda4c1ac9321cb0ada711 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 18 Jun 2020 16:53:32 +0200 Subject: [PATCH 028/117] Changed query for get default actions in templates --- pandora_console/godmode/alerts/alert_list.list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 447e627567..2e6ec79d9e 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -203,7 +203,7 @@ if ($searchFlag) { } if ($actionID != -1 && $actionID != '') { - $where .= ' AND talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action = '.$actionID.')'; + $where .= ' AND talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action = '.$actionID.') OR talert_template_modules.id IN (SELECT id FROM talert_template_modules ttm WHERE ttm.id_alert_template IN (SELECT tat.id FROM talert_templates tat WHERE tat.id_alert_action = '.$actionID.'))'; } if ($enabledisable != -1 && $enabledisable != '') { From 40c0d4ea09c1bbf10652a1ffa410f0a8de9328ce Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 18 Jun 2020 17:09:22 +0200 Subject: [PATCH 029/117] fixed error --- pandora_console/godmode/alerts/configure_alert_template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 533bc32caf..26e7a69073 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -1041,7 +1041,7 @@ var matches_not = ')."'"; ?>; var is_not = ')."'"; ?>; var between = and ')."'"; ?>; -var between_not = and ").'"'; ?>; +var between_not = and ').'"'; ?>; var under = ')."'"; ?>; var over = ')."'"; ?>; var warning = ; From e56a787ba8b67371edc2f68b065f1d481466a8d4 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 18 Jun 2020 20:41:14 +0200 Subject: [PATCH 030/117] WIP: Connection lost warn --- pandora_console/include/javascript/pandora.js | 72 +++++++++++++++++++ .../include/javascript/pandora_ui.js | 40 +++++++++++ 2 files changed, 112 insertions(+) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 871853cfa0..ad950825c9 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -1865,3 +1865,75 @@ function ajaxRequest(id, settings) { } }); } + +var checkConnection = setInterval(handleConnection, 5000); + +window.addEventListener("online", handleConnection); +window.addEventListener("offline", handleConnection); + +function handleConnection() { + var connected; + var msg = "online"; + + if (navigator.onLine) { + isReachable(getServerUrl()) + .then(function(online) { + if (online) { + // handle online status + connected = true; + showConnectionMessage(connected, msg); + } else { + connected = false; + msg = "No connectivity with server"; + showConnectionMessage(connected, msg); + } + }) + .catch(function(err) { + connected = false; + msg = err; + showConnectionMessage(connected, msg); + }); + } else { + // handle offline status + connected = false; + msg = "Connection offline"; + showConnectionMessage(connected, msg); + } +} + +function isReachable(url) { + /** + * Note: fetch() still "succeeds" for 404s on subdirectories, + * which is ok when only testing for domain reachability. + * + * Example: + * https://google.com/noexist does not throw + * https://noexist.com/noexist does throw + */ + return fetch(url, { method: "HEAD", mode: "no-cors" }) + .then(function(resp) { + return resp && (resp.ok || resp.type === "opaque"); + }) + .catch(function(error) { + console.warn("[conn test failure]:", error); + }); +} + +function getServerUrl() { + return $("#php_to_js_value_absolute_homeurl").val() || window.location.origin; +} + +function showConnectionMessage(conn = true, msg = "") { + var data = {}; + if (conn) { + $("div#msg_connection") + .closest(".ui-dialog-content") + .dialog("close"); + $("div#msg_connection").remove(); + } else { + data.title = "Connection with server has been lost"; + data.text = "Connection status: " + msg; + + infoMessage(data, "msg_connection"); + } +} diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 70ffd40f7f..c60c889d03 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -478,3 +478,43 @@ function generalShowMsg(data, idMsg) { ] }); } + +function infoMessage(data, idMsg) { + var title = data.title; + var text = data.text; + + var html = + '' + + text; + + if (idMsg == null) { + idMsg = uniqId(); + } + + if ($("#" + idMsg).length === 0) { + $("body").append('
' + text + "
"); + } + + $("#" + idMsg).empty(); + $("#" + idMsg).html(html); + $("#" + idMsg) + .dialog({ + width: 450, + opacity: 1, + modal: true, + position: { + my: "center", + at: "center", + of: window, + collision: "fit" + }, + title: data.title, + open: function(event, ui) { + $(".ui-widget-overlay").addClass("modal-opened"); + }, + close: function(event, ui) { + $(".ui-widget-overlay").removeClass("modal-opened"); + } + }) + .show(); +} From d346c763229c9a5d50a3cb022a8b13f7969d4fea Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 19 Jun 2020 23:03:37 +0200 Subject: [PATCH 031/117] Connection error dialog working --- pandora_console/include/functions_ui.php | 23 +++++++++ pandora_console/include/javascript/pandora.js | 49 +++++++++++++++--- .../include/javascript/pandora_ui.js | 40 +++++++++++---- pandora_console/include/styles/pandora.css | 50 +++++++++++++++++++ pandora_console/index.php | 6 +++ .../operation/gis_maps/public_console.php | 5 ++ .../visual_console/legacy_public_view.php | 12 +++++ .../operation/visual_console/public_view.php | 11 ++++ 8 files changed, 179 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index c67091f47f..ba1fdb492b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -6010,3 +6010,26 @@ function ui_get_full_external_url(string $url) return $url; } + + +function ui_print_message_dialog($title, $text, $id='', $img='', $text_button='', $hidden=true) +{ + if ($hidden == true) { + $style = 'display:none'; + } + + echo '
'; + echo '
'; + echo '
'; + echo html_print_image($img, true, ['alt' => $title, 'border' => 0]); + echo '
'; + echo '
'; + echo '
'; + echo '

'.$title.'

'; + echo '

'.$text.'

'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; +} diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index ad950825c9..d6acb45ee7 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -1866,11 +1866,33 @@ function ajaxRequest(id, settings) { }); } -var checkConnection = setInterval(handleConnection, 5000); +/** + * ------------------------------------- + * Connection Check + * -------------------------------------- + */ -window.addEventListener("online", handleConnection); -window.addEventListener("offline", handleConnection); +checkConnection(1); +/** + * Performs connection tests every minutes and add connection listeners + * @param {integer} time in minutes + */ + +function checkConnection(minutes) { + var cicle = minutes * 60 * 1000; + var checkConnection = setInterval(handleConnection, cicle); + + // Connection listeters. + window.addEventListener("online", handleConnection); + window.addEventListener("offline", handleConnection); +} + +/** + * Handle connection status test. + * + * Test conectivity with server and shows modal message. + */ function handleConnection() { var connected; var msg = "online"; @@ -1901,6 +1923,13 @@ function handleConnection() { } } +/** + * Test server reachibilty and get response. + * + * @param {String} url + * + * Return {promise} + */ function isReachable(url) { /** * Note: fetch() still "succeeds" for 404s on subdirectories, @@ -1919,21 +1948,29 @@ function isReachable(url) { }); } +/** + * Gets server origin url + */ function getServerUrl() { return $("#php_to_js_value_absolute_homeurl").val() || window.location.origin; } +/** + * Shows or hide connection infoMessage. + * + * @param {bool} conn + * @param {string} msg + */ function showConnectionMessage(conn = true, msg = "") { var data = {}; if (conn) { - $("div#msg_connection") + $("div#message_dialog_connection") .closest(".ui-dialog-content") .dialog("close"); - $("div#msg_connection").remove(); } else { data.title = "Connection with server has been lost"; data.text = "Connection status: " + msg; - infoMessage(data, "msg_connection"); + infoMessage(data, "message_dialog_connection"); } } diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index c60c889d03..6667b21b1a 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -481,25 +481,24 @@ function generalShowMsg(data, idMsg) { function infoMessage(data, idMsg) { var title = data.title; - var text = data.text; - - var html = - '' + - text; + var err_messge = data.text; if (idMsg == null) { idMsg = uniqId(); } if ($("#" + idMsg).length === 0) { - $("body").append('
' + text + "
"); + $("body").append('
'); + $("#" + idMsg).empty(); } - $("#" + idMsg).empty(); - $("#" + idMsg).html(html); + $("#err_msg").empty(); + $("#err_msg").html("\n\n" + err_messge); + $("#" + idMsg) .dialog({ - width: 450, + height: 250, + width: 528, opacity: 1, modal: true, position: { @@ -509,11 +508,30 @@ function infoMessage(data, idMsg) { collision: "fit" }, title: data.title, + buttons: [ + { + class: + "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next", + text: "Retry", + click: function(e) { + handleConnection(); + } + }, + { + class: + "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel", + text: "Close", + click: function() { + $(this).dialog("close"); + } + } + ], + open: function(event, ui) { - $(".ui-widget-overlay").addClass("modal-opened"); + $(".ui-widget-overlay").addClass("error-modal-opened"); }, close: function(event, ui) { - $(".ui-widget-overlay").removeClass("modal-opened"); + $(".ui-widget-overlay").removeClass("error-modal-opened"); } }) .show(); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index eabdea9ecf..5f0160ed1a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -6040,3 +6040,53 @@ form#modal_form_feedback ul.wizard li > textarea { #controls_table > tbody > tr > td input { margin-left: 3px; } + +/* + * --------------------------------------------------------------------- + * - ERROR CONNECTION + * --------------------------------------------------------------------- + */ + +/*background dim */ + +.ui-widget-overlay.error-modal-opened { + background: rgb(0, 0, 0); + opacity: 0.5; + filter: Alpha(Opacity=50); +} + +/* --- Login page - modal windows --- */ +div.content_dialog { + width: 98%; + margin-top: 20px; +} + +div.icon_message_dialog { + float: left; + width: 25%; + text-align: center; +} + +div.icon_message_dialog img { + width: 85px; +} + +div.content_message_dialog { + width: 75%; + float: right; +} + +div.text_message_dialog { + width: 100%; + margin-top: 10px; +} + +div.text_message_dialog h1 { + margin: 0px; +} + +div.text_message_dialog p { + margin: 0px; + font-size: 10.3pt; + line-height: 14pt; +} diff --git a/pandora_console/index.php b/pandora_console/index.php index e272fb14a7..84cb0836ff 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1239,6 +1239,12 @@ echo '
'; echo '
'; echo '
'; + +// Connection lost alert. +$conn_title = __('Connection with server has been lost'); +$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); +ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); + if ($config['pure'] == 0) { echo '
'; // Container div. diff --git a/pandora_console/operation/gis_maps/public_console.php b/pandora_console/operation/gis_maps/public_console.php index cfbcff3e99..ba5b99633c 100755 --- a/pandora_console/operation/gis_maps/public_console.php +++ b/pandora_console/operation/gis_maps/public_console.php @@ -271,6 +271,11 @@ if ($layers != false) { gis_activate_select_control(); gis_activate_ajax_refresh($layers, $timestampLastOperation, 1, $idMap); + + // Connection lost alert. + $conn_title = __('Connection with server has been lost'); + $conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); + ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); } // Resize GIS map on fullscreen diff --git a/pandora_console/operation/visual_console/legacy_public_view.php b/pandora_console/operation/visual_console/legacy_public_view.php index 4a316eee60..cf85425229 100644 --- a/pandora_console/operation/visual_console/legacy_public_view.php +++ b/pandora_console/operation/visual_console/legacy_public_view.php @@ -43,6 +43,13 @@ enterprise_include('index.php'); $url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false); echo ''; +$url_css_modal = ui_get_full_url('include/styles/register.css', false, false, false); +echo ''; +// Connection lost alert. +$conn_title = __('Connection with server has been lost'); +$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); +ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); + require_once 'include/functions_visual_map.php'; $hash = get_parameter('hash'); @@ -148,6 +155,11 @@ echo ''; echo '
'; +// Connection lost alert. +$conn_title = __('Connection with server has been lost'); +$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); +ui_print_message_alert($conn_title, $conn_text, 'connection', '/images/error_1.png'); + ui_require_jquery_file('countdown', 'include/javascript/', true); ui_require_javascript_file('wz_jsgraphics', 'include/javascript/', true); ui_require_javascript_file('pandora_visual_console', 'include/javascript/', true); diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 7e899c3718..1127614eed 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -29,6 +29,12 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) { require_once $config['homedir'].'/vendor/autoload.php'; ui_require_css_file('visual_maps'); +ui_require_css_file('register'); + +// Connection lost alert. +$conn_title = __('Connection with server has been lost'); +$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); +ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); echo ''."\n"; echo ''."\n"; @@ -132,6 +138,11 @@ echo ''; echo ''; +// Connection lost alert. +$conn_title = __('Connection with server has been lost'); +$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.'); +ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png'); + // Check groups can access user. $aclUserGroups = []; if (!users_can_manage_group_all('AR')) { From 9e449fe1c32a15560eb8275cc24d5a5f0aaec9b5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 24 Jun 2020 13:05:40 +0200 Subject: [PATCH 032/117] id server check in api event creation #4158 --- pandora_console/include/functions_api.php | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index d045577f4e..cadf0a545c 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -12284,12 +12284,29 @@ function api_set_create_event($id, $trash1, $other, $returnType) return; } + if (!empty($other['data'][17]) && is_metaconsole()) { + $id_server = db_get_row_filter('tmetaconsole_setup', ['id' => $other['data'][17]]); + if ($id_server === false) { + returnError('error_create_event', __('Server id does not exist in database.')); + return; + } + + $values['server_id'] = $other['data'][17]; + } else { + $values['server_id'] = 0; + } + $error_msg = ''; if ($other['data'][2] != '') { $id_agent = $other['data'][2]; if (is_metaconsole()) { // On metaconsole, connect with the node to check the permissions - $agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent); + if (empty($values['server_id'])) { + $agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent); + } else { + $agent_cache = db_get_row_filter('tmetaconsole_agent', ['id_tagente' => $id_agent, 'id_tmetaconsole_setup' => $values['server_id']]); + } + if ($agent_cache === false) { returnError('id_not_found', 'string'); return; @@ -12418,12 +12435,6 @@ function api_set_create_event($id, $trash1, $other, $returnType) $values['custom_data'] = ''; } - if ($other['data'][17] != '') { - $values['server_id'] = $other['data'][17]; - } else { - $values['server_id'] = 0; - } - if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; $sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; From db452f41f533cd9cacaaaa4c6e1f14a5b59ea4d2 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 26 Jun 2020 10:11:41 +0200 Subject: [PATCH 033/117] Added trim in address --- pandora_console/godmode/servers/modificar_server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index cd401b0cc5..9062eab0a4 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -140,8 +140,8 @@ if (isset($_GET['server'])) { ui_print_error_message(__('There was a problem deleting the server')); } } else if (isset($_GET['update'])) { - $address = get_parameter_post('address'); - $description = get_parameter_post('description'); + $address = trim(get_parameter_post('address'), ' '); + $description = trim(get_parameter_post('description'), ' '); $id_server = get_parameter_post('server'); $exec_proxy = get_parameter_post('exec_proxy'); $port = get_parameter_post('port'); From 9a8c42f4acb37d3b3ed25989ad5ca2e12e9f1e4f Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 26 Jun 2020 15:36:51 +0200 Subject: [PATCH 034/117] Fixed xss event comments vulnerabiluty and some acls on event ajax --- pandora_console/include/ajax/events.php | 25 ++++++++++++ pandora_console/include/functions_events.php | 4 +- .../operation/events/events.build_table.php | 38 +++++++++--------- pandora_console/operation/events/events.php | 40 +++++++++---------- 4 files changed, 67 insertions(+), 40 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 4b5bffa2b4..ca17c8ab9f 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -871,6 +871,11 @@ if ($get_response_description) { } if ($get_response_params) { + if (! check_acl($config['id_user'], 0, 'EW')) { + echo 'unauthorized'; + return; + } + $response_id = get_parameter('response_id'); $params = db_get_value('params', 'tevent_response', 'id', $response_id); @@ -885,6 +890,11 @@ if ($get_response_params) { } if ($get_response_target) { + if (! check_acl($config['id_user'], 0, 'EW')) { + echo 'unauthorized'; + return; + } + $response_id = (int) get_parameter('response_id'); $event_id = (int) get_parameter('event_id'); $server_id = (int) get_parameter('server_id'); @@ -901,6 +911,11 @@ if ($get_response_target) { } if ($get_response) { + if (! check_acl($config['id_user'], 0, 'EW')) { + echo 'unauthorized'; + return; + } + $response_id = get_parameter('response_id'); $event_response = db_get_row('tevent_response', 'id', $response_id); @@ -917,6 +932,11 @@ if ($get_response) { if ($perform_event_response) { global $config; + if (! check_acl($config['id_user'], 0, 'EW')) { + echo 'unauthorized'; + return; + } + $response_id = get_parameter('response_id'); $event_id = (int) get_parameter('event_id'); $server_id = (int) get_parameter('server_id', 0); @@ -1011,6 +1031,11 @@ if ($perform_event_response) { if ($dialogue_event_response) { global $config; + if (! check_acl($config['id_user'], 0, 'EW')) { + echo 'unauthorized'; + return; + } + $event_id = get_parameter('event_id'); $response_id = get_parameter('response_id'); $command = get_parameter('target'); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a5b442d69c..bf5a0c1efb 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2118,7 +2118,7 @@ function events_comment( switch ($comments_format) { case 'new': - $comment_for_json['comment'] = $comment; + $comment_for_json['comment'] = io_safe_input($comment); $comment_for_json['action'] = $action; $comment_for_json['id_user'] = $config['id_user']; $comment_for_json['utimestamp'] = time(); @@ -2141,7 +2141,7 @@ function events_comment( $comment = str_replace(["\r\n", "\r", "\n"], '
', $comment); if ($comment != '') { - $commentbox = '
'.$comment.'
'; + $commentbox = '
'.io_safe_input($comment).'
'; } else { $commentbox = ''; } diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 943068c0ec..53eb840348 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -982,24 +982,26 @@ if ($group_rep == 2) { $array_events_actions[$val['id']] = $val['name']; } - if ($config['event_replication'] != 1) { - echo '
'; - echo '
'; - html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); - echo '  '; - html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); - echo "'; - echo '
'; - echo ''; - echo ''; - echo '
'; + if (check_acl($config['id_user'], 0, 'EW')) { + if ($config['event_replication'] != 1) { + echo '
'; + echo '
'; + html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); + echo '  '; + html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); + echo "'; + echo '
'; + echo ''; + echo ''; + echo '
'; + } } } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index ba029bfb17..974dd9c247 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1530,26 +1530,26 @@ foreach ($event_responses as $val) { $array_events_actions[$val['id']] = $val['name']; } - -echo '
'; -echo '
'; -echo ''; -html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); -echo '  '; -html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); -echo "'; -echo '
'; -echo ''; -echo ''; -echo '
'; - +if (check_acl($config['id_user'], 0, 'EW')) { + echo '
'; + echo '
'; + echo ''; + html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); + echo '  '; + html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); + echo "'; + echo '
'; + echo ''; + echo ''; + echo '
'; +} // Close viewer. enterprise_hook('close_meta_frame'); From 595339613b15b2cfaf6c77d2215003a9c6e17fee Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 29 Jun 2020 15:37:37 +0200 Subject: [PATCH 035/117] fixed weight legend --- pandora_console/include/functions.php | 7 +++++++ pandora_console/include/functions_graph.php | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index f5d9cdc5e5..23773a2934 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3724,6 +3724,13 @@ function series_type_graph_array($data, $show_elements_graph) } } + if (isset($value['weight']) === true + && empty($value['weight']) === false + ) { + $name_legend .= ' ('.__('Weight').' * '.$value['weight'].') '; + $data_return['legend'][$key] .= ' ('.__('Weight').' * '.$value['weight'].') '; + } + if ((int) $value['min'] === PHP_INT_MAX) { $value['min'] = 0; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d462929cff..3378b5d80c 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1504,19 +1504,28 @@ function graphic_combined_module( foreach ($value['data'] as $k => $v) { if ($v[1] != false) { $array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); + $array_data[$key]['slice_data'][$v[0]]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['max'] *= $params_combined['weight_list'][$i]; } } + + $array_data[$key]['max'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['weight'] = $params_combined['weight_list'][$i]; } } - $max = $array_data['sum'.$i]['max']; - $min = $array_data['sum'.$i]['min']; - $avg = $array_data['sum'.$i]['avg']; - if ($config['fixed_graph'] == false) { $water_mark = [ 'file' => $config['homedir'].'/images/logo_vertical_water.png', - 'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false), + 'url' => ui_get_full_url( + 'images/logo_vertical_water.png', + false, + false, + false + ), ]; } From b13cab3e2acf5facf32e6817a28452f2430a3e6e Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 29 Jun 2020 17:21:23 +0200 Subject: [PATCH 036/117] fix prediction date item in meta --- pandora_console/include/functions_forecast.php | 10 ++++++---- pandora_console/include/functions_graph.php | 12 +++++++++++- pandora_console/include/functions_reporting.php | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_forecast.php b/pandora_console/include/functions_forecast.php index 4dcf08db73..a7e5545d55 100644 --- a/pandora_console/include/functions_forecast.php +++ b/pandora_console/include/functions_forecast.php @@ -36,7 +36,8 @@ function forecast_projection_graph( $prediction_period, $max_value=false, $min_value=false, - $csv=false + $csv=false, + $server_name='' ) { global $config; @@ -55,7 +56,7 @@ function forecast_projection_graph( 'projection' => true, ]; - $module_data = grafico_modulo_sparse($params); + $module_data = grafico_modulo_sparse($params, $server_name); if (empty($module_data)) { return []; @@ -252,12 +253,13 @@ function forecast_prediction_date( $module_id, $period=SECONDS_2MONTHS, $max_value=0, - $min_value=0 + $min_value=0, + $server_name='' ) { // Checks interval if ($min_value > $max_value) { return false; } - return forecast_projection_graph($module_id, $period, false, $max_value, $min_value); + return forecast_projection_graph($module_id, $period, false, $max_value, $min_value, false, $server_name); } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d462929cff..fa4c08c65d 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -616,7 +616,7 @@ function grafico_modulo_sparse_data( * * @return string html Content graphs. */ -function grafico_modulo_sparse($params) +function grafico_modulo_sparse($params, $server_name='') { global $config; @@ -812,6 +812,12 @@ function grafico_modulo_sparse($params) $date_array['final_date'] = $params['date']; $date_array['start_date'] = ($params['date'] - $params['period']); + if (is_metaconsole()) { + $id_meta = metaconsole_get_id_server($server_name); + $server = metaconsole_get_connection_by_id($id_meta); + metaconsole_connect($server); + } + if ($agent_module_id) { $module_data = db_get_row_sql( 'SELECT * FROM tagente_modulo @@ -1022,6 +1028,10 @@ function grafico_modulo_sparse($params) } } + if (is_metaconsole()) { + metaconsole_restore_db(); + } + return $return; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 65724000f2..f784b48a22 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4664,7 +4664,7 @@ function reporting_prediction_date($report, $content) $max_interval = $intervals_text[0]; $min_interval = $intervals_text[1]; - $value = forecast_prediction_date($content['id_agent_module'], $content['period'], $max_interval, $min_interval); + $value = forecast_prediction_date($content['id_agent_module'], $content['period'], $max_interval, $min_interval, $content['server_name']); if ($value === false) { $return['data']['value'] = __('Unknown'); From 5b884e714b1aebe716f89938868fbec95d8a729d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 2 Jul 2020 17:00:19 +0200 Subject: [PATCH 037/117] Implemented all-in-row data for grouped general report --- .../include/functions_reporting.php | 287 ++++++++++++------ .../include/functions_reporting_html.php | 10 +- 2 files changed, 198 insertions(+), 99 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 65724000f2..366f4e1dfa 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7506,40 +7506,57 @@ function reporting_general($report, $content) if ($content['period'] == 0) { $data_res[$index] = modules_get_last_value($row['id_agent_module']); } else { - if (is_numeric($type_mod) && !$is_string[$index]) { - switch ($row['operation']) { - case 'sum': - $data_res[$index] = reporting_get_agentmodule_data_sum( - $row['id_agent_module'], - $content['period'], - $report['datetime'] - ); - break; + $data_sum = reporting_get_agentmodule_data_sum( + $row['id_agent_module'], + $content['period'], + $report['datetime'] + ); - case 'max': - $data_res[$index] = reporting_get_agentmodule_data_max( - $row['id_agent_module'], - $content['period'] - ); - break; + $data_max = reporting_get_agentmodule_data_max( + $row['id_agent_module'], + $content['period'] + ); - case 'min': - $data_res[$index] = reporting_get_agentmodule_data_min( - $row['id_agent_module'], - $content['period'] - ); - break; + $data_min = reporting_get_agentmodule_data_min( + $row['id_agent_module'], + $content['period'] + ); - case 'avg': - default: - $data_res[$index] = reporting_get_agentmodule_data_average( - $row['id_agent_module'], - $content['period'] - ); - break; - } + $data_avg = reporting_get_agentmodule_data_average( + $row['id_agent_module'], + $content['period'] + ); + + if ($content['style']['show_in_same_row'] && $content['group_by_agent'] == REPORT_GENERAL_NOT_GROUP_BY_AGENT) { + $data_res[$index] = [ + $data_avg, + $data_max, + $data_min, + $data_sum, + ]; } else { - $data_res[$index] = $type_mod; + if (is_numeric($type_mod) && !$is_string[$index]) { + switch ($row['operation']) { + case 'sum': + $data_res[$index] = $data_sum; + break; + + case 'max': + $data_res[$index] = $data_max; + break; + + case 'min': + $data_res[$index] = $data_min; + break; + + case 'avg': + default: + $data_res[$index] = $data_avg; + break; + } + } else { + $data_res[$index] = $type_mod; + } } } @@ -7581,44 +7598,89 @@ function reporting_general($report, $content) break; } - // Calculate the avg, min and max - if (is_numeric($data_res[$index]) && !$is_string[$index]) { - $change_min = false; - if (is_null($return['min']['value'])) { - $change_min = true; - } else { - if ($return['min']['value'] > $data_res[$index]) { + if ($content['style']['show_in_same_row']) { + foreach ($data_res[$index] as $val) { + // Calculate the avg, min and max + if (is_numeric($val)) { + $change_min = false; + if (is_null($return['min']['value'])) { + $change_min = true; + } else { + if ($return['min']['value'] > $val) { + $change_min = true; + } + } + + if ($change_min) { + $return['min']['value'] = $val; + $return['min']['formated_value'] = format_for_graph($val, 2, '.', ',', $divisor, $unit); + $return['min']['agent'] = $ag_name; + $return['min']['module'] = $mod_name; + } + + $change_max = false; + if (is_null($return['max']['value'])) { + $change_max = true; + } else { + if ($return['max']['value'] < $val) { + $change_max = true; + } + } + + if ($change_max) { + $return['max']['value'] = $val; + $return['max']['formated_value'] = format_for_graph($val, 2, '.', ',', $divisor, $unit); + $return['max']['agent'] = $ag_name; + $return['max']['module'] = $mod_name; + } + + if ($i == 0) { + $return['avg_value'] = $val; + } else { + $return['avg_value'] = ((($return['avg_value'] * $i) / ($i + 1)) + ($val / ($i + 1))); + } + } + } + } else { + // Calculate the avg, min and max + if (is_numeric($data_res[$index]) && !$is_string[$index]) { + $change_min = false; + if (is_null($return['min']['value'])) { $change_min = true; + } else { + if ($return['min']['value'] > $data_res[$index]) { + $change_min = true; + } } - } - if ($change_min) { - $return['min']['value'] = $data_res[$index]; - $return['min']['formated_value'] = format_for_graph($data_res[$index], 2, '.', ',', $divisor, $unit); - $return['min']['agent'] = $ag_name; - $return['min']['module'] = $mod_name; - } + if ($change_min) { + $return['min']['value'] = $data_res[$index]; + $return['min']['formated_value'] = format_for_graph($data_res[$index], 2, '.', ',', $divisor, $unit); + $return['min']['agent'] = $ag_name; + $return['min']['module'] = $mod_name; + } - $change_max = false; - if (is_null($return['max']['value'])) { - $change_max = true; - } else { - if ($return['max']['value'] < $data_res[$index]) { + $change_max = false; + if (is_null($return['max']['value'])) { $change_max = true; + } else { + if ($return['max']['value'] < $data_res[$index]) { + $change_max = true; + } } - } - if ($change_max) { - $return['max']['value'] = $data_res[$index]; - $return['max']['formated_value'] = format_for_graph($data_res[$index], 2, '.', ',', $divisor, $unit); - $return['max']['agent'] = $ag_name; - $return['max']['module'] = $mod_name; - } + if ($change_max) { + $return['max']['value'] = $data_res[$index]; + $return['max']['formated_value'] = format_for_graph($data_res[$index], 2, '.', ',', $divisor, $unit); + $return['max']['agent'] = $ag_name; + $return['max']['module'] = $mod_name; + } - if ($i == 0) { - $return['avg_value'] = $data_res[$index]; - } else { - $return['avg_value'] = ((($return['avg_value'] * $i) / ($i + 1)) + ($data_res[$index] / ($i + 1))); + if ($i == 0) { + $return['avg_value'] = $data_res[$index]; + } else { + $return['avg_value'] = ((($return['avg_value'] * $i) / ($i + 1)) + ($data_res[$index] / ($i + 1))); + } } } @@ -7693,50 +7755,87 @@ function reporting_general($report, $content) $data['id_module_type'] = $id_module_types[$i]; $data['operator'] = ''; if ($content['period'] != 0) { - switch ($operations[$i]) { - case 'sum': - $data['operator'] = __('Summatory'); - break; + if ($content['style']['show_in_same_row']) { + $data['operator'] = 'all'; + } else { + switch ($operations[$i]) { + case 'sum': + $data['operator'] = __('Summatory'); + break; - case 'min': - $data['operator'] = __('Minimum'); - break; + case 'min': + $data['operator'] = __('Minimum'); + break; - case 'max': - $data['operator'] = __('Maximum'); - break; + case 'max': + $data['operator'] = __('Maximum'); + break; - case 'avg': - default: - $data['operator'] = __('Rate'); - break; + case 'avg': + default: + $data['operator'] = __('Rate'); + break; + } } } - if ($d === false) { - $data['value'] = null; - } else { - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - break; + if ($content['style']['show_in_same_row']) { + foreach ($d as $val) { + if ($val === false) { + $data['value'][] = null; + } else { + switch ($config['dbtype']) { + case 'mysql': + case 'postgresql': + break; - case 'oracle': - if (preg_match('/[0-9]+,[0-9]E+[+-][0-9]+/', $d)) { - $d = oracle_format_float_to_php($d); + case 'oracle': + if (preg_match('/[0-9]+,[0-9]E+[+-][0-9]+/', $val)) { + $val = oracle_format_float_to_php($val); + } + break; } - break; + + $divisor = get_data_multiplier($units[$i]); + + if (!is_numeric($val) || $is_string[$i]) { + $data['value'][] = $val; + + // to see the chains on the table + $data['formated_value'][] = $val; + } else { + $data['value'][] = $val; + $data['formated_value'][] = format_for_graph($val, 2, '.', ',', $divisor, $units[$i]); + } + } } - - $divisor = get_data_multiplier($units[$i]); - - if (!is_numeric($d) || $is_string[$i]) { - $data['value'] = $d; - // to see the chains on the table - $data['formated_value'] = $d; + } else { + if ($d === false) { + $data['value'] = null; } else { - $data['value'] = $d; - $data['formated_value'] = format_for_graph($d, 2, '.', ',', $divisor, $units[$i]); + switch ($config['dbtype']) { + case 'mysql': + case 'postgresql': + break; + + case 'oracle': + if (preg_match('/[0-9]+,[0-9]E+[+-][0-9]+/', $d)) { + $d = oracle_format_float_to_php($d); + } + break; + } + + $divisor = get_data_multiplier($units[$i]); + + if (!is_numeric($d) || $is_string[$i]) { + $data['value'] = $d; + + // to see the chains on the table + $data['formated_value'] = $d; + } else { + $data['value'] = $d; + $data['formated_value'] = format_for_graph($d, 2, '.', ',', $divisor, $units[$i]); + } } } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 2ef9586f12..2e556b30b8 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3928,10 +3928,10 @@ function reporting_html_general($table, $item, $pdf=0) $table1->data[] = [ agents_get_alias($id_agent), modules_get_agentmodule_name($id_module), - $row2['Rate'], - $row2['Maximum'], - $row2['Minimum'], - $row2['Summatory'], + $row2['all'][0], + $row2['all'][1], + $row2['all'][2], + $row2['all'][3], ]; } } @@ -4014,7 +4014,7 @@ function reporting_html_general($table, $item, $pdf=0) $table_summary->data[0][0] = $item['min']['agent'].' - '.$item['min']['module'].str_repeat(' ', 20).$item['min']['formated_value']; $table_summary->data[0][1] = ''; - $table_summary->data[0][2] = format_for_graph($item['avg_value'], 2); + $table_summary->data[0][2] = $item['avg_value']; $table_summary->data[0][3] = $item['max']['agent'].' - '.$item['max']['module'].str_repeat(' ', 20).$item['max']['formated_value']; $table_summary->data[0][4] = ''; From 9ae225a5055ad38c4b417b34e05789cab1b606f6 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 3 Jul 2020 13:34:04 +0200 Subject: [PATCH 038/117] Fixed snmp community special char --- pandora_console/include/ajax/snmp_browser.ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php index eb4d8e8b54..571399c703 100644 --- a/pandora_console/include/ajax/snmp_browser.ajax.php +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -25,7 +25,7 @@ if (is_ajax()) { $method = (string) get_parameter('method', ''); $action = (string) get_parameter('action', ''); $target_ip = (string) get_parameter('target_ip', ''); - $community = (string) get_parameter('community', ''); + $community = (string) io_safe_output((get_parameter('community', ''))); $snmp_version = (string) get_parameter('snmp_browser_version', ''); $snmp3_auth_user = io_safe_output(get_parameter('snmp3_browser_auth_user')); $snmp3_security_level = get_parameter('snmp3_browser_security_level'); From 76d724321f46be0cd74ab79256374087216449b2 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 3 Jul 2020 14:18:30 +0200 Subject: [PATCH 039/117] Fixed report sendmail success message --- pandora_console/godmode/reporting/reporting_builder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index a1eeb45766..fae9e6aa18 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -170,6 +170,7 @@ if ($schedule_report != '') { $parameters[4] = get_parameter('report_type', ''); $parameters['first_execution'] = strtotime($date.' '.$time); + $values = [ 'id_usuario' => $config['id_user'], 'id_user_task' => $id_user_task, @@ -180,9 +181,11 @@ if ($schedule_report != '') { $result = db_process_sql_insert('tuser_task_scheduled', $values); + $report_type = $parameters[4]; + ui_print_result_message( $result, - __('Your report has been planned, and the system will email you a PDF with the report as soon as its finished'), + __('Your report has been planned, and the system will email you a '.$report_type.' file with the report as soon as its finished'), __('An error has ocurred') ); echo '
'; From 458d729029420ede739f754f20f4f0031c21d52b Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 3 Jul 2020 14:22:07 +0200 Subject: [PATCH 040/117] fix snmp browser v2 --- pandora_console/include/functions_snmp_browser.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index ce146fbc4f..c4ef3b05ab 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -273,7 +273,7 @@ function snmp_browser_get_tree( break; case '2': - $snmp_version = SNMP::VERSION_2c; + $snmp_version = SNMP::VERSION_2C; break; case '2c': @@ -286,7 +286,7 @@ function snmp_browser_get_tree( break; default: - $snmp_version = SNMP::VERSION_2c; + $snmp_version = SNMP::VERSION_2C; break; } @@ -421,6 +421,10 @@ function snmp_browser_get_oid( return; } + if ($version == '2') { + $version = '2c'; + } + $output = get_snmpwalk( $target_ip, $version, From 47a7502c6b293036b3f87dba1067433c7509dc13 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 6 Jul 2020 09:55:14 +0200 Subject: [PATCH 041/117] Added change to MR --- pandora_console/extras/mr/40.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pandora_console/extras/mr/40.sql diff --git a/pandora_console/extras/mr/40.sql b/pandora_console/extras/mr/40.sql new file mode 100644 index 0000000000..4818a11354 --- /dev/null +++ b/pandora_console/extras/mr/40.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event'; + +COMMIT; \ No newline at end of file From 49888fe48f0a3c09e359f96c1b0aad56205fb2bd Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 6 Jul 2020 09:56:15 +0200 Subject: [PATCH 042/117] Added change to MR --- pandora_console/extras/mr/40.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/40.sql b/pandora_console/extras/mr/40.sql index 4818a11354..dd6809ea20 100644 --- a/pandora_console/extras/mr/40.sql +++ b/pandora_console/extras/mr/40.sql @@ -2,4 +2,4 @@ START TRANSACTION; UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event'; -COMMIT; \ No newline at end of file +COMMIT; From 4ad7735dd7f777604bd1b122a65f6a563816a5a4 Mon Sep 17 00:00:00 2001 From: marcos Date: Mon, 6 Jul 2020 10:09:36 +0200 Subject: [PATCH 043/117] resolved error with duplucated modules --- .../godmode/agentes/module_manager.php | 301 ++++++++++++++---- 1 file changed, 236 insertions(+), 65 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 2ae1761f49..1725e1c76f 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -24,7 +24,16 @@ require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_servers.php'; -$search_string = io_safe_output(urldecode(trim(get_parameter('search_string', '')))); +$search_string = io_safe_output( + urldecode( + trim( + get_parameter( + 'search_string', + '' + ) + ) + ) +); global $policy_page; @@ -32,17 +41,28 @@ if (!isset($policy_page)) { $policy_page = false; } -// Search string filter form + +echo '
'; + +echo ''; +echo "
"; +echo __('Search').' '.html_print_input_text( + 'search_string', + $search_string, + '', + 15, + 255, + true +); +html_print_input_hidden('search', 1); +echo ''; +// Search string filter form. if (($policy_page) || (isset($agent))) { echo '
'; } else { echo ''; } -echo ''; -echo "'; echo "'; echo ""; echo ''; // Check if there is at least one server of each type available to assign that -// kind of modules. If not, do not show server type in combo +// kind of modules. If not, do not show server type in combo. $network_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 1' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $wmi_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 6' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $plugin_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 4' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $prediction_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 5' ); -// POSTGRESQL AND ORACLE COMPATIBLE -// Development mode to use all servers +// POSTGRESQL AND ORACLE COMPATIBLE. +// Development mode to use all servers. if ($develop_bypass || is_metaconsole()) { $network_available = 1; $wmi_available = 1; $plugin_available = 1; - // FIXME when prediction predictions server modules can be configured - // on metaconsole + // FIXME when prediction predictions server modules can be configured. + // on metaconsole. $prediction_available = is_metaconsole() ? 0 : 1; } @@ -140,7 +160,7 @@ if (($policy_page) || (isset($agent))) { } if ($show_creation) { - // Create module/type combo + // Create module/type combo. echo ''; if (!$policy_page) { echo ''; } echo ''; echo '', - "
"; -echo __('Search').' '.html_print_input_text('search_string', $search_string, '', 15, 255, true); - html_print_input_hidden('search', 1); echo '"; html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"'); @@ -50,38 +70,38 @@ echo '
'; @@ -151,13 +171,33 @@ if (($policy_page) || (isset($agent))) { $checked = false; } - html_print_checkbox('status_hierachy_mode', '', $checked, false, false, 'onChange=change_mod_filter();'); + html_print_checkbox( + 'status_hierachy_mode', + '', + $checked, + false, + false, + 'onChange=change_mod_filter();' + ); echo ''; echo __('

Type

'); - html_print_select($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;'); + html_print_select( + $modules, + 'moduletype', + '', + '', + '', + '', + false, + false, + false, + '', + false, + 'max-width:300px;' + ); html_print_input_hidden('edit_module', 1); echo '
'; @@ -212,7 +252,13 @@ if ($multiple_delete) { } enterprise_include_once('include/functions_config_agents.php'); - enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_agent_module_del), modules_get_agentmodule_name($id_agent_module_del)]); + enterprise_hook( + 'config_agents_delete_module_in_conf', + [ + modules_get_agentmodule_agent($id_agent_module_del), + modules_get_agentmodule_name($id_agent_module_del), + ] + ); $error = 0; @@ -220,7 +266,12 @@ if ($multiple_delete) { // error. NOTICE that we don't delete all data here, just marking for deletion // and delete some simple data. $status = ''; - $agent_id_of_module = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', (int) $id_agent_module_del); + $agent_id_of_module = db_get_value( + 'id_agente', + 'tagente_modulo', + 'id_agente_modulo', + (int) $id_agent_module_del + ); if (db_process_sql( "UPDATE tagente_modulo @@ -235,7 +286,7 @@ if ($multiple_delete) { ) { $error++; } else { - // Set flag to update module status count + // Set flag to update module status count. if ($agent_id_of_module !== false) { db_process_sql( 'UPDATE tagente @@ -286,32 +337,48 @@ if ($multiple_delete) { break; } - // Trick to detect if we are deleting a synthetic module (avg or arithmetic) - // If result is empty then module doesn't have this type of submodules - $ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_agent_module_del]); + // Trick to detect if we are deleting a synthetic module (avg or arithmetic). + // If result is empty then module doesn't have this type of submodules. + $ops_json = enterprise_hook( + 'modules_get_synthetic_operations', + [$id_agent_module_del] + ); $result_ops_synthetic = json_decode($ops_json); if (!empty($result_ops_synthetic)) { - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_agent_module_del]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [$id_agent_module_del] + ); if ($result === false) { $error++; } - } //end if - else { - $result_components = enterprise_hook('modules_get_synthetic_components', [$id_agent_module_del]); + } else { + $result_components = enterprise_hook( + 'modules_get_synthetic_components', + [$id_agent_module_del] + ); $count_components = 1; if (!empty($result_components)) { - // Get number of components pending to delete to know when it's needed to update orders + // Get number of components pending to delete to know when it's needed to update orders. $num_components = count($result_components); $last_target_module = 0; foreach ($result_components as $id_target_module) { - // Detects change of component or last component to update orders - if (($count_components == $num_components) or ($last_target_module != $id_target_module)) { + // Detects change of component or last component to update orders. + if (($count_components == $num_components) || ($last_target_module != $id_target_module) + ) { $update_orders = true; } else { $update_orders = false; } - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_agent_module_del, $update_orders]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [ + $id_target_module, + $id_agent_module_del, + $update_orders, + ] + ); if ($result === false) { $error++; } @@ -323,7 +390,7 @@ if ($multiple_delete) { } - // Check for errors + // Check for errors. if ($error != 0) { } else { $count_correct_delete_modules++; @@ -509,7 +576,7 @@ switch ($sortField) { } -// Build the order sql +// Build the order sql. if (!empty($order)) { $order_sql = ' ORDER BY '; } @@ -525,7 +592,7 @@ foreach ($order as $ord) { $order_sql .= $ord['field'].' '.$ord['order']; } -// Get limit and offset parameters +// Get limit and offset parameters. $limit = (int) $config['block_size']; $offset = (int) get_parameter('offset'); @@ -559,9 +626,15 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente); $search_string_entities = io_safe_input($search_string); -$basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", $search_string, $search_string_entities, $search_string, $search_string_entities); +$basic_where = sprintf( + "(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", + $search_string, + $search_string_entities, + $search_string, + $search_string_entities +); -// Tags acl +// Tags acl. $agent_tags = tags_get_user_applied_agent_tags($id_agente); if ($agent_tags !== true) { $where_tags = ' AND ttag_module.id_tag IN ('.implode(',', $agent_tags).')'; @@ -619,7 +692,7 @@ if ($modules === false) { return; } -// Prepare pagination +// Prepare pagination. $url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string); if ($paginate_module) { @@ -635,17 +708,48 @@ $table = new stdClass(); $table->width = '100%'; $table->class = 'info_table'; $table->head = []; -$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); -$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown); +$table->head['checkbox'] = html_print_checkbox( + 'all_delete', + 0, + false, + true, + false +); +$table->head[0] = __('Name').ui_get_sorting_arrows( + $url_name.'up', + $url_name.'down', + $selectNameUp, + $selectNameDown +); -// The access to the policy is granted only with AW permission -if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { +// The access to the policy is granted only with AW permission. +if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' +) +) { $table->head[1] = "".__('P.').''; } -$table->head[2] = "".__('S.').''.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown); -$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown); -$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown); +$table->head[2] = "".__('S.').''.ui_get_sorting_arrows( + $url_server.'up', + $url_server.'down', + $selectServerUp, + $selectServerDown +); +$table->head[3] = __('Type').ui_get_sorting_arrows( + $url_type.'up', + $url_type.'down', + $selectTypeUp, + $selectTypeDown +); +$table->head[4] = __('Interval').ui_get_sorting_arrows( + $url_interval.'up', + $url_interval.'down', + $selectIntervalUp, + $selectIntervalDown +); $table->head[5] = __('Description'); $table->head[6] = __('Status'); $table->head[7] = __('Warn'); @@ -690,7 +794,16 @@ if ($checked) { } foreach ($modules as $module) { - if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && ! check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) { + if (! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AW' + ) && ! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AD' + ) + ) { continue; } @@ -712,7 +825,9 @@ foreach ($modules as $module) { if (!$checked) { if ($module['id_module_group'] != $last_modulegroup) { $last_modulegroup = $module['id_module_group']; - $data[0] = ''.modules_get_modulegroup_name($last_modulegroup).''; + $data[0] = ''.modules_get_modulegroup_name( + $last_modulegroup + ).''; $i = array_push($table->data, $data); $table->rowstyle[($i - 1)] = 'text-align: center'; $table->rowclass[($i - 1)] = 'datos3'; @@ -727,14 +842,23 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - $data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); + $data['checkbox'] = html_print_checkbox( + 'id_delete[]', + $module['id_agente_modulo'], + false, + true + ); } $data[0] = ''; if (isset($module['deep']) && ($module['deep'] != 0)) { $data[0] .= str_repeat('    ', $module['deep']); - $data[0] .= html_print_image('images/icono_escuadra.png', true, ['style' => 'padding-bottom: inherit;']).'  '; + $data[0] .= html_print_image( + 'images/icono_escuadra.png', + true, + ['style' => 'padding-bottom: inherit;'] + ).'  '; } if ($module['quiet']) { @@ -754,17 +878,38 @@ foreach ($modules as $module) { } if ($module['disabled']) { - $data[0] .= ''.ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt').''; + $data[0] .= ''.ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ).''; } else { - $data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt'); + $data[0] .= ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ); } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { $data[0] .= ''; } - // The access to the policy is granted only with AW permission - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { + // The access to the policy is granted only with AW permission. + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' + ) + ) { $policyInfo = policies_info_module_policy($module['id_agente_modulo']); if ($policyInfo === false) { $data[1] = ''; @@ -798,17 +943,27 @@ foreach ($modules as $module) { } } - // Module type (by server type ) + // Module type (by server type ). $data[2] = ''; if ($module['id_modulo'] > 0) { $data[2] = servers_show_type($module['id_modulo']); } - $module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module['id_agente_modulo']); + $module_status = db_get_row( + 'tagente_estado', + 'id_agente_modulo', + $module['id_agente_modulo'] + ); - modules_get_status($module['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title); + modules_get_status( + $module['id_agente_modulo'], + $module_status['estado'], + $module_status['datos'], + $status, + $title + ); - // This module is initialized ? (has real data) + // This module is initialized ? (has real data). if ($status == STATUS_MODULE_NO_DATA) { $data[2] .= html_print_image( 'images/error.png', @@ -817,13 +972,13 @@ foreach ($modules as $module) { ); } - // Module type (by data type) + // Module type (by data type). $data[3] = ''; if ($type) { $data[3] = ui_print_moduletype_icon($type, true); } - // Module interval + // Module interval. if ($module['module_interval']) { $data[4] = human_time_description_raw($module['module_interval']); } else { @@ -831,12 +986,23 @@ foreach ($modules as $module) { } if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { - $data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true); + $data[4] .= ui_print_help_tip( + __('The policy modules of data type will only update their intervals when policy is applied.'), + true + ); } - $data[5] = ui_print_truncate_text($module['descripcion'], 'description', false); + $data[5] = ui_print_truncate_text( + $module['descripcion'], + 'description', + false + ); - $data[6] = ui_print_status_image($status, htmlspecialchars($title), true); + $data[6] = ui_print_status_image( + $status, + htmlspecialchars($title), + true + ); // MAX / MIN values. if ($module['id_tipo_modulo'] != 25) { @@ -884,7 +1050,7 @@ foreach ($modules as $module) { ); $data[8] .= ' '; - // Make a data normalization + // Make a data normalization. if (isset($numericModules[$type])) { if ($numericModules[$type] === true) { $data[8] .= ''; @@ -904,7 +1070,7 @@ foreach ($modules as $module) { $data[8] .= '  '; } - // create network component action + // Create network component action. if ((is_user_admin($config['id_user'])) && ($module['id_modulo'] == MODULE_NETWORK) ) { @@ -927,7 +1093,7 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - // Delete module + // Delete module. $data[9] = ''; $data[9] .= html_print_image( @@ -959,7 +1125,12 @@ html_print_table($table); if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { echo '
'; html_print_input_hidden('multiple_delete', 1); - html_print_submit_button(__('Delete'), 'multiple_delete', false, 'class="sub delete"'); + html_print_submit_button( + __('Delete'), + 'multiple_delete', + false, + 'class="sub delete"' + ); echo '
'; echo ''; } From 0ef7ff11980376da9f9ca699478d65fbb9819c3a Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 6 Jul 2020 14:35:22 +0200 Subject: [PATCH 044/117] fix empty check condition --- pandora_console/godmode/alerts/configure_alert_action.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 3d39941bf8..e7d98b55b9 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -237,12 +237,12 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { // Store the value in a hidden to keep it on first execution $table->data['field'.$i][1] .= html_print_input_hidden( 'field'.$i.'_value', - !empty($action['field'.$i]) ? $action['field'.$i] : '', + (!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '', true ); $table->data['field'.$i][2] .= html_print_input_hidden( 'field'.$i.'_recovery_value', - !empty($action['field'.$i.'_recovery']) ? $action['field'.$i.'_recovery'] : '', + (!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '', true ); } From 71eaebc03be997a8b1465e1b246c8e94e7f2f26a Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Mon, 6 Jul 2020 17:01:52 +0200 Subject: [PATCH 045/117] Server notifications clean when solved --- pandora_console/include/class/ConsoleSupervisor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index f0f9b28bba..d881418611 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1221,6 +1221,9 @@ class ConsoleSupervisor // At this point there's no servers with issues. $this->cleanNotifications('NOTIF.SERVER.STATUS%'); return; + } else { + // Clean notifications. Only show notif for down servers. + $this->cleanNotifications('NOTIF.SERVER.STATUS%'); } foreach ($servers as $server) { From 37a97cd2adee166cb02a6457367a108a5fa815a2 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 7 Jul 2020 10:26:19 +0200 Subject: [PATCH 046/117] Added link to credential store from module creation --- .../godmode/agentes/module_manager_editor_network.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index f179da95fe..f509b104b4 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -464,6 +464,8 @@ $data[1] = html_print_select( $disabledBecauseInPolicy ); +$data[1] .= '

'.__('Manage credentials').''; + $array_os = [ 'inherited' => __('Inherited'), 'linux' => __('SSH'), From e2ae568ed32f68bede89d586fc559bfa5ff9983b Mon Sep 17 00:00:00 2001 From: marcos Date: Tue, 7 Jul 2020 15:48:31 +0200 Subject: [PATCH 047/117] change message in non initialited modules --- pandora_console/operation/agentes/estado_monitores.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 37b23e622c..a6566de4e9 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -150,7 +150,7 @@ $sort = get_parameter('sort', 'up'); $modules_not_init = agents_monitor_notinit($id_agente); if (empty($modules_not_init) === false) { $help_not_init = ui_print_warning_message( - __('No initialized modules found.') + __('Non initialized modules found.') ); } else { $help_not_init = ''; From 19a8288f261c202bdf2256ae94cb2041299cc392 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 9 Jul 2020 17:39:08 +0200 Subject: [PATCH 048/117] Increase the size of tserver.version. Ref pandora_enterprise#4943 --- pandora_console/extras/mr/40.sql | 1 + pandora_console/pandoradb.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/40.sql b/pandora_console/extras/mr/40.sql index 7ee43f98ed..ca6a50ce15 100644 --- a/pandora_console/extras/mr/40.sql +++ b/pandora_console/extras/mr/40.sql @@ -2,6 +2,7 @@ START TRANSACTION; ALTER TABLE `tservice_element` ADD COLUMN `rules` text; ALTER TABLE `tservice` ADD COLUMN `unknown_as_critical` tinyint(1) NOT NULL default 0 AFTER `warning`; +ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT ''; UPDATE `tservice` SET `auto_calculate`=0; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index f02c4409d7..68858bab4b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1073,7 +1073,7 @@ CREATE TABLE IF NOT EXISTS `tserver` ( `checksum` tinyint(3) unsigned NOT NULL default '0', `description` varchar(255) default NULL, `recon_server` tinyint(3) unsigned NOT NULL default '0', - `version` varchar(20) NOT NULL default '', + `version` varchar(25) NOT NULL default '', `plugin_server` tinyint(3) unsigned NOT NULL default '0', `prediction_server` tinyint(3) unsigned NOT NULL default '0', `wmi_server` tinyint(3) unsigned NOT NULL default '0', From af87e8c6216414cfb527690d1944322c65dcba39 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Fri, 10 Jul 2020 08:30:57 +0200 Subject: [PATCH 049/117] fixed errors in dashboard widget groups status --- .../include/lib/Dashboard/Widgets/system_group_status.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php index 8f0bbc00bb..e15811bb9f 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/system_group_status.php @@ -183,7 +183,9 @@ class SystemGroupStatusWidget extends Widget $values = parent::decoders($decoder); if (isset($decoder['status']) === true) { - if (is_array($decoder['status']) === true) { + if (is_array($decoder['status']) === true + && count($decoder['status']) > 1 + ) { $compatibilityStatus = []; foreach ($decoder['status'] as $key => $value) { switch ((int) $value) { From b87c2d986f95f6dc8637694f56c56ba1c7f130ac Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Fri, 10 Jul 2020 12:36:57 +0200 Subject: [PATCH 050/117] Fixed errors po and mo --- pandora_console/include/languages/es.mo | Bin 689042 -> 689053 bytes pandora_console/include/languages/es.po | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/languages/es.mo b/pandora_console/include/languages/es.mo index 87d12a8a8d7c085481b7d7dad84bc183f4e7d55a..36b2d3a0799fd70de7bed0d7e1368a54f45db064 100644 GIT binary patch delta 64528 zcmXWkci_!cAHea8{C+>Xj7Z6qnZ5U(A*)1oHbqv8##N$0Mj{DGBq2&e%Sag&6-q^e zvQkPzDLp;!_dVyY*E!#D#^-#_`Ch8$dGvvbiyx@C{;qSW71^f|hw|DrRxs7^+rG?v5kz|esXMxVPg)@Q~0 zD=|OUw_ttz2z@`RZfL(U65&*$8wESK3opSrXa}p&4&KGGcnFQ%=s$6mf@@Ktad@F2`a);C6o;ZSycetE z<7fjr(V6VSjoA~4Z?FLM1!}tQiBx%R{EveBx?IbQ zL>;V#&SWUM1oz|pxCq^DrCNpOuS5q}6P;;iya)%O6SyThJ-Q5y^y}zu*wc#r?@SJI z!F_!!KKKjPqn_D1jJz2-z=4>=8`1ZsV`ZF=Mq(Q};E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d?&P zeQ_$oq0c3c z#li_R0w<$?p)X!ULtXHW5W>1>#QLB!8Hx`0M)boe3;mRwhY4JYw)-+V(AVSr-I(3| z|0xBx$rtFz{zhk>lcjN{SECL1qnaabg(hKptbo1HHBX|uWHFY;7tn}&g0}l3IjfN+X73!##I@**zeGcQ3=RD+XrxY~1J8SB7;s@UiLXH0 zZHErLdvrv+elw1A21yEbuoMmTO0?m%XhS>D9QYk=sOX&Vd`0y6+US59qaC)4^-kD? zdiT4(Je`eyvhz<4{>i!Z%hS1Ds8_2_mFo2q)$2B>S+7!c{+H2l=#;5ddQ2XgHD%n; zsS_qQNOT-}^W>q4mP4~9BpUV18k;p?TGqpRD&=01QKw2~W}$vK5A9 z)~`N%R_xgn#nzPx{skO*2ln{6B|XL(>2N diff --git a/pandora_console/include/languages/es.po b/pandora_console/include/languages/es.po index 0f65189eb5..715b29c6f7 100644 --- a/pandora_console/include/languages/es.po +++ b/pandora_console/include/languages/es.po @@ -9,14 +9,14 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-06-05 14:43+0200\n" -"PO-Revision-Date: 2020-06-09 07:38+0000\n" -"Last-Translator: Laura Cano \n" +"PO-Revision-Date: 2020-07-10 09:28+0000\n" +"Last-Translator: Vanessa \n" "Language-Team: Spanish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2020-06-11 08:52+0000\n" -"X-Generator: Launchpad (build b190cebbf563f89e480a8b57f641753c8196bda0)\n" +"X-Launchpad-Export-Date: 2020-07-10 09:51+0000\n" +"X-Generator: Launchpad (build 4809fcb62f445aaa3ae919f7f6c3cc7d156ea57a)\n" #: ../../views/dashboard/header.php:40 #: ../../enterprise/meta/screens/screens.visualmap.php:176 @@ -32138,7 +32138,7 @@ msgstr "Filtrar agentes" #: ../../godmode/admin_access_logs.php:47 #, php-format msgid "%s audit" -msgstr "Adiitoría %s" +msgstr "Auditoría %s" #: ../../godmode/admin_access_logs.php:47 msgid "Review Logs" From b4871538007900de849a0917043c035afd936d0f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 10 Jul 2020 13:21:30 +0200 Subject: [PATCH 051/117] Lock on LIFO mode if the agent does not exist to prevent duplicates. Ref pandora_enterprise#5908 --- pandora_server/lib/PandoraFMS/DataServer.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 69efd9f45a..ef2e975b13 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -117,7 +117,7 @@ sub run ($) { ############################################################################### sub data_producer ($) { my $self = shift; - my $pa_config = $self->getConfig (); + my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ()); my @tasks; my @files; @@ -162,7 +162,7 @@ sub data_producer ($) { next if ($file !~ /^(.*)[\._]\d+\.data$/); my $agent_name = $1; - next if (agent_lock($pa_config, $agent_name) == 0); + next if (agent_lock($pa_config, $dbh, $agent_name) == 0); push (@tasks, $file); } @@ -1064,9 +1064,16 @@ sub process_xml_matrix_network { # Get a lock on the given agent. Return 1 on success, 0 otherwise. ########################################################################## sub agent_lock { - my ($pa_config, $agent_name) = @_; + my ($pa_config, $dbh, $agent_name) = @_; - return 1 if ($pa_config->{'dataserver_lifo'} == 1); + # Do not lock on LIFO mode if the agent already exist. + # get_agent_id will be called again from process_xml_data, + # so the should be no race conditions if the agent does + # not exist. + if ($pa_config->{'dataserver_lifo'} == 1 && + get_agent_id ($dbh, $agent_name) > 0) { + return 1; + } $AgentSem->down (); if (defined ($Agents{$agent_name})) { From 9d16783254daf43543f536ed4517b36b6c339ff8 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 11 Jul 2020 01:00:19 +0200 Subject: [PATCH 052/117] 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.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 799b2bb8c9..f416cb5d95 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.747-200710 +Version: 7.0NG.747-200711 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 3437330ef9..342af2c56a 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.747-200710" +pandora_version="7.0NG.747-200711" 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 64ce2248b4..b266b6b9d3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.747'; -use constant AGENT_BUILD => '200710'; +use constant AGENT_BUILD => '200711'; # 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 513e302e15..6b36b46222 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.747 -%define release 200710 +%define release 200711 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 4dd166c66d..92abaa9baf 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.747 -%define release 200710 +%define release 200711 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 45d5d0574f..54c59527c5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200710" +PI_BUILD="200711" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4500b02a3f..b89e64aa10 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200710} +{200711} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4ec5410610..ce4ae771e3 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.747(Build 200710)") +#define PANDORA_VERSION ("7.0NG.747(Build 200711)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8536573beb..bdb6775a82 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.747(Build 200710))" + VALUE "ProductVersion", "(7.0NG.747(Build 200711))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 1361fc7177..ecedee3942 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.747-200710 +Version: 7.0NG.747-200711 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 6146d7d4e2..57141fe819 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.747-200710" +pandora_version="7.0NG.747-200711" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index df3861493e..6683cc673e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC200710'; +$build_version = 'PC200711'; $pandora_version = 'v7.0NG.747'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 96a4907908..a5058c5594 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6c8a2ca9c6..7026a39e79 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200710 +%define release 200711 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 51b90f3019..0ed882fc9e 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200710 +%define release 200711 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7612ef2859..3794ff9884 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200710" +PI_BUILD="200711" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 977a826973..544a7d32b7 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.747 PS200710"; +my $version = "7.0NG.747 PS200711"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 76bf1e73f7..6fcc8c53b8 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.747 PS200710"; +my $version = "7.0NG.747 PS200711"; # save program name for logging my $progname = basename($0); From e80252287c642d0b6a0bc05556afa33b3a5caca5 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 12 Jul 2020 01:00:12 +0200 Subject: [PATCH 053/117] 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.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f416cb5d95..ba2afc5e9c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.747-200711 +Version: 7.0NG.747-200712 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 342af2c56a..2ed658c04b 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.747-200711" +pandora_version="7.0NG.747-200712" 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 b266b6b9d3..0ae398a4e6 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.747'; -use constant AGENT_BUILD => '200711'; +use constant AGENT_BUILD => '200712'; # 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 6b36b46222..0fe2b4bf16 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.747 -%define release 200711 +%define release 200712 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 92abaa9baf..6fc9188d94 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.747 -%define release 200711 +%define release 200712 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 54c59527c5..02a34311e8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200711" +PI_BUILD="200712" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b89e64aa10..2a91ec4def 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200711} +{200712} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ce4ae771e3..f711d44722 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.747(Build 200711)") +#define PANDORA_VERSION ("7.0NG.747(Build 200712)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index bdb6775a82..40d29b8322 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.747(Build 200711))" + VALUE "ProductVersion", "(7.0NG.747(Build 200712))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ecedee3942..32f46930fc 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.747-200711 +Version: 7.0NG.747-200712 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 57141fe819..b3261853a6 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.747-200711" +pandora_version="7.0NG.747-200712" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6683cc673e..e4f55a8616 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC200711'; +$build_version = 'PC200712'; $pandora_version = 'v7.0NG.747'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index a5058c5594..dc608ff778 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7026a39e79..013a5fc840 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200711 +%define release 200712 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0ed882fc9e..df74aace81 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200711 +%define release 200712 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3794ff9884..8489a10c2e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200711" +PI_BUILD="200712" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 544a7d32b7..20a0b219a4 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.747 PS200711"; +my $version = "7.0NG.747 PS200712"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6fcc8c53b8..555abd8edb 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.747 PS200711"; +my $version = "7.0NG.747 PS200712"; # save program name for logging my $progname = basename($0); From 313607efdf8fb2433ad3af43bf575a541d258250 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 13 Jul 2020 01:00:12 +0200 Subject: [PATCH 054/117] 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.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ba2afc5e9c..84c220a198 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.747-200712 +Version: 7.0NG.747-200713 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 2ed658c04b..1a49f60823 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.747-200712" +pandora_version="7.0NG.747-200713" 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 0ae398a4e6..2b7cdb9192 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.747'; -use constant AGENT_BUILD => '200712'; +use constant AGENT_BUILD => '200713'; # 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 0fe2b4bf16..9489a8a8e7 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.747 -%define release 200712 +%define release 200713 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 6fc9188d94..a9d6d34408 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.747 -%define release 200712 +%define release 200713 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 02a34311e8..baab89854a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200712" +PI_BUILD="200713" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2a91ec4def..cf2d5e0755 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200712} +{200713} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f711d44722..d776a76693 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.747(Build 200712)") +#define PANDORA_VERSION ("7.0NG.747(Build 200713)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 40d29b8322..225da7799d 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.747(Build 200712))" + VALUE "ProductVersion", "(7.0NG.747(Build 200713))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 32f46930fc..0bfda896c5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.747-200712 +Version: 7.0NG.747-200713 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 b3261853a6..9bf5796be0 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.747-200712" +pandora_version="7.0NG.747-200713" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e4f55a8616..8db7138763 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC200712'; +$build_version = 'PC200713'; $pandora_version = 'v7.0NG.747'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index dc608ff778..ba5d19ca90 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 013a5fc840..e867225d9f 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200712 +%define release 200713 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index df74aace81..a64d29f795 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.747 -%define release 200712 +%define release 200713 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 8489a10c2e..f68cc1773f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.747" -PI_BUILD="200712" +PI_BUILD="200713" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 20a0b219a4..e845222842 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.747 PS200712"; +my $version = "7.0NG.747 PS200713"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 555abd8edb..76cccb4ad1 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.747 PS200712"; +my $version = "7.0NG.747 PS200713"; # save program name for logging my $progname = basename($0); From 925e76578487cc29f5a9290081f46d2e5ad1c06f Mon Sep 17 00:00:00 2001 From: Junichi Satoh Date: Mon, 13 Jul 2020 13:42:43 +0900 Subject: [PATCH 055/117] Fixed tentacle server startup script for FreeBSD. --- pandora_server/FreeBSD/tentacle_server | 1892 +----------------------- 1 file changed, 36 insertions(+), 1856 deletions(-) diff --git a/pandora_server/FreeBSD/tentacle_server b/pandora_server/FreeBSD/tentacle_server index 8b27ed35b3..a8752e2cf5 100755 --- a/pandora_server/FreeBSD/tentacle_server +++ b/pandora_server/FreeBSD/tentacle_server @@ -1,1869 +1,49 @@ -#!/usr/bin/perl -########################################################################## -# Tentacle Server -# See http://www.openideas.info/wiki for protocol description. -# Tentacle have IANA assigned port tpc/41121 as official port. -########################################################################## -# Copyright (c) 2007-2008 Ramon Novoa -# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L +#!/bin/sh + +# ********************************************************************** +# Tentacle Server Daemon launcher for FreeBSD +# (c) 2010-2012 Junichi Satoh # -# tentacle_server.pl Tentacle Server. See http://www.openideas.info/wiki for -# protocol description. +# ********************************************************************** + +# PROVIDE: tentacle_server +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `tentacle_server': +# +# tentacle_server_enable="YES" # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -########################################################################## -package tentacle::server; -=head1 NAME +. "/etc/rc.subr" -tentacle_server - Tentacle Server +name="tentacle_server" +rcvar=tentacle_server_enable -=head1 VERSION +# read configuration and set defaults +tentacle_server_enable=${tentacle_server_enable:-"NO"} +tentacle_server_flags=${tentacle_server_flags:-'-a 0.0.0.0 -p 41121 -s /var/spool/pandora/data_in -i.*\.conf:conf\;.*\.md5:md5\;.*\.zip:collections -d'} +tentacle_server_user=${tentacle_server_user:-"pandora"} +load_rc_config $name -Version 0.6.1 +PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin -=head1 USAGE +command=/usr/local/bin/${name} +command_interpreter=/usr/local/bin/perl +procname=$command +pidfile=/var/run/$name.pid -tentacle_server B<< -s F >> [I] +start_postcmd=start_postcmd +stop_postcmd=stop_postcmd -=head1 DESCRIPTION - -B is a server for B, a B file transfer protocol that aims to be: - -=over - -=item * Secure by design. - -=item * Easy to use. - -=item * Versatile and cross-platform. - -=back - -Tentacle was created to replace more complex tools like SCP and FTP for simple file transfer/retrieval, and switch from authentication mechanisms like .netrc, interactive logins and SSH keys to X.509 certificates. Simple password authentication over a SSL secured connection is supported too. - -The client and server (B) are designed to be run from the command line or called from a shell script, and B. - -=cut - -use strict; -use warnings; -use Getopt::Std; -use IO::Select; -use IO::Compress::Zip qw(zip $ZipError); -use IO::Uncompress::Unzip qw(unzip $UnzipError); -use threads; -use Thread::Semaphore; -use POSIX ":sys_wait_h"; -use Time::HiRes qw(usleep); -use Scalar::Util qw(refaddr); -use POSIX qw(strftime); - -# Constants for Win32 services. -use constant WIN32_SERVICE_STOPPED => 0x01; -use constant WIN32_SERVICE_RUNNING => 0x04; - -my $t_libwrap_installed = eval { require Authen::Libwrap } ? 1 : 0; - -if ($t_libwrap_installed) { - Authen::Libwrap->import( qw( hosts_ctl STRING_UNKNOWN ) ); +start_postcmd() +{ + pgrep -f -j none "^$command_interpreter $command" > $pidfile } -# Log errors, 1 enabled, 0 disabled -my $t_log = 0; - -# Log information, 1 enabled, 0 enabled -my $t_log_hard = 0; - -my $SOCKET_MODULE; -if ($^O eq 'MSWin32') { - # Only support INET on windows - require IO::Socket::INET; - $SOCKET_MODULE = 'IO::Socket::INET'; -} else { - $SOCKET_MODULE = - eval { require IO::Socket::INET6 } ? 'IO::Socket::INET6' - : eval { require IO::Socket::INET } ? 'IO::Socket::INET' - : die $@; +stop_postcmd() +{ + rm -f $pidfile } -# Service name for Win32. -my $SERVICE_NAME="Tentacle Server"; - -# Service parameters. -my $SERVICE_PARAMS=join(' ', @ARGV); - -# Program version -our $VERSION = '0.6.2'; - -# IPv4 address to listen on -my @t_addresses = ('0', '0.0.0.0'); - -# Block size for socket read/write operations in bytes -my $t_block_size = 1024; - -# Client socket -my $t_client_socket; - -# Run as daemon, 1 true, 0 false -my $t_daemon = 0; - -# Storage directory -my $t_directory = ''; - -# Filters -my @t_filters; - -# Enable (1) or disable (0) insecure mode -my $t_insecure = 0; - -# String containing quoted invalid file name characters -my $t_invalid_chars = '\?\[\]\/\\\=\+\<\>\:\;\'\,\*\~'; - -# Maximum number of simultaneous connections -my $t_max_conn = 10; - -# Maximum file size allowed by the server in bytes -my $t_max_size = 2000000; - -# File overwrite, 1 enabled, 0 disabled -my $t_overwrite = 0; - -# Port to listen on -my $t_port = 41121; - -# Server password -my $t_pwd = ''; - -# Do not output error messages, 1 enabled, 0 disabled -my $t_quiet = 0; - -# Number of retries for socket read/write operations -my $t_retries = 3; - -# Select handler -my $t_select; - -# Semaphore -my $t_sem :shared; - -# Server socket -my @t_server_sockets; - -# Server select handler -my $t_server_select; - -# Use SSL, 1 true, 0 false -my $t_ssl = 0; - -# SSL ca certificate file -my $t_ssl_ca = ''; - -# SSL certificate file -my $t_ssl_cert = ''; - -# SSL private key file -my $t_ssl_key = ''; - -# SSL private key password -my $t_ssl_pwd = ''; - -# Timeout for socket read/write operations in seconds -my $t_timeout = 1; - -# Address to proxy client requests to -my $t_proxy_ip = undef; - -# Port to proxy client requests to -my $t_proxy_port = 41121; - -# Proxy socket -my $t_proxy_socket; - -# Proxy selected handler -my $t_proxy_select; - -# Use libwrap, 1 true, 0 false -my $t_use_libwrap = 0; - -# Program name for libwrap -my $t_program_name = $0; -$t_program_name =~ s/.*\///g; - -# Log file -my $log_file = undef; - -################################################################################ -## SUB print_help -## Print help screen. -################################################################################ -sub print_help { - $" = ','; - - print ("Usage: $0 -s [options]\n\n"); - print ("Tentacle server v$VERSION. See http://www.openideas.info/wiki for protocol description.\n\n"); - print ("Options:\n"); - print ("\t-a ip_addresses\tIP addresses to listen on (default @t_addresses).\n"); - print ("\t \t(Multiple addresses separated by comma can be defined.)\n"); - print ("\t-c number\tMaximum number of simultaneous connections (default $t_max_conn).\n"); - print ("\t-d\t\tRun as daemon.\n"); - print ("\t-e cert\t\tOpenSSL certificate file. Enables SSL.\n"); - print ("\t-f ca_cert\tVerify that the peer certificate is signed by a ca.\n"); - print ("\t-F config_file\tConfiguration file full path.\n"); - print ("\t-h\t\tShow help.\n"); - print ("\t-I\t\tEnable insecure operations (file listing and moving).\n"); - print ("\t-i\t\tFilters.\n"); - print ("\t-k key\t\tOpenSSL private key file.\n"); - print ("\t-l log_file\t\tFile to write logs.\n"); - print ("\t-m size\t\tMaximum file size in bytes (default ${t_max_size}b).\n"); - print ("\t-o\t\tEnable file overwrite.\n"); - print ("\t-p port\t\tPort to listen on (default $t_port).\n"); - print ("\t-q\t\tQuiet. Do now print error messages.\n"); - print ("\t-r number\tNumber of retries for network opertions (default $t_retries).\n"); - print ("\t-S (install|uninstall|run) Manage the win32 service.\n"); - print ("\t-t time\t\tTime-out for network operations in seconds (default ${t_timeout}s).\n"); - print ("\t-v\t\tBe verbose (display errors).\n"); - print ("\t-V\t\tBe verbose on hard way (display errors and other info).\n"); - print ("\t-w\t\tPrompt for OpenSSL private key password.\n"); - print ("\t-x pwd\t\tServer password.\n"); - print ("\t-b ip_address\tProxy requests to the given address.\n"); - print ("\t-g port\t\tProxy requests to the given port.\n"); - print ("\t-T\t\tEnable tcpwrappers support.\n"); - print ("\t \t\t(To use this option, 'Authen::Libwrap' should be installed.)\n\n"); -} - -################################################################################ -## SUB daemonize -## Turn the current process into a daemon. -################################################################################ -sub daemonize { - my $pid; - - require POSIX; - - chdir ('/') || error ("Cannot chdir to /: $!."); - umask 0; - - open (STDIN, '/dev/null') || error ("Cannot read /dev/null: $!."); - - # Do not be verbose when running as a daemon - open (STDOUT, '>/dev/null') || error ("Cannot write to /dev/null: $!."); - open (STDERR, '>/dev/null') || error ("Cannot write to /dev/null: $!."); - - # Fork - $pid = fork (); - if (! defined ($pid)) { - error ("Cannot fork: $!."); - } - - # Parent - if ($pid != 0) { - exit; - } - - # Child - POSIX::setsid () || error ("Cannot start a new session: $!."); -} - -################################################################################ -## SUB parse_options -## Parse command line options and initialize global variables. -################################################################################ -sub parse_options { - my %opts; - my $CONF = {}; - my $token_value; - my $tmp; - my @t_addresses_tmp; - - # Get options - if (getopts ('a:b:c:de:f:F:g:hIi:k:l:m:op:qr:s:S:t:TvVwx:', \%opts) == 0 || defined ($opts{'h'})) { - print_help (); - exit 1; - } - - # The Win32 service must be installed/uninstalled without checking other parameters. - if (defined ($opts{'S'})) { - my $service_action = $opts{'S'}; - if ($^O ne 'MSWin32') { - error ("Windows services are only available on Win32."); - } else { - eval "use Win32::Daemon"; - die($@) if ($@); - - if ($service_action eq 'install') { - install_service(); - } elsif ($service_action eq 'uninstall') { - uninstall_service(); - } - } - } - - # Configuration file - if (defined($opts{'F'})) { - parse_config_file($opts{'F'}, $CONF); - } - - # Address - $token_value = get_config_value($opts{'a'}, $CONF->{'addresses'}); - if (defined ($token_value)) { - @t_addresses = (); - @t_addresses_tmp = split(/,/, $token_value); - - foreach my $t_address (@t_addresses_tmp) { - $t_address =~ s/^ *(.*?) *$/$1/; - if (($t_address ne '0') && - ($t_address !~ /^[a-zA-Z\.]+$/ && ($t_address !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ - || $1 < 0 || $1 > 255 || $2 < 0 || $2 > 255 - || $3 < 0 || $3 > 255 || $4 < 0 || $4 > 255)) && - ($t_address !~ /^[0-9a-f:]+$/o)) { - error ("Address $t_address is not valid."); - } - push @t_addresses, $t_address; - } - } - - # Maximum simultaneous connections - $token_value = get_config_value($opts{'c'}, $CONF->{'max_connections'}); - if (defined ($token_value)) { - $t_max_conn = $token_value; - if ($t_max_conn !~ /^\d+$/ || $t_max_conn < 1) { - error ("Invalid number of maximum simultaneous connections."); - } - } - - # Run as daemon - $token_value = get_config_value($opts{'d'}, $CONF->{'daemon'}, 1); - if (defined ($token_value)) { - if ($^ eq 'MSWin32') { - error ("-d flag not available for this OS."); - } - - $t_daemon = 1; - } - - # Enable SSL - $token_value = get_config_value($opts{'e'}, $CONF->{'ssl_cert'}); - if (defined ($token_value)) { - - require IO::Socket::SSL; - - $t_ssl_cert = $token_value; - if (! -f $t_ssl_cert) { - error ("File $t_ssl_cert does not exist."); - } - - $t_ssl = 1; - } - - # Verify peer certificate - $token_value = get_config_value($opts{'f'}, $CONF->{'ssl_ca'}); - if (defined ($token_value)) { - $t_ssl_ca = $token_value; - if (! -f $t_ssl_ca) { - error ("File $t_ssl_ca does not exist."); - } - } - - # Insecure mode - $token_value = get_config_value($opts{'I'}, $CONF->{'insecure'}, 1); - if (defined ($token_value)) { - $t_insecure = 1; - } - - # Filters (regexp:dir;regexp:dir...) - $token_value = get_config_value($opts{'i'}, $CONF->{'filters'}); - if (defined ($token_value)) { - my @filters = split (';', $token_value); - foreach my $filter (@filters) { - my ($regexp, $dir) = split (':', $filter); - next unless defined ($regexp) && defined ($dir); - - # Remove any trailing / - my $char = chop ($dir); - $dir .= $char if ($char) ne '/'; - - push(@t_filters, [$regexp, $dir]); - } - } - - # SSL private key file - $token_value = get_config_value($opts{'k'}, $CONF->{'ssl_key'}); - if (defined ($token_value)) { - $t_ssl_key = $token_value; - if (! -f $t_ssl_key) { - error ("File $t_ssl_key does not exist."); - } - } - - # Maximum file size - $token_value = get_config_value($opts{'m'}, $CONF->{'max_size'}); - if (defined ($token_value)) { - $t_max_size = $token_value; - if ($t_max_size !~ /^\d+$/ || $t_max_size < 1) { - error ("Invalid maximum file size."); - } - } - - # File overwrite - $token_value = get_config_value($opts{'o'}, $CONF->{'overwrite'}, 1); - if (defined ($token_value)) { - $t_overwrite = 1; - } - - # Port - $token_value = get_config_value($opts{'p'}, $CONF->{'port'}); - if (defined ($token_value)) { - $t_port = $token_value; - if ($t_port !~ /^\d+$/ || $t_port < 1 || $t_port > 65535) { - error ("Port $t_port is not valid."); - } - } - - # Quiet mode - $token_value = get_config_value($opts{'q'}, $CONF->{'quiet'}, 1); - if (defined ($token_value)) { - $t_quiet = 1; - } - - # Retries - $token_value = get_config_value($opts{'r'}, $CONF->{'retries'}); - if (defined ($token_value)) { - $t_retries = $token_value; - if ($t_retries !~ /^\d+$/ || $t_retries < 1) { - error ("Invalid number of retries for network operations."); - } - } - - # Storage directory - $token_value = get_config_value($opts{'s'}, $CONF->{'directory'}); - if (defined ($token_value)) { - - $t_directory = $token_value; - - # Check that directory exists - if (! -d $t_directory) { - error ("Directory $t_directory does not exist."); - } - - # Check directory permissions - if (! -w $t_directory) { - error ("Cannot write to directory $t_directory."); - } - - # Remove the trailing / if present - $tmp = chop ($t_directory); - if ($tmp ne '/') { - $t_directory .= $tmp; - } - } - else { - $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); - if (! defined($token_value)) { - print_help (); - exit 1; - } - } - - # Timeout - $token_value = get_config_value($opts{'t'}, $CONF->{'timeout'}); - if (defined ($token_value)) { - $t_timeout = $token_value; - if ($t_timeout !~ /^\d+$/ || $t_timeout < 1) { - error ("Invalid timeout for network operations."); - } - } - - # Read verbose from config file - if (defined($CONF->{'verbose'})) { - if ($CONF->{'verbose'} eq "1") { - $t_log = 1; - } elsif ($CONF->{'verbose'} eq "2") { - $t_log = 1; - $t_log_hard = 1; - } - } - # Be verbose - if (defined ($opts{'v'})) { - $t_log = 1; - $t_log_hard = 0; - } - # Be verbose hard - if (defined ($opts{'V'})) { - $t_log = 1; - $t_log_hard = 1; - } - - # SSL private key password - $token_value = get_config_value($opts{'w'}, $CONF->{'ssl_password'}, 1); - if (defined ($token_value)) { - $t_ssl_pwd = ask_passwd ("Enter private key file password: ", "Enter private key file password again for confirmation: "); - } - - # Server password - $token_value = get_config_value($opts{'x'}, $CONF->{'password'}); - if (defined ($token_value)) { - $t_pwd = $token_value; - } - - #Proxy IP address - $token_value = get_config_value($opts{'b'}, $CONF->{'proxy_ip'}); - if (defined ($token_value)) { - $t_proxy_ip = $token_value; - if ($t_proxy_ip !~ /^[a-zA-Z\.]+$/ && ($t_proxy_ip !~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ - || $1 < 0 || $1 > 255 || $2 < 0 || $2 > 255 - || $3 < 0 || $3 > 255 || $4 < 0 || $4 > 255) && - $t_proxy_ip !~ /^[0-9a-f:]+$/o) { - error ("Proxy address $t_proxy_ip is not valid."); - } - } - - # Proxy Port - $token_value = get_config_value($opts{'g'}, $CONF->{'proxy_port'}); - if (defined ($token_value)) { - $t_proxy_port = $token_value; - if ($t_proxy_port !~ /^\d+$/ || $t_proxy_port < 1 || $t_proxy_port > 65535) { - error ("Proxy port $t_port is not valid."); - } - } - - # TCP wrappers support - $token_value = get_config_value($opts{'T'}, $CONF->{'use_libwrap'}, 1); - if (defined ($token_value)) { - if ($t_libwrap_installed) { - $t_use_libwrap = 1; - } else { - error ("Authen::Libwrap is not installed."); - } - } - - # Win32 service management - if (defined ($opts{'S'})) { - my $service_action = $opts{'S'}; - if ($^O ne 'MSWin32') { - error ("Windows services are only available on Win32."); - } else { - eval "use Win32::Daemon"; - die($@) if ($@); - - if ($service_action eq 'run') { - Win32::Daemon::RegisterCallbacks({ - start => \&callback_start, - running => \&callback_running, - stop => \&callback_stop, - }); - Win32::Daemon::StartService(); - exit 0; - } else { - error("Unknown action: $service_action"); - } - } - } - - # Get the config file - $token_value = get_config_value($opts{'l'}, $CONF->{'log_file'}); - if (defined ($token_value)) { - $log_file = $token_value; - } - - # No command lines config values - - # Get the block size - if (defined ($CONF->{'block_size'})) { - if ($t_port !~ /^\d+$/ || $t_port < 1) { - error ("Invalid block size: " . $CONF->{'block_size'} . "."); - } - $t_block_size = $CONF->{'block_size'}; - } - - # Configuration file invalid chars - if (defined ($CONF->{'invalid_chars'})) { - $t_invalid_chars = $CONF->{'invalid_chars'}; - } -} - -################################################################################ -## SUB parse_config_file -## Get all options from a config file. -################################################################################ -sub parse_config_file { - my ($config_file, $CONF) = @_; - - # File should be writable - if (! -r $config_file) { - print "Configuration file $config_file is not readable.\n"; - return; - } - - # Open the file - my $FH; - if (! open ($FH, "< $config_file")) { - print "Cannot open configuration file $config_file.\n"; - return; - } - - # Read the file and only get the well formed lines - while (<$FH>) { - my $buffer_line = $_; - if ($buffer_line =~ /^[a-zA-Z]/){ # begins with letters - if ($buffer_line =~ m/([\w\-\_\.]+)\s+(.*)/){ - $CONF->{$1} = $2 unless $2 eq ""; - } - } - } - - close ($FH); - return; -} - -################################################################################ -## SUB parse_config_file -## Search in command line options and config hash from configuration file -## to get a value (command line is a priority) -################################################################################ -sub get_config_value { - my ($cmd_value, $conf_value, $bool) = @_; - $bool = 0 unless defined($bool); - - return $cmd_value if defined($cmd_value); - # The boolean type value is 1 or undef (0 should be translated like undefP) - if ($bool && defined($conf_value)) { - return undef if ($conf_value ne "1"); - } - return $conf_value; -} - -################################################################################ -## SUB start_proxy -## Open the proxy server socket. -################################################################################ -sub start_proxy { - - # Connect to server - $t_proxy_socket = $SOCKET_MODULE->new ( - PeerAddr => $t_proxy_ip, - PeerPort => $t_proxy_port, - ); - - if (! defined ($t_proxy_socket)) { - error ("Cannot connect to $t_proxy_ip on port $t_proxy_port: $!."); - } - - # Create proxy selector - $t_proxy_select = IO::Select->new (); - $t_proxy_select->add ($t_proxy_socket); - -} - -################################################################################ -## SUB start_server -## Open the server socket. -################################################################################ -sub start_server { - - my $t_server_socket; - - foreach my $t_address (@t_addresses) { - - $t_server_socket = $SOCKET_MODULE->new ( - Listen => $t_max_conn, - LocalAddr => $t_address, - LocalPort => $t_port, - Proto => 'tcp', - ReuseAddr => 1, - ); - - if (! defined ($t_server_socket)) { - print_log ("Cannot open socket for address $t_address on port $t_port: $!."); - next; - } - - print_log ("Server listening on $t_address port $t_port (press to stop)"); - - # Say message if tentacle proxy is enable - if (defined ($t_proxy_ip)) { - print_log ("Proxy Mode enable, data will be sent to $t_proxy_ip port $t_proxy_port"); - } - - push @t_server_sockets, $t_server_socket; - } - - if (!@t_server_sockets) { - error ("Cannot open socket for all addresses on port $t_port: $!."); - } - - $t_server_select = IO::Select->new(); - foreach my $t_server_socket (@t_server_sockets){ - $t_server_select->add($t_server_socket); - } -} - -################################################################################ -## SUB send_data_proxy -## Send data to proxy socket. -################################################################################ -sub send_data_proxy { - my $data = $_[0]; - my $block_size; - my $retries = 0; - my $size; - my $total = 0; - my $written; - - $size = length ($data); - - while (1) { - - # Try to write data to the socket - if ($t_proxy_select->can_write ($t_timeout)) { - - $block_size = ($size - $total) > $t_block_size ? $t_block_size : ($size - $total); - $written = syswrite ($t_proxy_socket, $data, $size - $total, $total); - - # Write error - if (! defined ($written)) { - error ("Connection error from " . $t_proxy_socket->sockhost () . ": $!."); - } - - # EOF - if ($written == 0) { - error ("Connection from " . $t_proxy_socket->sockhost () . " unexpectedly closed."); - } - - $total += $written; - - # Check if all data was written - if ($total == $size) { - return; - } - } - # Retry - else { - $retries++; - if ($retries > $t_retries) { - error ("Connection from " . $t_proxy_socket->sockhost () . " timed out."); - } - } - } -} - -################################################################################ -## SUB close_proxy -## Close the proxy socket. -################################################################################ -sub close_proxy { - $t_proxy_socket->shutdown (2); - $t_proxy_socket->close (); -} - -################################################################################ -## SUB stop_server -## Close the server socket. -################################################################################ -sub stop_server { - - foreach my $t_server_socket (@t_server_sockets) { - $t_server_socket->shutdown (2); - $t_server_socket->close (); - } - print_log ("Server going down"); - - exit 0; -} - -################################################################################ -## SUB start_ssl -## Convert the client socket to an IO::Socket::SSL socket. -################################################################################ -sub start_ssl { - my $err; - - if ($t_ssl_ca eq '') { - IO::Socket::SSL->start_SSL ( - $t_client_socket, - SSL_cert_file => $t_ssl_cert, - SSL_key_file => $t_ssl_key, - SSL_passwd_cb => sub {return $t_ssl_pwd}, - SSL_server => 1, - # Verify peer - SSL_verify_mode => 0x01, - ); - } - else { - IO::Socket::SSL->start_SSL ( - $t_client_socket, - SSL_ca_file => $t_ssl_ca, - SSL_cert_file => $t_ssl_cert, - SSL_key_file => $t_ssl_key, - SSL_passwd_cb => sub {return $t_ssl_pwd}, - SSL_server => 1, - # Fail verification if no peer certificate exists - SSL_verify_mode => 0x03, - ); - } - - $err = IO::Socket::SSL::errstr (); - if ($err ne '') { - error ($err); - } - - print_log ("SSL started for " . $t_client_socket->sockhost ()); -} - -################################################################################ -## SUB accept_connections -## Manage incoming connections. -################################################################################ -sub accept_connections { - my $pid; - my $t_server_socket; - - # Ignore SIGPIPE - $SIG{PIPE} = 'IGNORE'; - - # Start server - start_server (); - - # Initialize semaphore - $t_sem = Thread::Semaphore->new ($t_max_conn); - - while (1) { - my @ready = $t_server_select->can_read; - foreach $t_server_socket (@ready) { - - # Accept connection - $t_client_socket = $t_server_socket->accept (); - - if (! defined ($t_client_socket)) { - next if ($! ne ''); # EINTR - error ("accept: $!."); - } - - print_info ("Client connected from " . $t_client_socket->peerhost ()); - - if ($t_use_libwrap && (! hosts_ctl($t_program_name, $t_client_socket))) { - print_log ("Connection from " . $t_client_socket->peerhost() . " is closed by tcpwrappers."); - $t_client_socket->shutdown (2); - $t_client_socket->close(); - } - else { - - # Create a new thread and serve the client - $t_sem->down(); - my $thr = threads->create(\&serve_client); - if (! defined ($thr)) { - error ("Error creating thread: $!."); - } - $thr->detach(); - $t_client_socket->close (); - } - } - - usleep (1000); - } -} - -################################################################################ -## SUB serve_client -## Serve a connected client. -################################################################################ -sub serve_client() { - - eval { - # Add client socket to select queue - $t_select = IO::Select->new (); - $t_select->add ($t_client_socket); - - # Start SSL - if ($t_ssl == 1) { - start_ssl (); - } - - # Authenticate client - if ($t_pwd ne '') { - auth_pwd (); - } - - # Check if proxy mode is enable - if (defined ($t_proxy_ip)) { - serve_proxy_connection (); - } else { - serve_connection (); - } - }; - - $t_client_socket->shutdown (2); - $t_client_socket->close (); - $t_sem->up(); -} - -################################################################################ -## SUB serve_proxy_connection -## Actuate as a proxy between its client and other tentacle server. -################################################################################ -sub serve_proxy_connection { - - # We are a proxy! Start a connection to the Tentacle Server. - start_proxy(); - - # Forward data between the client and the server. - eval { - my $select = IO::Select->new (); - $select->add($t_proxy_socket); - $select->add($t_client_socket); - while (my @ready = $select->can_read()) { - foreach my $socket (@ready) { - if (refaddr($socket) == refaddr($t_client_socket)) { - my ($read, $data) = recv_data($t_block_size); - return unless defined($data); - send_data_proxy($data); - } - else { - my ($read, $data) = recv_data_proxy($t_block_size); - return unless defined($data); - send_data($data); - } - } - } - }; - - # Close the connection to the Tentacle Server. - close_proxy(); -} - -################################################################################ -## SUB serve_connection -## Read and process commands from the client. -################################################################################ -sub serve_connection { - my $command; - - # Read commands - while ($command = recv_command ($t_block_size)) { - - # Client wants to send a file - if ($command =~ /^SEND <(.*)> SIZE (\d+)$/) { - print_info ("Request to send file '$1' size ${2}b from " . $t_client_socket->sockhost ()); - recv_file ($1, $2); - } - # Client wants to receive a file - elsif ($command =~ /^RECV <(.*)>$/) { - print_info ("Request to receive file '$1' from " . $t_client_socket->sockhost ()); - send_file ($1); - } - elsif ($command =~ /^ZSEND <(.*)> SIZE (\d+)$/) { - print_info ("Request to send compressed file '$1' size ${2}b from " . $t_client_socket->sockhost ()); - zrecv_file ($1, $2); - } - # Client wants to receive a file - elsif ($command =~ /^ZRECV <(.*)>$/) { - print_info ("Request to receive compressed file '$1' from " . $t_client_socket->sockhost ()); - zsend_file ($1); - } - # Quit - elsif ($command =~ /^QUIT$/) { - print_info ("Connection closed from " . $t_client_socket->sockhost ()); - last; - } - # File listing. - elsif ($command =~ /^LS <(.*)>$/) { - if ($t_insecure == 0) { - print_info ("Insecure mode disabled. Rejected request to list files matched by filter $1 from " . $t_client_socket->sockhost ()); - last; - } - - print_info ("Request to list files matched by filter $1 from " . $t_client_socket->sockhost ()); - send_file_list ($1); - } - # Client wants to move a file - elsif ($command =~ /^MV <(.*)>$/) { - if ($t_insecure == 0) { - print_info ("Insecure mode disabled. Rejected request to move file $1 from " . $t_client_socket->sockhost ()); - last; - } - - print_info ("Request to move file '$1' from " . $t_client_socket->sockhost ()); - move_file ($1); - } - # Unknown command - else { - print_log ("Unknown command '$command' from " . $t_client_socket->sockhost ()); - last; - } - } -} - -################################################################################ -## SUB auth_pwd -## Authenticate client with server password. -################################################################################ -sub auth_pwd { - my $client_digest; - my $command; - my $pwd_digest; - - require Digest::MD5; - - # Wait for password - $command = recv_command ($t_block_size); - if ($command !~ /^PASS (.*)$/) { - error ("Client " . $t_client_socket->sockhost () . " did not authenticate."); - } - - $client_digest = $1; - $pwd_digest = Digest::MD5::md5 ($t_pwd); - $pwd_digest = Digest::MD5::md5_hex ($pwd_digest); - - if ($client_digest ne $pwd_digest) { - error ("Invalid password from " . $t_client_socket->sockhost () . "."); - } - - print_log ("Client " . $t_client_socket->sockhost () . " authenticated"); - send_data ("PASS OK\n"); -} - -################################################################################ -## SUB recv_file -## Receive a file of size $_[1] and save it in $t_directory as $_[0]. -################################################################################ -sub recv_file { - my $base_name = $_[0]; - my $data = ''; - my $file; - my $size = $_[1]; - - # Check file name - if ($base_name =~ /[$t_invalid_chars]/) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("SEND ERR (invalid file name)\n"); - return; - } - - # Check file size, empty files are not allowed - if ($size < 1 || $size > $t_max_size) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("SEND ERR (file is too big)\n"); - return; - } - - # Apply filters - $file = "$t_directory/" . apply_filters ($base_name) . $base_name; - - # Check if file exists - if (-f $file && $t_overwrite == 0) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("SEND ERR (file already exists)\n"); - return; - } - - send_data ("SEND OK\n"); - - # Receive file - $data = recv_data_block ($size); - - # Write it to disk - open (FILE, "> $file") || error ("Cannot open file '$file' for writing."); - binmode (FILE); - print (FILE $data); - close (FILE); - - send_data ("SEND OK\n"); - print_info ("Received file '$base_name' size ${size}b from " . $t_client_socket->sockhost ()); -} - -################################################################################ -## SUB zrecv_file -## Receive a compressed file of size $_[1] and save it in $t_directory as $_[0]. -################################################################################ -sub zrecv_file { - my $base_name = $_[0]; - my $data = ''; - my $file; - my $size = $_[1]; - my $zdata = ''; - - # Check file name - if ($base_name =~ /[$t_invalid_chars]/) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("ZSEND ERR (invalid file name)\n"); - return; - } - - # Check file size, empty files are not allowed - if ($size < 1 || $size > $t_max_size) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " is too big"); - send_data ("ZSEND ERR (file is too big)\n"); - return; - } - - # Apply filters - $file = "$t_directory/" . apply_filters ($base_name) . $base_name; - - # Check if file exists - if (-f $file && $t_overwrite == 0) { - print_log ("File '$base_name' size ${size}b from " . $t_client_socket->sockhost () . " already exists"); - send_data ("ZSEND ERR (file already exists)\n"); - return; - } - - send_data ("ZSEND OK\n"); - - # Receive file - $zdata = recv_data_block ($size); - if (!unzip(\$zdata => \$data)) { - print_log ("Uncompress error: $UnzipError"); - send_data ("ZSEND ERR\n"); - return; - } - - # Write it to disk - open (FILE, "> $file") || error ("Cannot open file '$file' for writing."); - binmode (FILE); - print (FILE $data); - close (FILE); - - send_data ("ZSEND OK\n"); - print_info ("Received compressed file '$base_name' size ${size}b from " . $t_client_socket->sockhost ()); -} - -################################################################################ -## SUB send_file -## Send a file to the client -################################################################################ -sub send_file { - my $base_name = $_[0]; - my $data = ''; - my $file; - my $response; - my $size; - - # Check file name - if ($base_name =~ /[$t_invalid_chars]/) { - print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("RECV ERR (file has an invalid file name)\n"); - return; - } - - # Apply filters - $file = "$t_directory/" . apply_filters ($base_name) . $base_name; - - # Check if file exists - if (! -f $file) { - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("RECV ERR (file does not exist)\n"); - return; - } - - $size = -s $file; - send_data ("RECV SIZE $size\n"); - - # Wait for client response - $response = recv_command ($t_block_size); - if ($response ne "RECV OK") { - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " not sent"); - return; - } - - # Send the file - open (FILE, $file) || error ("Cannot open file '$file' for reading."); - binmode (FILE); - { - local $/ = undef; - $data = ; - } - - send_data ($data); - close (FILE); - - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " sent"); -} - -################################################################################ -## SUB zsend_file -## Send a file to the client -################################################################################ -sub zsend_file { - my $base_name = $_[0]; - my $data = ''; - my $file; - my $response; - my $size; - - # Check file name - if ($base_name =~ /[$t_invalid_chars]/) { - print_log ("Requested compressed file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("ZRECV ERR (file has an invalid file name)\n"); - return; - } - - # Apply filters - $file = "$t_directory/" . apply_filters ($base_name) . $base_name; - - # Check if file exists - if (! -f $file) { - print_log ("Requested compressed '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("ZRECV ERR (file does not exist)\n"); - return; - } - - # Read the file and compress its contents - if (! zip($file => \$data)) { - send_data ("QUIT\n"); - error ("Compression error: $ZipError"); - return; - } - - $size = length($data); - send_data ("ZRECV SIZE $size\n"); - - # Wait for client response - $response = recv_command ($t_block_size); - if ($response ne "ZRECV OK") { - print_log ("Requested compressed '$file' from " . $t_client_socket->sockhost () . " not sent"); - return; - } - - # Send the file - send_data ($data); - - print_log ("Requested compressed '$file' from " . $t_client_socket->sockhost () . " sent"); -} - -################################################################################ -# Common functions -################################################################################ - -################################################################################ -## SUB print_log -## Print log messages. -################################################################################ -sub print_log($) { - - my ($msg) = @_; - - return unless ($t_log == 1); - - my $fh = *STDOUT; - if (defined($log_file)) { - open($fh, ">>", $log_file) || die("Starting log failed: $!.\n"); - } - - print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[log]$msg.\n"); - - close ($fh) if (defined($log_file)); - -} - -################################################################################ -## SUB print_log -## Print log messages. -################################################################################ -sub print_info($) { - - my ($msg) = @_; - - return unless ($t_log_hard == 1); - - my $fh = *STDOUT; - if (defined($log_file)) { - open($fh, ">>", $log_file) || die("Starting log failed: $!.\n"); - } - - print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[info]$msg.\n"); - - close ($fh) if (defined($log_file)); - -} - -################################################################################ -## SUB error -## Print an error and exit the program. -################################################################################ -sub error { - - my ($msg) = @_; - - return unless ($t_quiet == 0); - - my $fh = *STDERR; - if (defined($log_file)) { - open($fh, ">>", $log_file) || die("$!\n"); - } - - print ($fh strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "[err]$msg\n"); - - close ($fh) if (defined($log_file)); - - die("\n"); -} - -################################################################################ -## SUB move_file -## Send a file to the client and delete it -################################################################################ -sub move_file { - my $base_name = $_[0]; - my $data = ''; - my $file; - my $response; - my $size; - - # Check file name - if ($base_name =~ /[$t_invalid_chars]/) { - print_log ("Requested file '$base_name' from " . $t_client_socket->sockhost () . " has an invalid file name"); - send_data ("MV ERR\n"); - return; - } - - # Apply filters - $file = "$t_directory/" . apply_filters ($base_name) . $base_name; - - # Check if file exists - if (! -f $file) { - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " does not exist"); - send_data ("MV ERR\n"); - return; - } - - $size = -s $file; - send_data ("MV SIZE $size\n"); - - # Wait for client response - $response = recv_command ($t_block_size); - if ($response ne "MV OK") { - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " not sent"); - return; - } - - # Send the file - open (FILE, $file) || error ("Cannot open file '$file' for reading."); - binmode (FILE); - - while ($data = ) { - send_data ($data); - } - - close (FILE); - unlink($file); - - print_log ("Requested file '$file' from " . $t_client_socket->sockhost () . " sent and deleted"); -} - -################################################################################ -## SUB send_file_list -## Send a list of files to the client after applying the given filter. -################################################################################ -sub send_file_list { - my $filter = $_[0]; - my $data = ''; - my $dir; - my $dh; - my $response; - my $size; - - # Check file name - if ($filter =~ /[$t_invalid_chars]/) { - print_log ("Invalid file listing filter '$filter' from " . $t_client_socket->sockhost ()); - send_data ("LS ERR\n"); - return; - } - - # Apply filters - $dir = "$t_directory/" . apply_filters ($filter); - - # Open the directory. - if (! opendir ($dh, $dir)) { - print_log ("Error opening directory $dir as requested from " . $t_client_socket->sockhost () . ": $!"); - send_data ("LS ERR\n"); - return; - } - - # List files. - while (my $file = readdir ($dh)) { - next if ($file =~ /[$t_invalid_chars]/); # Only list files valid for Tentacle. - $data .= "$file\n"; - } - closedir $dh; - - $size = length ($data); - send_data ("LS SIZE $size\n"); - - # Wait for client response - $response = recv_command ($t_block_size); - if ($response ne "LS OK") { - print_log ("Requested directory listing from " . $t_client_socket->sockhost () . " not sent"); - return; - } - - send_data ($data); - - print_log ("Requested directory listing from " . $t_client_socket->sockhost () . " sent"); -} - -################################################################################ -## SUB recv_data_proxy -## Recv data from proxy socket. -################################################################################ -sub recv_data_proxy { - my $data; - my $read; - my $retries = 0; - my $size = $_[0]; - - while (1) { - - # Try to read data from the socket - if ($t_proxy_select->can_read ($t_timeout)) { - - # Read at most $size bytes - $read = sysread ($t_proxy_socket, $data, $size); - - # Read error - if (! defined ($read)) { - error ("Read error from " . $t_proxy_socket->sockhost () . ": $!."); - } - - # EOF - if ($read == 0) { - error ("Connection from " . $t_proxy_socket->sockhost () . " unexpectedly closed."); - } - - return ($read, $data); - } - - # Retry - $retries++; - - # But check for error conditions first - if ($retries > $t_retries) { - error ("Connection from " . $t_proxy_socket->sockhost () . " timed out."); - } - } -} -################################################################################ -## SUB recv_data -## Read data from the client socket. Returns the number of bytes read and the -## string of bytes as a two element array. -################################################################################ -sub recv_data { - my $data; - my $read; - my $retries = 0; - my $size = $_[0]; - - while (1) { - - # Try to read data from the socket - if ($t_select->can_read ($t_timeout)) { - - # Read at most $size bytes - $read = sysread ($t_client_socket, $data, $size); - - # Read error - if (! defined ($read)) { - error ("Read error from " . $t_client_socket->sockhost () . ": $!."); - } - - # EOF - if ($read == 0) { - error ("Connection from " . $t_client_socket->sockhost () . " unexpectedly closed."); - } - - return ($read, $data); - } - - # Retry - $retries++; - - # But check for error conditions first - if ($retries > $t_retries) { - error ("Connection from " . $t_client_socket->sockhost () . " timed out."); - } - } -} - -################################################################################ -## SUB send_data -## Write data to the client socket. -################################################################################ -sub send_data { - my $data = $_[0]; - my $block_size; - my $retries = 0; - my $size; - my $total = 0; - my $written; - - $size = length ($data); - - while (1) { - - # Try to write data to the socket - if ($t_select->can_write ($t_timeout)) { - - $block_size = ($size - $total) > $t_block_size ? $t_block_size : ($size - $total); - $written = syswrite ($t_client_socket, $data, $block_size, $total); - - # Write error - if (! defined ($written)) { - error ("Connection error from " . $t_client_socket->sockhost () . ": $!."); - } - - # EOF - if ($written == 0) { - error ("Connection from " . $t_client_socket->sockhost () . " unexpectedly closed."); - } - - $total += $written; - - # Check if all data was written - if ($total == $size) { - return; - } - } - # Retry - else { - $retries++; - if ($retries > $t_retries) { - error ("Connection from " . $t_client_socket->sockhost () . " timed out."); - } - } - } -} - -################################################################################ -## SUB recv_command -## Read a command from the client, ended by a new line character. -################################################################################ -sub recv_command { - my $buffer; - my $char; - my $command = ''; - my $read; - my $total = 0; - - while (1) { - - ($read, $buffer) = recv_data ($t_block_size); - $command .= $buffer; - $total += $read; - - # Check if the command is complete - $char = chop ($command); - if ($char eq "\n") { - return $command; - } - - $command .= $char; - - # Avoid overflow - if ($total > $t_block_size) { - error ("Received too much data from " . $t_client_socket->sockhost () . "."); - } - } -} - -################################################################################ -## SUB recv_data_block -## Read $_[0] bytes of data from the client. -################################################################################ -sub recv_data_block { - my $buffer = ''; - my $data = ''; - my $read; - my $size = $_[0]; - my $total = 0; - - while (1) { - - ($read, $buffer) = recv_data ($size - $total); - $data .= $buffer; - $total += $read; - - # Check if all data has been read - if ($total == $size) { - return $data; - } - } -} - -################################################################################ -## SUB ask_passwd -## Asks the user for a password. -################################################################################ -sub ask_passwd { - my $msg1 = $_[0]; - my $msg2 = $_[1]; - my $pwd1; - my $pwd2; - - require Term::ReadKey; - - # Disable keyboard echo - Term::ReadKey::ReadMode('noecho'); - - # Promt for password - print ($msg1); - $pwd1 = Term::ReadKey::ReadLine(0); - print ("\n$msg2"); - $pwd2 = Term::ReadKey::ReadLine(0); - print ("\n"); - - # Restore original settings - Term::ReadKey::ReadMode('restore'); - - if ($pwd1 ne $pwd2) { - print ("Error: passwords do not match.\n"); - exit 1; - } - - # Remove the trailing new line character - chop $pwd1; - - return $pwd1; -} - -################################################################################ -## SUB apply_filters -## Applies filters to the given file. -################################################################################ -sub apply_filters ($) { - my ($file_name) = @_; - - foreach my $filter (@t_filters) { - my ($regexp, $dir) = @{$filter}; - if ($file_name =~ /$regexp/) { - print_log ("File '$file_name' matches filter '$regexp' (changing to directory '$dir')"); - return $dir . '/'; - } - } - - return ''; -} - -################################################################################ -## SUB install_service -## Install the Windows service. -################################################################################ -sub install_service() { - - my $service_path = $0; - my $service_params = $SERVICE_PARAMS; - - # Change the service parameter from 'install' to 'run'. - $service_params =~ s/\-S\s+\S+/\-S run/; - - my %service_hash = ( - machine => '', - name => 'TENTACLESRV', - display => $SERVICE_NAME, - path => $service_path, - user => '', - pwd => '', - description => 'Tentacle Server http://sourceforge.net/projects/tentacled/', - parameters => $service_params - ); - - if (Win32::Daemon::CreateService(\%service_hash)) { - print "Successfully added.\n"; - exit 0; - } else { - print "Failed to add service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n"; - exit 1; - } -} - -################################################################################ -## SUB uninstall_service -## Install the Windows service. -################################################################################ -sub uninstall_service() { - if (Win32::Daemon::DeleteService('', 'TENTACLESRV')) { - print "Successfully deleted.\n"; - exit 0; - } else { - print "Failed to delete service: " . Win32::FormatMessage(Win32::Daemon::GetLastError()) . "\n"; - exit 1; - } -} - -################################################################################ -## SUB callback_running -## Windows service callback function for the running event. -################################################################################ -sub callback_running { - - if (Win32::Daemon::State() == WIN32_SERVICE_RUNNING) { - } -} - -################################################################################ -## SUB callback_start -## Windows service callback function for the start event. -################################################################################ -sub callback_start { - - # Accept_connections (); - my $thr = threads->create(\&accept_connections); - if (!defined($thr)) { - Win32::Daemon::State(WIN32_SERVICE_STOPPED); - Win32::Daemon::StopService(); - return; - } - $thr->detach(); - - Win32::Daemon::State(WIN32_SERVICE_RUNNING); -} - -################################################################################ -## SUB callback_stop -## Windows service callback function for the stop event. -################################################################################ -sub callback_stop { - - foreach my $t_server_socket (@t_server_sockets) { - $t_server_socket->shutdown (2); - $t_server_socket->close (); - } - - Win32::Daemon::State(WIN32_SERVICE_STOPPED); - Win32::Daemon::StopService(); -} - -################################################################################ -# Main -################################################################################ - -# Never run as root -if ($> == 0 && $^O ne 'MSWin32') { - print ("Error: for safety reasons $0 cannot be run with root privileges.\n"); - exit 1; -} - -# Parse command line options -parse_options (); - -# Check command line arguments -if ($#ARGV != -1) { - print_help (); - exit 1; -} - -# Show IPv6 status -if ($SOCKET_MODULE eq 'IO::Socket::INET') { - print_log ("IO::Socket::INET6 is not found. IPv6 is disabled."); -} - -# Run as daemon? -if ($t_daemon == 1 && $^O ne 'MSWin32') { - daemonize (); -} - -# Handle ctr-c -if ($^O eq 'MSWin32') { - no warnings; - $SIG{INT2} = \&stop_server; - use warnings; -} -else { - $SIG{INT} = \&stop_server; -} - -# Accept connections -accept_connections(); - -__END__ - -=head1 REQUIRED ARGUMENTES - -=over - -=item B<< -s F >> Root directory to store the files received by the server - -=back - -=head1 OPTIONS - -=over - -=item I<-a ip_address> Address to B on (default I<0.0.0.0>). - -=item I<-c number> B number of simultaneous B (default I<10>). - -=item I<-d> Run as B. - -=item I<-e cert> B file. Enables SSL. - -=item I<-f ca_cert> Verify that the peer certificate is signed by a B. - -=item I<-h> Show B. - -=item I<-i> B. - -=item I<-k key> B file. - -=item I<-m size> B in bytes (default I<2000000b>). - -=item I<-o> Enable file B. - -=item I<-p port> B on (default I<41121>). - -=item I<-q> B. Do now print error messages. - -=item I<-r number> B for network opertions (default I<3>). - -=item I<-t time> B for network operations in B (default I<1s>). - -=item I<-v> Be B. - -=item I<-w> Prompt for B. - -=item I<-x> pwd B. - -=back - -=head1 EXIT STATUS - -=over - -=item 0 on Success - -=item 1 on Error - -=back - -=head1 CONFIGURATION - -Tentacle doesn't use any configurationf files, all the configuration is done by the options passed when it's started. - -=head1 DEPENDENCIES - -L, L, L, L, L - - -=head1 LICENSE - -This is released under the GNU Lesser General Public License. - -=head1 SEE ALSO - -L, L, L, L, L - -Protocol description and more info at: L<< http://openideas.info/wiki/index.php?title=Tentacle >> - -=head1 COPYRIGHT - -Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L - -=cut - +run_rc_command "$1" From c0661fc1b7304507e99d9d23907e2941404af68f Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 13 Jul 2020 10:02:56 +0200 Subject: [PATCH 056/117] fixed legend max 10 modules for chart --- .../reporting/graph_builder.graph_editor.php | 16 +++++++- pandora_console/include/functions_graph.php | 40 ++++++------------- .../include/graphs/flot/pandora.flot.js | 6 +-- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index d69729eac9..1227494e91 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -190,8 +190,20 @@ if ($editGraph) { $weights = implode(',', $weight_array); } + + +$count_module_array = count($module_array); +if ($count_module_array > 10) { + ui_print_warning_message( + __( + 'The maximum number of items in a chart is 10. You have %s elements, only first 10 will be displayed.', + $count_module_array + ) + ); +} + // Modules table. -if (count($module_array) > 0) { +if ($count_module_array > 0) { echo ""; echo ' @@ -202,7 +214,7 @@ if (count($module_array) > 0) { '; $color = 0; - for ($a = 0; $a < count($module_array); $a++) { + for ($a = 0; $a < $count_module_array; $a++) { // Calculate table line color. if ($color == 1) { $tdcolor = 'datos'; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c3402237c8..05551b14b9 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1483,6 +1483,11 @@ function graphic_combined_module( continue; } + // Only 10 item for chart. + if ($i > 9) { + break; + } + if (is_metaconsole()) { $server = metaconsole_get_connection_by_id( $agent_module_id['server'] @@ -1839,15 +1844,12 @@ function graphic_combined_module( } } - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; - } - + $module = $module_item['module']; $search_in_history_db = db_search_in_history_db($datelimit); - $temp[$module] = io_safe_output(modules_get_agentmodule($module)); + $temp[$module] = io_safe_output( + modules_get_agentmodule($module) + ); $query_last_value = sprintf( ' SELECT datos @@ -1975,12 +1977,7 @@ function graphic_combined_module( } } - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; - } - + $module = $module_item['module']; $temp[$module] = modules_get_agentmodule($module); $query_last_value = sprintf( ' @@ -2102,12 +2099,7 @@ function graphic_combined_module( } } - if ($automatic_custom_graph_meta === true) { - $module = $module_item['module']; - } else { - $module = $module_item; - } - + $module = $module_item['module']; $module_data = modules_get_agentmodule($module); $query_last_value = sprintf( 'SELECT datos @@ -2243,16 +2235,10 @@ function graphic_combined_module( } } - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; - } - + $module = $module_item['module']; $data_module = modules_get_agentmodule($module); $query_last_value = sprintf( - ' - SELECT datos + 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 48aaa94ee5..3f4d4d17fe 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2432,7 +2432,7 @@ function pandoraFlotArea( if (!value[x]) { x = x + 1; } - if (value[x].min) { + if (typeof value[x].min !== "undefined" && value[x].min) { min_y_array = format_unit_yaxes(value[x].min); min_y = min_y_array["y"]; min_bigger = min_y_array["unit"]; @@ -2441,7 +2441,7 @@ function pandoraFlotArea( min_bigger = ""; } - if (value[x].max) { + if (typeof value[x].max !== "undefined" && value[x].max) { max_y_array = format_unit_yaxes(value[x].max); max_y = max_y_array["y"]; max_bigger = max_y_array["unit"]; @@ -2450,7 +2450,7 @@ function pandoraFlotArea( max_bigger = ""; } - if (value[x].avg) { + if (typeof value[x].avg !== "undefined" && value[x].avg) { avg_y_array = format_unit_yaxes(value[x].avg); avg_y = avg_y_array["y"]; avg_bigger = avg_y_array["unit"]; From 293cdc6c087bcb0ab2df604bcc886330c37088aa Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 13 Jul 2020 11:48:11 +0200 Subject: [PATCH 057/117] Fixed errors custom graph metaconsole --- pandora_console/include/functions_graph.php | 96 +++++++-------------- 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f9bcaef498..a0a06473cc 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1841,17 +1841,14 @@ function graphic_combined_module( } foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { + if (is_metaconsole() === true) { // Automatic custom graph from the report // template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } $module = $module_item['module']; @@ -1860,6 +1857,7 @@ function graphic_combined_module( $temp[$module] = io_safe_output( modules_get_agentmodule($module) ); + $query_last_value = sprintf( ' SELECT datos @@ -1924,12 +1922,8 @@ function graphic_combined_module( $temp[$module]['min'] = ($temp_min === false) ? 0 : $temp_min; - if ($config['metaconsole']) { - // Automatic custom graph from the - // report template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + if (is_metaconsole() === true) { + metaconsole_restore_db(); } } @@ -1974,17 +1968,12 @@ function graphic_combined_module( $i = 0; $number_elements = count($module_list); foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from - // the report template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } + if (is_metaconsole() === true) { + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } $module = $module_item['module']; @@ -2043,12 +2032,8 @@ function graphic_combined_module( $temp[$module]['gauge'] = uniqid('gauge_'); - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + if (is_metaconsole() === true) { + metaconsole_restore_db(); } $i++; @@ -2096,17 +2081,12 @@ function graphic_combined_module( case CUSTOM_GRAPH_VBARS: $label = ''; foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; if (is_metaconsole() === true) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[$i]) === true) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } $module = $module_item['module']; @@ -2158,11 +2138,7 @@ function graphic_combined_module( } if (is_metaconsole() === true) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0]) === true) { - metaconsole_restore_db(); - } + metaconsole_restore_db(); } } @@ -2232,17 +2208,12 @@ function graphic_combined_module( case CUSTOM_GRAPH_PIE: $total_modules = 0; foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } + if (is_metaconsole() === true) { + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } $module = $module_item['module']; @@ -2293,12 +2264,9 @@ function graphic_combined_module( 'value' => $value, 'unit' => $data_module['unit'], ]; - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + + if (is_metaconsole() === true) { + metaconsole_restore_db(); } } From f3ad52e0faa085c22601aa64c66d9dd7629f0987 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 13 Jul 2020 12:23:46 +0200 Subject: [PATCH 058/117] Ent 5532 edicion creacion de templates acciones comandos modo centralizado --- .../godmode/alerts/alert_actions.php | 30 +- .../godmode/alerts/alert_commands.php | 177 ++++++-- .../godmode/alerts/alert_templates.php | 95 ++-- .../godmode/alerts/configure_alert_action.php | 126 ++++-- .../alerts/configure_alert_command.php | 162 +++++-- .../alerts/configure_alert_template.php | 417 +++++++++++++----- pandora_console/include/functions_html.php | 34 +- 7 files changed, 788 insertions(+), 253 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 672470397a..f4502c1413 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -171,6 +171,11 @@ if ($delete_action) { ); } +if (is_central_policies_on_node() === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} $search_string = (string) get_parameter('search_string', ''); $group = (int) get_parameter('group', 0); @@ -224,8 +229,11 @@ $table->data = []; $table->head = []; $table->head[0] = __('Name'); $table->head[1] = __('Group'); -$table->head[2] = __('Copy'); -$table->head[3] = __('Delete'); +if (is_central_policies_on_node() === false) { + $table->head[2] = __('Copy'); + $table->head[3] = __('Delete'); +} + $table->style = []; $table->style[0] = 'font-weight: bold'; $table->size = []; @@ -292,7 +300,9 @@ foreach ($actions as $action) { ); } - if (check_acl($config['id_user'], $action['id_group'], 'LM')) { + if (is_central_policies_on_node() === false + && check_acl($config['id_user'], $action['id_group'], 'LM') + ) { $table->cellclass[] = [ 2 => 'action_buttons', 3 => 'action_buttons', @@ -318,12 +328,14 @@ if (isset($data)) { ui_print_info_message(['no_close' => true, 'message' => __('No alert actions configured') ]); } -echo '
'; -echo '
'; -html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); -html_print_input_hidden('create_alert', 1); -echo ''; -echo '
'; +if (is_central_policies_on_node() === false) { + echo '
'; + echo '
'; + html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); + html_print_input_hidden('create_alert', 1); + echo ''; + echo '
'; +} enterprise_hook('close_meta_frame'); ?> diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index f14cc37902..5df94f29c3 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -46,6 +46,8 @@ if (is_ajax()) { $id = (int) get_parameter('id', 0); $get_recovery_fields = (int) get_parameter('get_recovery_fields', 1); + $is_central_policies_on_node = is_central_policies_on_node(); + // If command ID is not provided, check for action id. if ($id == 0) { $id_action = (int) get_parameter('id_action'); @@ -124,40 +126,142 @@ if (is_ajax()) { // HTML type. if (preg_match('/^_html_editor_$/i', $field_value)) { $editor_type_chkbx = '
'; - $editor_type_chkbx .= __('Basic').ui_print_help_tip(__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels:
'), true);
-                    $editor_type_chkbx .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_value')", '', true);
+                    $editor_type_chkbx .= __('Basic');
+                    $editor_type_chkbx .= ui_print_help_tip(
+                        __('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: 
'),
+                        true
+                    );
+                    $editor_type_chkbx .= html_print_radio_button_extended(
+                        'editor_type_value_'.$i,
+                        0,
+                        '',
+                        false,
+                        $is_central_policies_on_node,
+                        "removeTinyMCE('textarea_field".$i."_value')",
+                        '',
+                        true
+                    );
                     $editor_type_chkbx .= '    ';
                     $editor_type_chkbx .= __('Advanced').'  ';
-                    $editor_type_chkbx .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."_value')", '', true);
+                    $editor_type_chkbx .= html_print_radio_button_extended(
+                        'editor_type_value_'.$i,
+                        0,
+                        '',
+                        true,
+                        $is_central_policies_on_node,
+                        "addTinyMCE('textarea_field".$i."_value')",
+                        '',
+                        true
+                    );
                     $editor_type_chkbx .= '
'; $ffield = $editor_type_chkbx; - $ffield .= html_print_textarea('field'.$i.'_value', 1, 1, '', 'class="fields"', true); + $ffield .= html_print_textarea( + 'field'.$i.'_value', + 1, + 1, + '', + 'class="fields"', + true, + '', + $is_central_policies_on_node + ); $editor_type_chkbx = '
'; $editor_type_chkbx .= __('Basic').'  '; - $editor_type_chkbx .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_recovery_value')", '', true); + $editor_type_chkbx .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + false, + $is_central_policies_on_node, + "removeTinyMCE('textarea_field".$i."_recovery_value')", + '', + true + ); $editor_type_chkbx .= '    '; $editor_type_chkbx .= __('Advanced').'  '; - $editor_type_chkbx .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."_recovery_value')", '', true); + $editor_type_chkbx .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + true, + $is_central_policies_on_node, + "addTinyMCE('textarea_field".$i."_recovery_value')", + '', + true + ); $editor_type_chkbx .= '
'; $rfield = $editor_type_chkbx; - $rfield .= html_print_textarea('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true); + $rfield .= html_print_textarea( + 'field'.$i.'_recovery_value', + 1, + 1, + '', + 'class="fields_recovery"', + true, + '', + $is_central_policies_on_node + ); } else if (preg_match('/^_content_type_$/i', $field_value)) { $editor_type_chkbx = '
'; - $editor_type_chkbx .= __('Text/plain').ui_print_help_tip(__('For sending emails only text plain'), true); - $editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= __('Text/plain'); + $editor_type_chkbx .= ui_print_help_tip( + __('For sending emails only text plain'), + true + ); + $editor_type_chkbx .= html_print_radio_button_extended( + 'field'.$i.'_value', + 'text/plain', + '', + '', + $is_central_policies_on_node, + '', + '', + true + ); $editor_type_chkbx .= '    '; $editor_type_chkbx .= __('Text/html').'  '; - $editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= html_print_radio_button_extended( + 'field'.$i.'_value', + 'text/html', + '', + 'text/html', + $is_central_policies_on_node, + '', + '', + true + ); $editor_type_chkbx .= '
'; $ffield = $editor_type_chkbx; $editor_type_chkbx = '
'; - $editor_type_chkbx .= __('Text/plain').ui_print_help_tip(__('For sending emails only text plain'), true); - $editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_recovery_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= __('Text/plain'); + $editor_type_chkbx .= ui_print_help_tip( + __('For sending emails only text plain'), + true + ); + $editor_type_chkbx .= html_print_radio_button_extended( + 'field'.$i.'_recovery_value', + 'text/plain', + '', + '', + $is_central_policies_on_node, + '', + '', + true + ); $editor_type_chkbx .= '    '; $editor_type_chkbx .= __('Text/html').'  '; - $editor_type_chkbx .= html_print_radio_button_extended('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= html_print_radio_button_extended( + 'field'.$i.'_recovery_value', + 'text/html', + '', + 'text/html', + $is_central_policies_on_node, + '', + '', + true + ); $editor_type_chkbx .= '
'; $rfield = $editor_type_chkbx; // Select type. @@ -192,7 +296,8 @@ if (is_ajax()) { true, false, false, - 'fields' + 'fields', + $is_central_policies_on_node ); $rfield = html_print_select( $fields_value_select, @@ -204,7 +309,8 @@ if (is_ajax()) { true, false, false, - 'fields_recovery' + 'fields_recovery', + $is_central_policies_on_node ); } else { $ffield = html_print_textarea( @@ -213,7 +319,9 @@ if (is_ajax()) { 1, $fv[0], 'style="min-height:40px; '.$style.'" class="fields"', - true + true, + '', + $is_central_policies_on_node ); $rfield = html_print_textarea( 'field'.$i.'_recovery_value', @@ -221,7 +329,9 @@ if (is_ajax()) { 1, $fv[0], 'style="min-height:40px; '.$style.'" class="fields_recovery', - true + true, + '', + $is_central_policies_on_node ); } } @@ -232,7 +342,9 @@ if (is_ajax()) { 1, '', 'style="min-height:40px; '.$style.'" class="fields"', - true + true, + '', + $is_central_policies_on_node ); $rfield = html_print_textarea( 'field'.$i.'_recovery_value', @@ -240,7 +352,9 @@ if (is_ajax()) { 1, '', 'style="min-height:40px; '.$style.'" class="fields_recovery"', - true + true, + '', + $is_central_policies_on_node ); } @@ -404,6 +518,15 @@ if ($copy_command) { } } +$is_central_policies_on_node = is_central_policies_on_node(); + +if ($is_central_policies_on_node === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} + +$table = new stdClass; $table->width = '100%'; $table->class = 'info_table'; @@ -457,7 +580,7 @@ foreach ($commands as $command) { ); $data['action'] = ''; $table->cellclass[]['action'] = 'action_buttons'; - if (! $command['internal']) { + if ($is_central_policies_on_node === false && !$command['internal']) { $data['action'] = ''; $data['action'] .= ''.html_print_image('images/copy.png', true).''; @@ -475,11 +598,13 @@ if (count($table->data) > 0) { ui_print_info_message(['no_close' => true, 'message' => __('No alert commands configured') ]); } -echo '
'; -echo '
'; -html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); -html_print_input_hidden('create_alert', 1); -echo ''; -echo '
'; +if ($is_central_policies_on_node === false) { + echo '
'; + echo '
'; + html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); + html_print_input_hidden('create_alert', 1); + echo ''; + echo '
'; +} enterprise_hook('close_meta_frame'); diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 4147367379..150245acaf 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -125,13 +125,13 @@ if (defined('METACONSOLE')) { $sec = 'galertas'; } -// This prevents to duplicate the header in case delete_templete action is performed +// This prevents to duplicate the header in +// case delete_templete action is performed. if (!$delete_template) { - // Header + // Header. if (defined('METACONSOLE')) { alerts_meta_print_header(); } else { - // ~ ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/gm_alerts.png", false, "alerts_config", true); ui_print_page_header( __('Alerts').' » '.__('Alert templates'), 'images/gm_alerts.png', @@ -142,7 +142,6 @@ if (!$delete_template) { } } - if ($update_template) { $id = (int) get_parameter('id'); @@ -151,7 +150,7 @@ if ($update_template) { $fields_recovery = []; for ($i = 1; $i <= 10; $i++) { $values['field'.$i] = (string) get_parameter('field'.$i); - $values['field'.$i.'_recovery'] = $recovery_notify ? (string) get_parameter('field'.$i.'_recovery') : ''; + $values['field'.$i.'_recovery'] = ($recovery_notify) ? (string) get_parameter('field'.$i.'_recovery') : ''; } $values['recovery_notify'] = $recovery_notify; @@ -164,13 +163,15 @@ if ($update_template) { ); } -// If user tries to delete a template with group=ALL then must have "PM" access privileges +// If user tries to delete a template with group=ALL +// then must have "PM" access privileges. if ($delete_template) { $id = get_parameter('id'); $al_template = alerts_get_alert_template($id); if ($al_template !== false) { - // If user tries to delete a template with group=ALL then must have "PM" access privileges + // If user tries to delete a template with group=ALL + // then must have "PM" access privileges. if ($al_template['id_group'] == 0) { if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( @@ -192,8 +193,7 @@ if ($delete_template) { ); } } - } //end if - else { + } else { $own_info = get_user_info($config['id_user']); if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { $own_groups = array_keys(users_get_groups($config['id_user'], 'LM')); @@ -202,7 +202,7 @@ if ($delete_template) { } $is_in_group = in_array($al_template['id_group'], $own_groups); - // Then template group have to be is his own groups + // Then template group have to be is his own groups. if ($is_in_group) { if (defined('METACONSOLE')) { alerts_meta_print_header(); @@ -241,9 +241,15 @@ if ($delete_template) { $result = alerts_delete_alert_template($id); if ($result) { - db_pandora_audit('Template alert management', 'Delete alert template #'.$id); + db_pandora_audit( + 'Template alert management', + 'Delete alert template #'.$id + ); } else { - db_pandora_audit('Template alert management', 'Fail try to delete alert template #'.$id); + db_pandora_audit( + 'Template alert management', + 'Fail try to delete alert template #'.$id + ); } ui_print_result_message( @@ -253,6 +259,11 @@ if ($delete_template) { ); } +if (is_central_policies_on_node() === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} $search_string = (string) get_parameter('search_string'); $search_type = (string) get_parameter('search_type'); @@ -269,7 +280,7 @@ $url = ui_get_url_refresh( $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; -if (defined('METACONSOLE')) { +if (is_metaconsole() === true) { $table->cellspacing = 0; $table->cellpadding = 0; } @@ -313,7 +324,7 @@ $table->data[0][4] .= html_print_submit_button( ); $table->data[0][4] .= ''; -if (defined('METACONSOLE')) { +if (is_metaconsole() === true) { $filter = '
'; $filter .= html_print_table($table, true); $filter .= ''; @@ -394,18 +405,34 @@ foreach ($templates as $template) { $data[1] = ui_print_group_icon($template['id_group'], true); $data[3] = alerts_get_alert_templates_type_name($template['type']); - if (check_acl($config['id_user'], $template['id_group'], 'LM')) { + if (is_central_policies_on_node() === false + && check_acl($config['id_user'], $template['id_group'], 'LM') + ) { $table->cellclass[][4] = 'action_buttons'; $data[4] = '
'; $data[4] .= html_print_input_hidden('duplicate_template', 1, true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true); - $data[4] .= html_print_input_image('dup', 'images/copy.png', 1, '', true, ['title' => __('Duplicate')]); + $data[4] .= html_print_input_image( + 'dup', + 'images/copy.png', + 1, + '', + true, + ['title' => __('Duplicate')] + ); $data[4] .= ' '; $data[4] .= '
'; $data[4] .= html_print_input_hidden('delete_template', 1, true); $data[4] .= html_print_input_hidden('id', $template['id'], true); - $data[4] .= html_print_input_image('del', 'images/cross.png', 1, '', true, ['title' => __('Delete')]); + $data[4] .= html_print_input_image( + 'del', + 'images/cross.png', + 1, + '', + true, + ['title' => __('Delete')] + ); $data[4] .= ' '; } else { $data[4] = ''; @@ -415,18 +442,34 @@ foreach ($templates as $template) { } ui_pagination($total_templates, $url); -if (isset($data)) { +if (isset($data) === true) { html_print_table($table); - ui_pagination($total_templates, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); + ui_pagination( + $total_templates, + $url, + 0, + 0, + false, + 'offset', + true, + 'pagination-bottom' + ); } else { - ui_print_info_message(['no_close' => true, 'message' => __('No alert templates defined') ]); + ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('No alert templates defined'), + ] + ); } -echo '
'; -echo '
'; -html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); -html_print_input_hidden('create_alert', 1); -echo ''; -echo '
'; +if (is_central_policies_on_node() === false) { + echo '
'; + echo '
'; + html_print_submit_button(__('Create'), 'create', false, 'class="sub next"'); + html_print_input_hidden('create_alert', 1); + echo ''; + echo '
'; +} enterprise_hook('close_meta_frame'); diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 3d39941bf8..da68135ad3 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -80,12 +80,20 @@ if ($al_action !== false) { } +$is_central_policies_on_node = is_central_policies_on_node(); + +if ($is_central_policies_on_node === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} + + $name = ''; $id_command = ''; $group = 0; -// All group is 0 $action_threshold = 0; -// All group is 0 +// All group is 0. if ($id) { $action = alerts_get_alert_action($id); $name = $action['name']; @@ -95,7 +103,7 @@ if ($id) { $action_threshold = $action['action_threshold']; } -// Hidden div with help hint to fill with javascript +// Hidden div with help hint to fill with javascript. html_print_div( [ 'id' => 'help_alert_macros_hint', @@ -126,7 +134,26 @@ $table->size = []; $table->size[0] = '20%'; $table->data = []; $table->data[0][0] = __('Name'); -$table->data[0][1] = html_print_input_text('name', $name, '', 35, 255, true); +$table->data[0][1] = html_print_input_text( + 'name', + $name, + '', + 35, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node +); + if (io_safe_output($name) == 'Monitoring Event') { $table->data[0][1] .= '  '.ui_print_help_tip( __('This action may stop working, if you change its name.'), @@ -141,7 +168,21 @@ $table->data[1][0] = __('Group'); $own_info = get_user_info($config['id_user']); -$table->data[1][1] = html_print_select_groups(false, 'LW', true, 'group', $group, '', '', 0, true); +$table->data[1][1] = html_print_select_groups( + false, + 'LW', + true, + 'group', + $group, + '', + '', + 0, + true, + false, + true, + '', + $is_central_policies_on_node +); $table->colspan[1][1] = 2; $table->data[2][0] = __('Command'); @@ -163,10 +204,15 @@ $table->data[2][1] = html_print_select_from_sql( '', __('None'), 0, - true + true, + false, + false, + $is_central_policies_on_node ); $table->data[2][1] .= ' '; -if (check_acl($config['id_user'], 0, 'PM')) { +if ($is_central_policies_on_node === false + && check_acl($config['id_user'], 0, 'PM') +) { $table->data[2][1] .= __('Create Command'); $table->data[2][1] .= ''; $table->data[2][1] .= html_print_image('images/add.png', true); @@ -188,7 +234,7 @@ $table->data[3][1] = html_print_extended_select_for_time( false, true, '', - false, + $is_central_policies_on_node, false, '', false, @@ -251,46 +297,44 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { echo '
'; $table_html = html_print_table($table, true); -// -// Hack to hook the bubble dialog of clippy in any place, the intro.js -// fails with new elements in the dom from javascript code -// ---------------------------------------------------------------------- -/* - $table_html = str_replace( - "
'.__('P.').''.__('Delete').' '.__('Sort').'
", - "
", - $table_html); - $table_html = str_replace( - '
-
- - - ", - $table_html); -*/ -// echo $table_html; - -echo '
'; -if ($id) { - html_print_input_hidden('id', $id); - if ($al_action['id_group'] == 0) { - // then must have "PM" access privileges - if (check_acl($config['id_user'], 0, 'PM')) { +if ($is_central_policies_on_node === false) { + echo '
'; + if ($id) { + html_print_input_hidden('id', $id); + if ($al_action['id_group'] == 0) { + // Then must have "PM" access privileges. + if (check_acl($config['id_user'], 0, 'PM')) { + html_print_input_hidden('update_action', 1); + html_print_submit_button( + __('Update'), + 'create', + false, + 'class="sub upd"' + ); + } + } else { html_print_input_hidden('update_action', 1); - html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); + html_print_submit_button( + __('Update'), + 'create', + false, + 'class="sub upd"' + ); } } else { - html_print_input_hidden('update_action', 1); - html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); + html_print_input_hidden('create_action', 1); + html_print_submit_button( + __('Create'), + 'create', + false, + 'class="sub wand"' + ); } -} else { - html_print_input_hidden('create_action', 1); - html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"'); + + echo '
'; } -echo '
'; echo ''; enterprise_hook('close_meta_frame'); diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index 417564e5f2..2091a9ee54 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -36,7 +36,7 @@ $pure = get_parameter('pure', 0); $alert = []; // Header. -if (defined('METACONSOLE')) { +if (is_metaconsole() === true) { alerts_meta_print_header(); } else { ui_print_page_header( @@ -135,30 +135,39 @@ if ($id) { $fields_hidden = $alert['fields_hidden']; } -if (!empty($fields_descriptions)) { +if (empty($fields_descriptions) === false) { $fields_descriptions = json_decode($fields_descriptions, true); } -if (!empty($fields_values)) { +if (empty($fields_values) === false) { $fields_values = json_decode($fields_values, true); } -if (!empty($fields_hidden)) { +if (empty($fields_hidden) === false) { $fields_hidden = json_decode($fields_hidden, true); } + +$is_central_policies_on_node = is_central_policies_on_node(); + +if ($is_central_policies_on_node === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} + $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; -if (defined('METACONSOLE')) { +if (is_metaconsole() === true) { $table->head[0] = ($id) ? __('Update Command') : __('Create Command'); $table->head_colspan[0] = 4; $table->headstyle[0] = 'text-align: center'; } $table->style = []; -if (!defined('METACONSOLE')) { +if (is_metaconsole() === false) { $table->style[0] = 'font-weight: bold'; $table->style[2] = 'font-weight: bold'; $table->style[4] = 'font-weight: bold'; @@ -170,11 +179,38 @@ $table->data = []; $table->colspan['name'][1] = 3; $table->data['name'][0] = __('Name'); -$table->data['name'][2] = html_print_input_text('name', $name, '', 35, 255, true); +$table->data['name'][2] = html_print_input_text( + 'name', + $name, + '', + 35, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node +); $table->colspan['command'][1] = 3; $table->data['command'][0] = __('Command'); -$table->data['command'][1] = html_print_textarea('command', 8, 30, $command, '', true); +$table->data['command'][1] = html_print_textarea( + 'command', + 8, + 30, + $command, + '', + true, + '', + $is_central_policies_on_node +); $table->colspan['group'][1] = 3; $table->data['group'][0] = __('Group'); @@ -187,60 +223,124 @@ $table->data['group'][1] = html_print_select_groups( false, '', 0, - true + true, + false, + true, + '', + $is_central_policies_on_node ); $table->colspan['description'][1] = 3; $table->data['description'][0] = __('Description'); -$table->data['description'][1] = html_print_textarea('description', 10, 30, $description, '', true); +$table->data['description'][1] = html_print_textarea( + 'description', + 10, + 30, + $description, + '', + true, + '', + $is_central_policies_on_node +); for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $table->data['field'.$i][0] = sprintf(__('Field %s description'), $i); - if (!empty($fields_descriptions)) { + if (empty($fields_descriptions) === false) { $field_description = $fields_descriptions[($i - 1)]; } else { $field_description = ''; } - $table->data['field'.$i][1] = html_print_input_text('field'.$i.'_description', $field_description, '', 30, 255, true); + $table->data['field'.$i][1] = html_print_input_text( + 'field'.$i.'_description', + $field_description, + '', + 30, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node + ); - $table->data['field'.$i][2] = sprintf(__('Field %s values'), $i).ui_print_help_tip(__('value1,tag1;value2,tag2;value3,tag3'), true); + $table->data['field'.$i][2] = sprintf(__('Field %s values'), $i); + $table->data['field'.$i][2] .= ui_print_help_tip( + __('value1,tag1;value2,tag2;value3,tag3'), + true + ); - if (!empty($fields_values)) { + if (empty($fields_values) === false) { $field_values = $fields_values[($i - 1)]; } else { $field_values = ''; } - if (!empty($fields_hidden)) { + if (empty($fields_hidden) === false) { $selected = (bool) $fields_hidden[($i - 1)]; } else { $selected = false; } - $table->data['field'.$i][3] = html_print_input_text('field'.$i.'_values', $field_values, '', 55, 255, true, false, false, '', 'field_value'); + $table->data['field'.$i][3] = html_print_input_text( + 'field'.$i.'_values', + $field_values, + '', + 55, + 255, + true, + false, + false, + '', + 'field_value', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node + ); $table->data['field'.$i][4] = __('Hide'); - $table->data['field'.$i][5] = html_print_checkbox_extended('field'.$i.'_hide', 1, $selected, false, 'cursor: \'pointer\'', 'class="hide_inputs"', true); + $table->data['field'.$i][5] = html_print_checkbox_extended( + 'field'.$i.'_hide', + 1, + $selected, + $is_central_policies_on_node, + 'cursor: \'pointer\'', + 'class="hide_inputs"', + true + ); } echo ''; html_print_table($table); -echo '
'; -if ($id) { - html_print_input_hidden('id', $id); - html_print_input_hidden('update_command', 1); - html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); -} else { - html_print_input_hidden('create_command', 1); - html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"'); +if ($is_central_policies_on_node === false) { + echo '
'; + if ($id) { + html_print_input_hidden('id', $id); + html_print_input_hidden('update_command', 1); + html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"'); + } else { + html_print_input_hidden('create_command', 1); + html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"'); + } + + echo '
'; } -echo '
'; echo ''; enterprise_hook('close_meta_frame'); @@ -251,20 +351,20 @@ $(document).ready (function () { $(".hide_inputs").each(function(index) { var $input_in_row = $(this).closest('tr').find('.field_value'); - if($(this).is(':checked')) { + if($(this).is(':checked')) { $input_in_row.prop('style', '-webkit-text-security: disc;'); - } else { + } else { $input_in_row.prop('style', ''); } }); $(".hide_inputs").click(function() { var $input_in_row = $(this).closest('tr').find('.field_value'); - if($(this).is(':checked')) { + if($(this).is(':checked')) { $input_in_row.prop('style', '-webkit-text-security: disc;'); - } else { + } else { $input_in_row.prop('style', ''); - } + } }); }); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 26e7a69073..f9f8876e9c 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -363,7 +363,15 @@ function update_template($step) } -// We set here the number of steps +$is_central_policies_on_node = is_central_policies_on_node(); + +if ($is_central_policies_on_node === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} + +// We set here the number of steps. define('LAST_STEP', 3); $step = (int) get_parameter('step', 1); @@ -579,27 +587,74 @@ if ($step == 2) { $show_matches = false; } - // Firing conditions and events + // Firing conditions and events. $table->colspan = []; - // $table->colspan[4][1] = 1; $table->data[0][0] = __('Days of week'); $table->data[0][1] = __('Mon'); - $table->data[0][1] .= html_print_checkbox('monday', 1, $monday, true); + $table->data[0][1] .= html_print_checkbox( + 'monday', + 1, + $monday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Tue'); - $table->data[0][1] .= html_print_checkbox('tuesday', 1, $tuesday, true); + $table->data[0][1] .= html_print_checkbox( + 'tuesday', + 1, + $tuesday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Wed'); - $table->data[0][1] .= html_print_checkbox('wednesday', 1, $wednesday, true); + $table->data[0][1] .= html_print_checkbox( + 'wednesday', + 1, + $wednesday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Thu'); - $table->data[0][1] .= html_print_checkbox('thursday', 1, $thursday, true); + $table->data[0][1] .= html_print_checkbox( + 'thursday', + 1, + $thursday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Fri'); - $table->data[0][1] .= html_print_checkbox('friday', 1, $friday, true); + $table->data[0][1] .= html_print_checkbox( + 'friday', + 1, + $friday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Sat'); - $table->data[0][1] .= html_print_checkbox('saturday', 1, $saturday, true); + $table->data[0][1] .= html_print_checkbox( + 'saturday', + 1, + $saturday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Sun'); - $table->data[0][1] .= html_print_checkbox('sunday', 1, $sunday, true); + $table->data[0][1] .= html_print_checkbox( + 'sunday', + 1, + $sunday, + true, + $is_central_policies_on_node + ); $table->data[0][2] = __('Use special days list'); - $table->data[0][3] = html_print_checkbox('special_day', 1, $special_day, true); + $table->data[0][3] = html_print_checkbox( + 'special_day', + 1, + $special_day, + true, + $is_central_policies_on_node + ); $table->data[1][0] = __('Time from'); $table->data[1][1] = html_print_input_text( @@ -608,7 +663,18 @@ if ($step == 2) { '', 7, 8, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->data[1][2] = __('Time to'); $table->data[1][3] = html_print_input_text( @@ -617,7 +683,18 @@ if ($step == 2) { '', 7, 8, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->colspan['threshold'][1] = 3; @@ -629,7 +706,11 @@ if ($step == 2) { '', '', false, - true + true, + false, + true, + '', + $is_central_policies_on_node ); $table->data[3][0] = __('Min. number of alerts'); @@ -639,11 +720,32 @@ if ($step == 2) { '', 5, 7, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); - $table->data[3][2] = __('Reset counter for non-sustained alerts').ui_print_help_tip(__('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'), true); - $table->data[3][3] = html_print_checkbox('min_alerts_reset_counter', 1, $min_alerts_reset_counter, true); + $table->data[3][2] = __('Reset counter for non-sustained alerts'); + $table->data[3][2] .= ui_print_help_tip( + __('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'), + true + ); + $table->data[3][3] = html_print_checkbox( + 'min_alerts_reset_counter', + 1, + $min_alerts_reset_counter, + true, + $is_central_policies_on_node + ); $table->data[4][0] = __('Max. number of alerts'); $table->data[4][1] = html_print_input_text( @@ -652,39 +754,43 @@ if ($step == 2) { '', 5, 7, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->data[4][2] = __('Disable event'); - $table->data[4][3] = html_print_checkbox('disable_event', 1, $disable_event, true); + $table->data[4][3] = html_print_checkbox( + 'disable_event', + 1, + $disable_event, + true, + $is_central_policies_on_node + ); $table->data[5][0] = __('Default action'); - $usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true))); - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - $sql_query = sprintf( - ' - SELECT id, name - FROM talert_actions - WHERE id_group IN (%s) - ORDER BY name', - $usr_groups - ); - break; + $usr_groups = implode( + ',', + array_keys(users_get_groups($config['id_user'], 'LM', true)) + ); - case 'oracle': - $sql_query = sprintf( - ' - SELECT id, - dbms_lob.substr(name,4000,1) AS nombre - FROM talert_actions - WHERE id_group IN (%s) - ORDER BY dbms_lob.substr(name,4000,1)', - $usr_groups - ); - break; - } + $sql_query = sprintf( + ' + SELECT id, name + FROM talert_actions + WHERE id_group IN (%s) + ORDER BY name', + $usr_groups + ); $table->data[5][1] = html_print_select_from_sql( $sql_query, @@ -696,11 +802,12 @@ if ($step == 2) { true, false, false, - false, + $is_central_policies_on_node, false, false, 0 - ).ui_print_help_tip( + ); + $table->data[5][1] .= ui_print_help_tip( __('Unless they\'re left blank, the fields from the action will override those set on the template.'), true ); @@ -715,7 +822,9 @@ if ($step == 2) { 0, true, false, - false + false, + '', + $is_central_policies_on_node ); $table->data[6][1] .= ''; $table->data[6][1] .= ' '.html_print_checkbox('matches_value', 1, $matches, true); @@ -760,7 +869,7 @@ if ($step == 2) { $table->data['value'][1] .= ''; $table->colspan['value'][1] = 3; - // Min first, then max, that's more logical + // Min first, then max, that's more logical. $table->data['min'][0] = __('Min.'); $table->data['min'][1] = html_print_input_text( 'min', @@ -798,25 +907,12 @@ if ($step == 2) { $table->size[1] = '45%'; $table->size[2] = '45%'; - // Alert recover + // Alert recover. if (! $recovery_notify) { $table->cellstyle['label_fields'][2] = 'display:none;'; for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $table->cellstyle['field'.$i][2] = 'display:none;'; } - - /* - $table->cellstyle['field1'][2] = 'display:none;'; - $table->cellstyle['field2'][2] = 'display:none;'; - $table->cellstyle['field3'][2] = 'display:none;'; - $table->cellstyle['field4'][2] = 'display:none;'; - $table->cellstyle['field5'][2] = 'display:none;'; - $table->cellstyle['field6'][2] = 'display:none;'; - $table->cellstyle['field7'][2] = 'display:none;'; - $table->cellstyle['field8'][2] = 'display:none;'; - $table->cellstyle['field9'][2] = 'display:none;'; - $table->cellstyle['field10'][2] = 'display:none;'; - */ } $table->data[0][0] = __('Alert recovery'); @@ -833,7 +929,9 @@ if ($step == 2) { '', true, false, - false + false, + '', + $is_central_policies_on_node ); $table->colspan[0][1] = 2; @@ -842,45 +940,98 @@ if ($step == 2) { $table->data['label_fields'][2] = __('Recovery fields'); for ($i = 1; $i <= $config['max_macro_fields']; $i++) { - if (isset($template[$name])) { + if (isset($template[$name]) === true) { $value = $template[$name]; } else { $value = ''; } - // $table->rowclass['field'.$i] = 'row_field'; $table->data['field'.$i][0] = sprintf(__('Field %s'), $i); - // TinyMCE - // triggering fields - // basic - $table->data['field'.$i][1] = '
'; - $table->data['field'.$i][1] .= __('Basic').'  '; - $table->data['field'.$i][1] .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."')", '', true); - // Advanced - $table->data['field'.$i][1] .= '    '; - $table->data['field'.$i][1] .= __('Advanced').'  '; - $table->data['field'.$i][1] .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."')", '', true); - $table->data['field'.$i][1] .= '
'; + // TinyMCE. + // triggering fields. + // Basic. + $table->data['field'.$i][1] = '
'; + $table->data['field'.$i][1] .= __('Basic').'  '; + $table->data['field'.$i][1] .= html_print_radio_button_extended( + 'editor_type_value_'.$i, + 0, + '', + false, + $is_central_policies_on_node, + "removeTinyMCE('textarea_field".$i."')", + '', + true + ); + // Advanced. + $table->data['field'.$i][1] .= '    '; + $table->data['field'.$i][1] .= __('Advanced').'  '; + $table->data['field'.$i][1] .= html_print_radio_button_extended( + 'editor_type_value_'.$i, + 0, + '', + true, + $is_central_policies_on_node, + "addTinyMCE('textarea_field".$i."')", + '', + true + ); + $table->data['field'.$i][1] .= '
'; - // Texarea - $table->data['field'.$i][1] .= html_print_textarea('field'.$i, 1, 1, isset($fields[$i]) ? $fields[$i] : '', 'style="min-height:40px;" class="fields"', true); + // Texarea. + $table->data['field'.$i][1] .= html_print_textarea( + 'field'.$i, + 1, + 1, + isset($fields[$i]) ? $fields[$i] : '', + 'style="min-height:40px;" class="fields"', + true, + '', + $is_central_policies_on_node + ); - // Recovery - // basic - $table->data['field'.$i][2] = '
'; - $table->data['field'.$i][2] .= __('Basic').'  '; - $table->data['field'.$i][2] .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_recovery')", '', true); - // advanced - $table->data['field'.$i][2] .= '    '; - $table->data['field'.$i][2] .= __('Advanced').'  '; - $table->data['field'.$i][2] .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."_recovery')", '', true); - $table->data['field'.$i][2] .= '
'; + // Recovery. + // Basic. + $table->data['field'.$i][2] = '
'; + $table->data['field'.$i][2] .= __('Basic').'  '; + $table->data['field'.$i][2] .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + false, + $is_central_policies_on_node, + "removeTinyMCE('textarea_field".$i."_recovery')", + '', + true + ); + // Advanced. + $table->data['field'.$i][2] .= '    '; + $table->data['field'.$i][2] .= __('Advanced').'  '; + $table->data['field'.$i][2] .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + true, + $is_central_policies_on_node, + "addTinyMCE('textarea_field".$i."_recovery')", + '', + true + ); + $table->data['field'.$i][2] .= '
'; - // Texarea - $table->data['field'.$i][2] .= html_print_textarea('field'.$i.'_recovery', 1, 1, isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', 'style="min-height:40px" class="fields"', true); + // Texarea. + $table->data['field'.$i][2] .= html_print_textarea( + 'field'.$i.'_recovery', + 1, + 1, + isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', + 'style="min-height:40px" class="fields"', + true, + '', + $is_central_policies_on_node + ); } } else { - // Step 1 by default + // Step 1 by default. $table->size = []; $table->size[0] = '20%'; $table->data = []; @@ -916,20 +1067,53 @@ if ($step == 2) { } $table->data[0][0] = __('Name'); - $table->data[0][1] = html_print_input_text('name', $name, '', 35, 255, true); + $table->data[0][1] = html_print_input_text( + 'name', + $name, + '', + 35, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node + ); $table->data[0][1] .= '  '.__('Group'); $groups = users_get_groups(); $own_info = get_user_info($config['id_user']); - // Only display group "All" if user is administrator or has "PM" privileges + // Only display group "All" if user is administrator or has "PM" privileges. if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { $display_all_group = true; } else { $display_all_group = false; } - $table->data[0][1] .= ' '.html_print_select_groups(false, 'AR', $display_all_group, 'id_group', $id_group, '', '', 0, true); + $table->data[0][1] .= ' '; + $table->data[0][1] .= html_print_select_groups( + false, + 'AR', + $display_all_group, + 'id_group', + $id_group, + '', + '', + 0, + true, + false, + true, + '', + $is_central_policies_on_node + ); $table->data[1][0] = __('Description'); @@ -939,7 +1123,9 @@ if ($step == 2) { 30, $description, '', - true + true, + '', + $is_central_policies_on_node ); $table->data[2][0] = __('Priority'); @@ -952,7 +1138,9 @@ if ($step == 2) { 0, true, false, - false + false, + '', + $is_central_policies_on_node ); if (defined('METACONSOLE')) { @@ -1000,25 +1188,32 @@ if (!$create_alert && !$create_template) { } if (!$disabled) { - if ($step >= LAST_STEP) { - html_print_submit_button(__('Finish'), 'finish', false, 'class="sub upd"'); - } else { - html_print_input_hidden('step', ($step + 1)); - if ($step == 2) { - // Javascript onsubmit to avoid min = 0 and max = 0 + if ($is_central_policies_on_node === false) { + if ($step >= LAST_STEP) { html_print_submit_button( - __('Next'), - 'next', + __('Finish'), + 'finish', false, - 'class="sub next" onclick="return check_fields_step2();"' + 'class="sub upd"' ); } else { - html_print_submit_button( - __('Next'), - 'next', - false, - 'class="sub next"' - ); + html_print_input_hidden('step', ($step + 1)); + if ($step == 2) { + // Javascript onsubmit to avoid min = 0 and max = 0 + html_print_submit_button( + __('Next'), + 'next', + false, + 'class="sub next" onclick="return check_fields_step2();"' + ); + } else { + html_print_submit_button( + __('Next'), + 'next', + false, + 'class="sub next"' + ); + } } } } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 24c9a6863b..61d86d222a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1833,13 +1833,14 @@ function html_print_input_text_extended( $alt, $size, $maxlength, - $disabled, + $readonly, $script, $attributes, $return=false, $password=false, $function='', - $autocomplete='off' + $autocomplete='off', + $disabled=false ) { static $idcounter = 0; @@ -1895,10 +1896,14 @@ function html_print_input_text_extended( $output = ' $attr_value) { if (! in_array($attribute, $valid_attrs)) { @@ -2102,7 +2107,7 @@ function html_print_input_text( $size=50, $maxlength=255, $return=false, - $disabled=false, + $readonly=false, $required=false, $function='', $class='', @@ -2111,7 +2116,8 @@ function html_print_input_text( $autofocus=false, $onKeyDown='', $formTo='', - $onKeyUp='' + $onKeyUp='', + $disabled=false ) { if ($maxlength == 0) { $maxlength = 255; @@ -2163,12 +2169,14 @@ function html_print_input_text( $alt, $size, $maxlength, - $disabled, + $readonly, '', $attr, $return, false, - $function + $function, + 'off', + $disabled ); } @@ -2661,8 +2669,16 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $ * * @return string HTML code if return parameter is true. */ -function html_print_textarea($name, $rows, $columns, $value='', $attributes='', $return=false, $class='', $disable=false) -{ +function html_print_textarea( + $name, + $rows, + $columns, + $value='', + $attributes='', + $return=false, + $class='', + $disable=false +) { $disabled = ($disable) ? 'disabled' : ''; $output = '