From bc21e8cd2b3580db8826d7d2add184a806caa570 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 30 Jul 2020 13:20:00 +0200 Subject: [PATCH 001/180] Added encoding lib to prevent errors with PAR Packer --- pandora_server/lib/PandoraFMS/PluginTools.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 97b5cad2b6..76d0bca108 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -26,6 +26,7 @@ eval "use POSIX::strftime::GNU;1" if ($^O =~ /win/i); use POSIX qw(strftime setsid floor); use MIME::Base64; use JSON qw(decode_json encode_json); +use PerlIO::encoding; use base 'Exporter'; From 77e465fff90a2df97d835de412711fac9c0d1bcc Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 11 Sep 2020 14:35:32 +0200 Subject: [PATCH 002/180] fixed errors in massive operations --- .../massive/massive_add_action_alerts.php | 24 +++++++++- .../godmode/massive/massive_add_alerts.php | 28 ++++++++--- .../massive/massive_delete_action_alerts.php | 23 ++++++++- .../massive/massive_delete_modules.php | 45 ++++++++++++++++-- .../godmode/massive/massive_edit_modules.php | 47 +++++++++++++++++-- 5 files changed, 150 insertions(+), 17 deletions(-) diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index 9abac11def..52fd5bed07 100755 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -67,10 +67,30 @@ if ($add) { $modules = get_parameter('module'); $modules_id = []; if (!empty($modules)) { + $modules_id = []; + foreach ($modules as $module) { foreach ($id_agents as $id_agent) { - $module_id = modules_get_agentmodule_id($module, $id_agent); - $modules_id[] = $module_id['id_agente_modulo']; + if ($module == '0') { + // Get all modules of agent. + $agent_modules = db_get_all_rows_filter( + 'tagente_modulo', + ['id_agente' => $id_agent], + 'id_agente_modulo' + ); + + $agent_modules_id = array_map( + function ($field) { + return $field['id_agente_modulo']; + }, + $agent_modules + ); + + $modules_id = array_merge($modules_id, $agent_modules_id); + } else { + $module_id = modules_get_agentmodule_id($module, $id_agent); + $modules_id[] = $module_id['id_agente_modulo']; + } } } diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index bf52fd0459..7ed99d8277 100755 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -106,15 +106,31 @@ function process_manage_add($id_alert_template, $id_agents, $module_names) return false; } + $modules_id = []; + foreach ($module_names as $module) { foreach ($id_agents as $id_agent) { - $module_id = modules_get_agentmodule_id($module, $id_agent); - $modules_id[] = $module_id['id_agente_modulo']; - } - } + if ($module == '0') { + // Get all modules of agent. + $agent_modules = db_get_all_rows_filter( + 'tagente_modulo', + ['id_agente' => $id_agent], + 'id_agente_modulo' + ); - if (count($module_names) == 1 && $module_names[0] == '0') { - $modules_id = agents_common_modules($id_agents, false, true); + $agent_modules_id = array_map( + function ($field) { + return $field['id_agente_modulo']; + }, + $agent_modules + ); + + $modules_id = array_merge($modules_id, $agent_modules_id); + } else { + $module_id = modules_get_agentmodule_id($module, $id_agent); + $modules_id[] = $module_id['id_agente_modulo']; + } + } } $conttotal = 0; diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index 832765d4de..5f658fade6 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -66,10 +66,29 @@ if ($delete) { $modules = (array) get_parameter('module'); $modules_id = []; if (!empty($modules)) { + $modules_id = []; foreach ($modules as $module) { foreach ($id_agents as $id_agent) { - $module_id = modules_get_agentmodule_id($module, $id_agent); - $modules_id[] = $module_id['id_agente_modulo']; + if ($module == '0') { + // Get all modules of agent. + $agent_modules = db_get_all_rows_filter( + 'tagente_modulo', + ['id_agente' => $id_agent], + 'id_agente_modulo' + ); + + $agent_modules_id = array_map( + function ($field) { + return $field['id_agente_modulo']; + }, + $agent_modules + ); + + $modules_id = array_merge($modules_id, $agent_modules_id); + } else { + $module_id = modules_get_agentmodule_id($module, $id_agent); + $modules_id[] = $module_id['id_agente_modulo']; + } } } diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 7d8d64141a..6b31331d1b 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -450,7 +450,7 @@ $table->data['form_modules_2'][1] = html_print_select( '', false, 'width:100%' -); +).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'"); $table->data['form_modules_2'][2] = __('When select modules'); $table->data['form_modules_2'][2] .= '
'; @@ -522,7 +522,8 @@ $table->data['form_agents_3'][1] = html_print_select( '', false, 'width:100%' -); +).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'"); + $table->data['form_agents_3'][2] = __('When select agents'); $table->data['form_agents_3'][2] .= '
'; $table->data['form_agents_3'][2] .= html_print_select( @@ -588,6 +589,44 @@ if ($selection_mode == 'modules') { var limit_parameters_massive = ; $(document).ready (function () { + $("#checkbox-select_all_modules").change(function() { + if( $('#checkbox-select_all_modules').prop('checked')) { + $("#module_name option").prop('selected', 'selected'); + $("#module_name").trigger('change'); + } else { + $("#module_name option").prop('selected', false); + $("#module_name").trigger('change'); + } + }); + + $("#module_name").change(function() { + var options_length = $("#module_name option").length; + var options_selected_length = $("#module_name option:selected").length; + + if (options_selected_length < options_length) { + $('#checkbox-select_all_modules').prop("checked", false); + } + }); + + $("#checkbox-select_all_agents").change(function() { + if( $('#checkbox-select_all_agents').prop('checked')) { + $("#id_agents option").prop('selected', 'selected'); + $("#id_agents").trigger('change'); + } else { + $("#id_agents option").prop('selected', false); + $("#id_agents").trigger('change'); + } + }); + + $("#id_agents").change(function() { + var options_length = $("#id_agents option").length; + var options_selected_length = $("#id_agents option:selected").length; + + if (options_selected_length < options_length) { + $('#checkbox-select_all_agents').prop("checked", false); + } + }); + $("#id_agents").change(agent_changed_by_multiple_agents); $("#module_name").change(module_changed_by_multiple_modules); @@ -680,7 +719,7 @@ $(document).ready (function () { $('#groups_select').val(-1); } - $('input[type=checkbox]').change ( + $('input[type=checkbox]').not(".static").change ( function () { if (this.id == "checkbox-force_type") { if (this.checked) { diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 9f25e16c70..3c3975778e 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -406,7 +406,8 @@ $table->data['form_modules_2'][1] = html_print_select( true, true, true -); +).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'"); + $table->data['form_modules_2'][2] = __('When select modules'); $table->data['form_modules_2'][2] .= '
'; $table->data['form_modules_2'][2] .= html_print_select( @@ -491,7 +492,7 @@ $table->data['form_agents_3'][1] = html_print_select( true, true, false -); +).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'"); $table->data['form_agents_3'][2] = __('When select agents'); $table->data['form_agents_3'][2] .= '
'; @@ -1212,7 +1213,45 @@ $(document).ready (function () { return false; } }); - + + $("#checkbox-select_all_modules").change(function() { + if( $('#checkbox-select_all_modules').prop('checked')) { + $("#module_name option").prop('selected', 'selected'); + $("#module_name").trigger('change'); + } else { + $("#module_name option").prop('selected', false); + $("#module_name").trigger('change'); + } + }); + + $("#module_name").change(function() { + var options_length = $("#module_name option").length; + var options_selected_length = $("#module_name option:selected").length; + + if (options_selected_length < options_length) { + $('#checkbox-select_all_modules').prop("checked", false); + } + }); + + $("#checkbox-select_all_agents").change(function() { + if( $('#checkbox-select_all_agents').prop('checked')) { + $("#id_agents option").prop('selected', 'selected'); + $("#id_agents").trigger('change'); + } else { + $("#id_agents option").prop('selected', false); + $("#id_agents").trigger('change'); + } + }); + + $("#id_agents").change(function() { + var options_length = $("#id_agents option").length; + var options_selected_length = $("#id_agents option:selected").length; + + if (options_selected_length < options_length) { + $('#checkbox-select_all_agents').prop("checked", false); + } + }); + $("#text-custom_ip_target").hide(); $("#id_agents").change(agent_changed_by_multiple_agents); @@ -1463,7 +1502,7 @@ $(document).ready (function () { $('#groups_select').val(-1); } - $('input[type=checkbox]').change ( + $('input[type=checkbox]').not(".static").change ( function () { if (this.id == "checkbox-force_type") { if (this.checked) { From a70fc200b7a4167b8e81828ce390fcebc64d8e1c Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Mon, 14 Sep 2020 09:27:01 +0200 Subject: [PATCH 003/180] Fixed bug in unit field --- .../agentes/module_manager_editor_common.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index b812e5b8b0..440c4b3d4a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -535,20 +535,30 @@ $table_advanced->data[0][1] = html_print_input_text( ); $table_advanced->data[0][3] = __('Unit'); -// $table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true, -// $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy); -// $table_advanced->colspan[1][4] = 3; -$table_advanced->data[0][4] = html_print_extended_select_for_unit( +$table_advanced->data[0][4] = html_print_input_text ( 'unit', $unit, '', - '', - '0', - false, + 20, + 65, true, + $disabledBecauseInPolicy, false, - false + '', + $classdisabledBecauseInPolicy ); +// $table_advanced->colspan[1][4] = 3; +//$table_advanced->data[0][4] = html_print_extended_select_for_unit( +// 'unit', +// $unit, +// '', +// '', +// '0', +// false, +// true, +// false, +// false +//); $table_advanced->colspan[0][4] = 3; $module_id_policy_module = 0; From 6a21a668bf6721d24ea5d2027c27b0b45e7afc75 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 29 Sep 2020 09:44:20 +0200 Subject: [PATCH 004/180] Added control for reveal passwords --- .../godmode/setup/setup_general.php | 7 +++++-- pandora_console/include/functions_ui.php | 20 +++++++++++++++++++ .../include/javascript/pandora_ui.js | 13 ++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 0d8ce68e8e..e4aa1181a9 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -124,7 +124,8 @@ $table->data[$i][0] = __('Phantomjs bin directory'); $table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true); $table->data[$i][0] = __('Auto login (hash) password'); -$table->data[$i++][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true); +$table->data[$i][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true); +$table->data[$i++][1] .= ui_print_reveal_password('loginhash_pwd', true); $table->data[$i][0] = __('Time source'); $sources['system'] = __('System'); @@ -162,7 +163,8 @@ if (isset($_POST['list_ACL_IPs_for_API'])) { $table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true); $table->data[$i][0] = __('API password'); -$table->data[$i++][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true); +$table->data[$i][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true); +$table->data[$i++][1] .= ui_print_reveal_password('api_password', true); $table->data[$i][0] = __('Enable GIS features'); $table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true); @@ -384,6 +386,7 @@ $table_mail_conf->data[5][1] = html_print_input_text('email_username', $config[' $table_mail_conf->data[6][0] = __('Email password'); $table_mail_conf->data[6][1] = html_print_input_password('email_password', io_output_password($config['email_password']), '', 30, 100, true); +$table_mail_conf->data[6][1] .= ui_print_reveal_password('email_password', true); $uniqid = uniqid(); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ab6079fb36..2233b2fe95 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -6124,3 +6124,23 @@ function ui_print_message_dialog($title, $text, $id='', $img='', $text_button='' echo ''; echo ''; } + + +/** + * Generate a button for reveal the content of the password field. + * + * @param string $name Name of the field. + * @param boolean $return If true, return the string with the formed element. + * + * @return string + */ +function ui_print_reveal_password(string $name, bool $return=false) +{ + $output = ' '; + + if ($return === true) { + return $output; + } + + echo $output; +} diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 2445473591..951db0e712 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -552,3 +552,16 @@ function infoMessage(data, idMsg) { }) .show(); } + +function reveal_password(name) { + var passwordElement = $("#password-" + name); + var revealElement = $("#reveal_password_" + name); + + if (passwordElement.attr("type") == "password") { + passwordElement.attr("type", "text"); + revealElement.attr("src", "images/eye_hide.png"); + } else { + passwordElement.attr("type", "password"); + revealElement.attr("src", "images/eye_show.png"); + } +} From 9d0becc0122e7029bed214d1c84bd9cb5aa7d920 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 29 Sep 2020 10:12:49 +0200 Subject: [PATCH 005/180] Added other password fields --- pandora_console/extensions/quick_shell.php | 1 + pandora_console/godmode/setup/setup_auth.php | 4 ++++ pandora_console/godmode/setup/setup_ehorus.php | 1 + pandora_console/godmode/setup/setup_integria.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 27807e6029..5505caa3af 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -468,6 +468,7 @@ function quickShellSettings() 100, true ); + $hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true); html_print_table($t); diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index db436224c3..eba3b44e0d 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -189,6 +189,10 @@ if (is_ajax()) { 100, true ); + $row['control'] .= ui_print_reveal_password( + 'ldap_admin_pass', + true + ); $table->data['ldap_admin_pass'] = $row; break; diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 1c3650418b..1c522593ee 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -82,6 +82,7 @@ $table_remote->data['ehorus_user'] = $row; $row = []; $row['name'] = __('Password'); $row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true); +$row['control'] .= ui_print_reveal_password('ehorus_pass', true); $table_remote->data['ehorus_pass'] = $row; // Directory hostname. diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index e172dda50b..0113c6f024 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -221,6 +221,7 @@ $table_remote->data['integria_user'] = $row; $row = []; $row['name'] = __('Password'); $row['control'] = html_print_input_password('integria_pass', io_output_password($config['integria_pass']), '', 30, 100, true); +$row['control'] .= ui_print_reveal_password('integria_pass', true); $table_remote->data['integria_pass'] = $row; // Integria hostname. @@ -233,6 +234,7 @@ $table_remote->data['integria_hostname'] = $row; $row = []; $row['name'] = __('API Password'); $row['control'] = html_print_input_password('integria_api_pass', io_output_password($config['integria_api_pass']), '', 30, 100, true); +$row['control'] .= ui_print_reveal_password('integria_api_pass', true); $table_remote->data['integria_api_pass'] = $row; // Request timeout. From 00b289a557f73cda6656c14aed17495a7f040800 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 29 Sep 2020 12:21:52 +0200 Subject: [PATCH 006/180] Adapt functions for work in Metaconsole --- pandora_console/include/functions_ui.php | 8 +++++++- pandora_console/include/javascript/pandora_ui.js | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 2233b2fe95..a6fe8579c0 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -6136,7 +6136,13 @@ function ui_print_message_dialog($title, $text, $id='', $img='', $text_button='' */ function ui_print_reveal_password(string $name, bool $return=false) { - $output = ' '; + if (is_metaconsole()) { + $imagePath = '../../images/'; + } else { + $imagePath = 'images/'; + } + + $output = ' '; if ($return === true) { return $output; diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 951db0e712..c2b6a86e01 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -556,12 +556,19 @@ function infoMessage(data, idMsg) { function reveal_password(name) { var passwordElement = $("#password-" + name); var revealElement = $("#reveal_password_" + name); + var imagesPath = ""; + + if ($("#hidden-metaconsole_activated").val() == 1) { + imagesPath = "../../images/"; + } else { + imagesPath = "images/"; + } if (passwordElement.attr("type") == "password") { passwordElement.attr("type", "text"); - revealElement.attr("src", "images/eye_hide.png"); + revealElement.attr("src", imagesPath + "eye_hide.png"); } else { passwordElement.attr("type", "password"); - revealElement.attr("src", "images/eye_show.png"); + revealElement.attr("src", imagesPath + "eye_show.png"); } } From 336f6924dfb2cdbba9a6174883e45074cc255cd5 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 29 Sep 2020 12:22:29 +0200 Subject: [PATCH 007/180] Added images --- pandora_console/images/eye_hide.png | Bin 0 -> 647 bytes pandora_console/images/eye_show.png | Bin 0 -> 1365 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/eye_hide.png create mode 100644 pandora_console/images/eye_show.png diff --git a/pandora_console/images/eye_hide.png b/pandora_console/images/eye_hide.png new file mode 100644 index 0000000000000000000000000000000000000000..8bed55e59977e35c254f877c03df36aedf39412b GIT binary patch literal 647 zcmV;20(kw2P)%GWaHovko20yJC5`{2QT3`qk?YwE%)BN zKR>?jdk^^Ml}e>9x%c!hVb>|8&pVyY#o0fyXi!m2qCwB04j>IMk%cUkbmXOvMflFG-|iogFqng9>69c#0FfE6-Bv4DShFA z?Q+i7RaGUN^K}54X_|;cB4{?7OS-O~&*gFtX0W+K2e#ue@{n_0cN|9n3`V07iN#`9 z%H{Go#u$3N9snG2&Mz~@_5gq=iXuDC+&WZMbt#j{yaBK#gurAn!RqSjxKgQ@jYcD= z>w3^VKZ8w64Tr-Nfaro$ zyQ->g%z?oCVrl>))9DnJWrI>IXga3|%s z00U{hPY4Tqa`c^Vg*E^*{bD4lMuXjKLQb3cBF3CcXD}Opw)R|xPYehuj0=6D zO-ZKMFz4U#g(WA^uc{fABu7R@%pIUaOgcK|Uc$MNP3m+xc>W zA`S~lzappMR)tw{j|dRuK+k6Guv31Hwpn}*#)d33L+o&q|EFps4u&j_$1~$nQsEga z9(RWy3%lzhNO)%yyc`P)m%qpR`F?m6kAcvzv)lS(rn>Lx#@{oY6O-`x z3-H<^t7!n*YH9jTy=S%yg#Ws?=2{tTxmu}yqiHV8ts@^i?XJIgdddCkkxpad`RlIz zHHDvzu3O_xH(rAIsS~$vx|(8~athpT4?WPpVeR_MH_PsRr=51r&*?(Hyq(`zYwLQ? zefPCOa|3u-)?xxRr>;wv;L@w^Gj)YQ-Mn8vAJ;d}AIE?u&-w=_xR~!)o6*pdu`3g_ zDL*>7aj&vE#$D(<9E%q$uA{Ssv-d0F6~rT3`9p0Ctj_6brlOXrGx~X*;m%{7@1(PO zA6$3>f~kEgde6DfzHq)$ literal 0 HcmV?d00001 From cc3189196c7c28ad79826e8dc32d276952cc8b1c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 5 Oct 2020 12:45:26 +0200 Subject: [PATCH 008/180] Fix secondary groups match while group filtering --- pandora_console/include/functions_events.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 4247a1868a..ecdb92a528 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1063,6 +1063,7 @@ function events_get_all( } } + $_tmp = ''; foreach ($tags as $id_tag) { if (!isset($tags_names[$id_tag])) { $tags_names[$id_tag] = tags_get_name($id_tag); @@ -1304,6 +1305,7 @@ function events_get_all( $tgrupo_join = 'LEFT'; $tgrupo_join_filters = []; + if (isset($groups) && (is_array($groups) || $groups > 0) @@ -1311,17 +1313,21 @@ function events_get_all( $tgrupo_join = 'INNER'; if (is_array($groups)) { $tgrupo_join_filters[] = sprintf( - ' AND (tg.id_grupo IN (%s) OR tasg.id_group IN (%s))', + ' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s)))', join(', ', $groups), join(', ', $groups) ); } else { $tgrupo_join_filters[] = sprintf( - ' AND (tg.id_grupo = %s OR tasg.id_group = %s)', + ' (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s) + OR (te.id_agente = tasg.id_agent AND tasg.id_group = %s)', $groups, $groups ); } + } else { + $tgrupo_join_filters[] = ' te.id_grupo = tg.id_grupo'; } $server_join = ''; @@ -1376,8 +1382,7 @@ function events_get_all( %s %s %s JOIN tgrupo tg - ON te.id_grupo = tg.id_grupo - %s + ON %s %s WHERE 1=1 %s From 2915a3bd3566bd554cc529e5af41fd4c5e39d822 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 6 Oct 2020 11:07:46 +0200 Subject: [PATCH 009/180] fixed email test --- .../godmode/setup/setup_general.php | 19 +++---- pandora_console/include/functions.php | 57 +++++++++++++++++++ 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 0d8ce68e8e..9a5c3b96c3 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -59,18 +59,10 @@ global $config; check_login(); if (is_ajax()) { - enterprise_include_once('include/functions_cron.php'); - $test_address = get_parameter('test_address', ''); - $res = enterprise_hook( - 'send_email_attachment', - [ - $test_address, - __('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'), - __('Testing Pandora FMS email'), - null, - ] + $res = send_test_email( + $test_address ); echo $res; @@ -469,7 +461,6 @@ function show_email_test(id) { resizable: true, draggable: true, modal: true, - height: 175, width: 450, overlay: { opacity: 0.5, @@ -487,7 +478,11 @@ function perform_email_test () { data: "page=godmode/setup/setup_general&test_address="+test_address, dataType: "html", success: function(data) { - $('#email_test_sent_message').show(); + if (parseInt(data) === 1) { + $('#email_test_sent_message').show(); + } else { + $('#email_test_failure_message').show(); + } }, error: function() { $('#email_test_failure_message').show(); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 9485d39fc1..f78f4d385e 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -5735,3 +5735,60 @@ function get_data_multiplier($unit) return $multiplier; } + + +/** + * Send test email to check email setups. + * + * @param string $to Target email account. + * + * @return integer Status of the email send task. + */ +function send_test_email( + string $to +) { + global $config; + + $result = false; + try { + $transport = new Swift_SmtpTransport( + $config['email_smtpServer'], + $config['email_smtpPort'] + ); + + $transport->setUsername($config['email_username']); + $transport->setPassword($config['email_password']); + + if ($config['email_encryption']) { + $transport->setEncryption($config['email_encryption']); + } + + $mailer = new Swift_Mailer($transport); + + $message = new Swift_Message(io_safe_output(__('Testing Pandora FMS email'))); + + $message->setFrom( + [ + $config['email_from_dir'] => io_safe_output( + $config['email_from_name'] + ), + ] + ); + + $to = trim($to); + $message->setTo([$to => $to]); + $message->setBody( + __('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'), + 'text/html' + ); + + ini_restore('sendmail_from'); + + $result = $mailer->send($message); + } catch (Exception $e) { + error_log($e->getMessage()); + db_pandora_audit('Cron jobs mail', $e->getMessage()); + } + + return $result; +} From ff8aaf18fe61bbe32c8ae1447991c083458a065f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 6 Oct 2020 15:48:12 +0200 Subject: [PATCH 010/180] Group event reports (with secondary groups) --- pandora_console/include/functions_events.php | 205 ++++++++++++------- pandora_console/include/lib/Event.php | 176 ++++++++++++++++ 2 files changed, 312 insertions(+), 69 deletions(-) create mode 100644 pandora_console/include/lib/Event.php diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ecdb92a528..b7f8d861d7 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -707,7 +707,9 @@ function events_get_all( } $count = false; - if (!is_array($fields) && $fields == 'count') { + if (is_array($fields) === false && $fields === 'count' + || (is_array($fields) === true && $fields[0] === 'count') + ) { $fields = ['te.*']; $count = true; } else if (!is_array($fields)) { @@ -877,9 +879,10 @@ function events_get_all( $groups ); - if (!$propagate) { + if (!$propagate && isset($groups)) { $sql_filters[] = sprintf( ' AND (te.id_grupo = %d OR tasg.id_group = %d)', + $groups, $groups ); } else { @@ -1314,7 +1317,7 @@ function events_get_all( if (is_array($groups)) { $tgrupo_join_filters[] = sprintf( ' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s)))', + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', join(', ', $groups), join(', ', $groups) ); @@ -1572,7 +1575,9 @@ function events_get_events_no_grouped( $table = events_get_events_table($meta, $history); - $sql = 'SELECT * FROM '.$table.' te WHERE 1=1 '.$sql_post; + $sql = 'SELECT * FROM '.$table.' te '; + $sql .= events_get_secondary_groups_left_join($table); + $sql .= $sql_post; $events = db_get_all_rows_sql($sql, $history_db); @@ -1947,7 +1952,7 @@ function events_change_status( * * @param mixed $id_event Event ID or array of events. * @param string $new_owner Id_user of the new owner. If is false, the current - * owner will be setted. + * owner will be set, if empty, will be cleaned. * @param boolean $force Flag to force the change or not (not force is * change only when it hasn't owner). * @param boolean $meta Metaconsole mode flag. @@ -1987,11 +1992,10 @@ function events_change_owner( return false; } - // If no new_owner is provided, the current user will be the owner - // * #2250: Comment this lines because if possible selected None owner. - // if (empty($new_owner)) { - // $new_owner = $config['id_user']; - // } + if ($new_owner === false) { + $new_owner = $config['id_user']; + } + // Only generate comment when is forced (sometimes is owner changes when // comment). if ($force) { @@ -2000,7 +2004,9 @@ function events_change_owner( '', 'Change owner to '.$new_owner, $meta, - $history + $history, + true, + false ); } @@ -2056,13 +2062,14 @@ function events_get_events_table($meta, $history) /** * Comment events in a transresponse * - * @param mixed $id_event Event ID or array of events. - * @param string $comment Comment to be registered. - * @param string $action Action performed with comment. By default just add - * a comment. - * @param boolean $meta Flag of metaconsole mode. - * @param boolean $history Flag of history mode. - * @param boolean $similars Similars. + * @param mixed $id_event Event ID or array of events. + * @param string $comment Comment to be registered. + * @param string $action Action performed with comment. By default just add + * a comment. + * @param boolean $meta Flag of metaconsole mode. + * @param boolean $history Flag of history mode. + * @param boolean $similars Similars. + * @param boolean $update_owner Update owner. * * @return boolean Whether or not it was successful */ @@ -2072,7 +2079,8 @@ function events_comment( $action='Added comment', $meta=false, $history=false, - $similars=true + $similars=true, + $update_owner=true ) { global $config; @@ -2100,8 +2108,10 @@ function events_comment( return false; } - // If the event hasn't owner, assign the user as owner. - events_change_owner($id_event); + if ($update_owner) { + // If the event hasn't owner, assign the user as owner. + events_change_owner($id_event); + } // Get the current event comments. $first_event = $id_event; @@ -2980,9 +2990,13 @@ function events_get_agent( if ($events_group) { $sql_where .= sprintf( - ' AND id_grupo IN (%s) AND utimestamp > %d - AND utimestamp <= %d ', - implode(',', $id_group), + ' INNER JOIN tgrupo tg + ON (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s) + OR (te.id_agente = tasg.id_agent AND tasg.id_group = %s) + WHERE utimestamp > %d + AND utimestamp <= %d ', + join(',', $id_group), + join(',', $id_group), $datelimit, $date ); @@ -5018,20 +5032,26 @@ function events_get_count_events_by_agent( $tevento = 'tevento'; $sql = sprintf( - 'SELECT id_agente, - (SELECT t2.alias - FROM %s t2 - WHERE t2.id_agente = t3.id_agente) AS agent_name, - COUNT(*) AS count - FROM %s t3 + 'SELECT + ta.id_agente, + ta.alias as agent_name, + count(*) as count + FROM %s te + %s + INNER JOIN %s ta + ON te.id_agente = ta.id_agente + INNER JOIN tgrupo tg + ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s)) WHERE utimestamp > %d AND utimestamp <= %d - AND id_grupo IN (%s) - GROUP BY id_agente', - $tagente, + GROUP BY ta.id_agente', $tevento, + events_get_secondary_groups_left_join($tevento), + $tagente, + implode(',', $id_group), + implode(',', $id_group), $datelimit, $date, - implode(',', $id_group), $sql_where ); @@ -5082,8 +5102,10 @@ function events_get_count_events_validated_by_user( $dbmeta=false ) { global $config; + $tevento = 'tevento'; + // Group. - $sql_filter = ' AND 1=1 '; + $tgroup_join = ''; if (isset($filter['id_group'])) { $id_group = groups_safe_acl($config['id_user'], $filter['id_group'], 'AR'); @@ -5092,7 +5114,15 @@ function events_get_count_events_validated_by_user( return false; } - $sql_filter .= sprintf(' AND id_grupo IN (%s) ', implode(',', $id_group)); + $tgroup_join = sprintf( + '%s + INNER JOIN tgrupo tg + ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + events_get_secondary_groups_left_join($tevento), + implode(',', $id_group), + implode(',', $id_group) + ); } if (!empty($filter['id_agent'])) { @@ -5191,24 +5221,29 @@ function events_get_count_events_validated_by_user( $sql_where .= ' AND (evento LIKE "%'.io_safe_input($filter_event_filter_search).'%" OR id_evento LIKE "%'.io_safe_input($filter_event_filter_search).'%")'; } - $tevento = 'tevento'; - $sql = sprintf( - 'SELECT id_usuario, - (SELECT t2.fullname - FROM tusuario t2 - WHERE t2.id_user = t3.id_usuario) AS user_name, - COUNT(*) AS count - FROM %s t3 - WHERE utimestamp > %d AND utimestamp <= %d - %s %s - GROUP BY id_usuario', + 'SELECT + te.id_usuario, + tu.fullname as user_name, + count(*) as count + FROM %s te + %s + LEFT JOIN tusuario tu + ON te.owner_user = tu.id_user + WHERE + te.utimestamp > %d AND te.utimestamp <= %d + AND te.estado = %d + %s + GROUP BY te.id_usuario', $tevento, + $tgroup_join, $datelimit, $date, + EVENT_VALIDATE, $sql_filter, $sql_where ); + $rows = db_get_all_rows_sql($sql); if ($rows == false) { @@ -5219,7 +5254,7 @@ function events_get_count_events_validated_by_user( foreach ($rows as $row) { $user_name = $row['user_name']; if (empty($row['user_name'])) { - $user_name = __('Unknown'); + $user_name = __('Validated but not assigned'); } $return[$user_name] = $row['count']; @@ -5257,7 +5292,10 @@ function events_get_count_events_by_criticity( ) { global $config; - $sql_filter = ' AND 1=1 '; + $tevento = 'tevento'; + + $sql_filter = ''; + $tgroup_join = ''; if (isset($filter['id_group'])) { $id_group = groups_safe_acl($config['id_user'], $filter['id_group'], 'AR'); @@ -5266,7 +5304,15 @@ function events_get_count_events_by_criticity( return false; } - $sql_filter .= sprintf(' AND id_grupo IN (%s) ', implode(',', $id_group)); + $tgroup_join = sprintf( + '%s + INNER JOIN tgrupo tg + ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + events_get_secondary_groups_left_join($tevento), + implode(',', $id_group), + implode(',', $id_group) + ); } if (!empty($filter['id_agent'])) { @@ -5366,16 +5412,19 @@ function events_get_count_events_by_criticity( $sql_where .= ' AND (evento LIKE "%'.io_safe_input($filter_event_filter_search).'%" OR id_evento LIKE "%'.io_safe_input($filter_event_filter_search).'%")'; } - $tevento = 'tevento'; - $sql = sprintf( - 'SELECT criticity, - COUNT(*) AS count - FROM %s - WHERE utimestamp > %d AND utimestamp <= %d - %s %s - GROUP BY criticity', + 'SELECT + te.criticity, + count(*) as count + FROM %s te + %s + WHERE + te.utimestamp > %d AND te.utimestamp <= %d + %s + %s + GROUP BY te.id_usuario', $tevento, + $tgroup_join, $datelimit, $date, $sql_filter, @@ -5424,23 +5473,26 @@ function events_get_count_events_validated( $dbmeta=false ) { global $config; + $tevento = 'tevento'; // Group. - $sql_filter = ' 1=1 '; + $sql_filter = ''; + $tgroup_join = ''; if (isset($filter['id_group'])) { - $id_group = groups_safe_acl( - $config['id_user'], - $filter['id_group'], - 'AR' - ); + $id_group = groups_safe_acl($config['id_user'], $filter['id_group'], 'AR'); if (empty($id_group)) { // An empty array means the user doesn't have access. return false; } - $sql_filter .= sprintf( - ' AND id_grupo IN (%s) ', + $tgroup_join = sprintf( + '%s + INNER JOIN tgrupo tg + ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) + OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + events_get_secondary_groups_left_join($tevento), + implode(',', $id_group), implode(',', $id_group) ); } @@ -5571,9 +5623,24 @@ function events_get_count_events_validated( $sql_where .= ' AND (evento LIKE "%'.io_safe_input($filter_event_filter_search).'%" OR id_evento LIKE "%'.io_safe_input($filter_event_filter_search).'%")'; } - $tevento = 'tevento'; - - $sql = sprintf('SELECT estado, COUNT(*) AS count FROM %s WHERE %s %s GROUP BY estado', $tevento, $sql_filter, $sql_where); + $sql = sprintf( + 'SELECT + te.estado, + count(*) as count + FROM %s te + %s + WHERE + te.utimestamp > %d AND te.utimestamp <= %d + %s + %s + GROUP BY te.id_usuario', + $tevento, + $tgroup_join, + $datelimit, + $date, + $sql_filter, + $sql_where + ); $rows = db_get_all_rows_sql($sql); diff --git a/pandora_console/include/lib/Event.php b/pandora_console/include/lib/Event.php new file mode 100644 index 0000000000..d86288a00a --- /dev/null +++ b/pandora_console/include/lib/Event.php @@ -0,0 +1,176 @@ + $id_group]); + } else { + // Empty skel. + parent::__construct($table); + } + + } + + + /** + * Retrieves all events matching given filters. + * + * @param array $fields Fields to retrieve. + * @param array $filter Filter. + * @param integer $offset Offset. + * @param integer $limit Limit. + * @param string $order Order (asc or desc). + * @param string $sort_field Sort field. + * @param boolean $history Search history. + * @param boolean $return_sql Return sql or execute it. + * @param string $having Having. + * + * @return array|string|falsse Found events or SQL query or error. + */ + public static function search( + array $fields, + array $filter, + ?int $offset=null, + ?int $limit=null, + ?string $order=null, + ?string $sort_field=null, + bool $history=false, + bool $return_sql=false, + string $having='' + ):array { + return \events_get_all( + $fields, + $filter, + $offset, + $limit, + $order, + $sort_field, + $history, + $return_sql, + $having + ); + } + + + /** + * Saves current group definition to database. + * + * @return mixed Affected rows of false in case of error. + * @throws \Exception On error. + */ + public function save() + { + global $config; + + if (isset($config['centralized_management']) === true + && $config['centralized_management'] > 0 + ) { + throw new \Exception( + get_class($this).' error, cannot be modified while centralized management environment.' + ); + } + + if ($this->id_evento === null) { + // New. + return db_process_sql_insert( + 'tgrupo', + $this->fields + ); + } else if ($this->fields['id_evento'] > 0) { + // Update. + return db_process_sql_update( + 'tgrupo', + $this->fields, + ['id_evento' => $this->fields['id_evento']] + ); + } + + return false; + } + + + /** + * Return error message to target. + * + * @param string $msg Error message. + * + * @return void + */ + public static function error(string $msg) + { + echo json_encode(['error' => $msg]); + } + + + /** + * Verifies target method is allowed to be called using AJAX call. + * + * @param string $method Method to be invoked via AJAX. + * + * @return boolean Available (true), or not (false). + */ + public static function ajaxMethod(string $method):bool + { + return in_array($method, self::$ajaxMethods) === true; + } + + +} From 2ba412cb5521e9184eb62b2afb1f4a5b3c069bce Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 7 Oct 2020 10:29:43 +0200 Subject: [PATCH 011/180] Minor fixes discovery tasklist usability --- pandora_console/godmode/wizards/DiscoveryTaskList.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 59a9fab84a..a3a2b15c8a 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -176,7 +176,7 @@ class DiscoveryTaskList extends HTML 'type' => 'button', 'attributes' => 'class="sub upd"', 'return' => true, - 'script' => 'location.reload();', + 'script' => 'location.href = \''.$this->url.'\';', ], ], ], @@ -402,8 +402,10 @@ class DiscoveryTaskList extends HTML $table->headstyle[$i] = 'text-align: left;'; } + // Task name. + $table->headstyle[1] .= 'min-width: 150px; width: 300px;'; // Name. - $table->headstyle[4] .= 'min-width: 100px; width: 600px;'; + $table->headstyle[4] .= 'min-width: 100px; width: 400px;'; // Status. $table->headstyle[5] .= 'min-width: 50px; width: 100px;'; // Task type. From 5ce1bd23e4558ddcda2d38a43f7ff335753695b3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 7 Oct 2020 10:56:40 +0200 Subject: [PATCH 012/180] Discovery task instead Recon task in some places --- pandora_console/include/functions_groups.php | 2 +- pandora_console/operation/agentes/pandora_networkmap.editor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index b6c1a5e6c9..2bc8bad8f3 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -104,7 +104,7 @@ function groups_check_used($idGroup) if ($numRows > 0) { $return['return'] = true; - $return['tables'][] = __('Recon task'); + $return['tables'][] = __('Discovery task'); } switch ($config['dbtype']) { diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index a16874705c..8699253454 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -313,7 +313,7 @@ if ($not_found) { $table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true); $table->data['source'][0] = __('Source'); - $table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Recon task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source); + $table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source); $table->data['source_data_recon_task'][0] = __('Source from recon task'); $table->data['source_data_recon_task'][0] .= ui_print_help_tip( From c4c987d6c19cd37d4685e70d3e57e585146fac7b Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 7 Oct 2020 12:12:06 +0200 Subject: [PATCH 013/180] fixed errors availability reports --- pandora_console/include/functions_reporting_html.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 22dd951105..6c2c609884 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3435,12 +3435,12 @@ function reporting_html_availability($table, $item, $pdf=0) $table_row[] = '--'; } else { $table_row[] = $row['agent']; - $item = $row['availability_item']; + $item_name = $row['availability_item']; if ((bool) $row['compare'] === true) { - $item .= ' ('.__('24 x 7').')'; + $item_name .= ' ('.__('24 x 7').')'; } - $table_row[] = $item; + $table_row[] = $item_name; } if ($row['time_total'] != 0 && $item['fields']['total_time']) { @@ -3568,12 +3568,12 @@ function reporting_html_availability($table, $item, $pdf=0) $table_row2[] = '--'; } else { $table_row2[] = $row['agent']; - $item = $row['availability_item']; + $item_name = $row['availability_item']; if ((bool) $row['compare'] === true) { - $item .= ' ('.__('24 x 7').')'; + $item_name .= ' ('.__('24 x 7').')'; } - $table_row2[] = $item; + $table_row2[] = $item_name; } if ($item['fields']['total_checks']) { From ac4904f1237629c260fad5ae2d909c7acc547794 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 7 Oct 2020 12:22:46 +0200 Subject: [PATCH 014/180] Avoid host latency "fake" value 0 --- pandora_server/lib/PandoraFMS/NetworkServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index 0bca799815..3c0446c956 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -498,7 +498,7 @@ sub exec_network_module ($$$$) { $module_data = pandora_ping_latency ($pa_config, $ip_target, $timeout, $retries); if (defined($module_data)) { - $module_result = 0; # Successful + $module_result = 1; # Unsuccessful } } From 0deff70f8bab1b634fd5632df6c923edce3dc8d1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 7 Oct 2020 14:07:17 +0200 Subject: [PATCH 015/180] Alert report (group) Group + secondary groups + recursion --- pandora_console/include/functions_alerts.php | 80 +++++++++++++++++++ pandora_console/include/functions_events.php | 14 ++-- .../include/functions_reporting.php | 28 +------ 3 files changed, 91 insertions(+), 31 deletions(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index f4bd91645e..2566e265be 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2830,3 +2830,83 @@ function alerts_ui_update_or_create_actions($update=true) $update ? __('Could not be updated') : __('Could not be created') ); } + + +/** + * Retrieve all agent_modules with configured alerts filtered by group. + * + * @param integer|null $id_grupo Filter by group. + * @param boolean $recursion Filter by group recursive. + * + * @return array With agent module ids. + */ +function alerts_get_agent_modules( + ?int $id_grupo, + bool $recursion=false +) : array { + if ($id_grupo === null) { + $agent_modules = db_get_all_rows_sql( + 'SELECT distinct(atm.id_agent_module) + FROM talert_template_modules atm + INNER JOIN tagente_modulo am + ON am.id_agente_modulo = atm.id_agent_module + WHERE atm.disabled = 0' + ); + } else if ($recursion !== true) { + $sql = sprintf( + 'SELECT distinct(atm.id_agent_module) + FROM talert_template_modules atm + INNER JOIN tagente_modulo am + ON am.id_agente_modulo = atm.id_agent_module + INNER JOIN tagente ta + ON am.id_agente = ta.id_agente + LEFT JOIN tagent_secondary_group tasg + ON tasg.id_agent = ta.id_agente + WHERE atm.disabled = 0 + AND (tasg.id_group = %d + OR ta.id_grupo = %d) + ', + $id_grupo, + $id_grupo + ); + $agent_modules = db_get_all_rows_sql($sql); + } else { + $groups = groups_get_children($id_grupo, true); + if (empty($groups) === false) { + $groups = array_reduce( + $groups, + function ($carry, $item) { + $carry[] = $item['id_grupo']; + return $carry; + }, + [$id_grupo] + ); + + $sql = sprintf( + 'SELECT distinct(atm.id_agent_module) + FROM talert_template_modules atm + INNER JOIN tagente_modulo am + ON am.id_agente_modulo = atm.id_agent_module + INNER JOIN tagente ta + ON am.id_agente = ta.id_agente + LEFT JOIN tagent_secondary_group tasg + ON tasg.id_agent = ta.id_agente + WHERE atm.disabled = 0 + AND (tasg.id_group IN (%s) + OR ta.id_grupo IN (%s)) + ', + implode(',', $groups), + implode(',', $groups) + ); + } + + $agent_modules = db_get_all_rows_sql($sql); + } + + if ($agent_modules === false) { + return []; + } + + return $agent_modules; + +} diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index b7f8d861d7..7a337fbdab 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1317,14 +1317,14 @@ function events_get_all( if (is_array($groups)) { $tgrupo_join_filters[] = sprintf( ' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))', join(', ', $groups), join(', ', $groups) ); } else { $tgrupo_join_filters[] = sprintf( ' (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s) - OR (te.id_agente = tasg.id_agent AND tasg.id_group = %s)', + OR (tg.id_grupo = tasg.id_group AND tasg.id_group = %s)', $groups, $groups ); @@ -2992,7 +2992,7 @@ function events_get_agent( $sql_where .= sprintf( ' INNER JOIN tgrupo tg ON (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s) - OR (te.id_agente = tasg.id_agent AND tasg.id_group = %s) + OR (tg.id_grupo = tasg.id_group AND tasg.id_group = %s) WHERE utimestamp > %d AND utimestamp <= %d ', join(',', $id_group), @@ -5042,7 +5042,7 @@ function events_get_count_events_by_agent( ON te.id_agente = ta.id_agente INNER JOIN tgrupo tg ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s)) + OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s)) WHERE utimestamp > %d AND utimestamp <= %d GROUP BY ta.id_agente', $tevento, @@ -5118,7 +5118,7 @@ function events_get_count_events_validated_by_user( '%s INNER JOIN tgrupo tg ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))', events_get_secondary_groups_left_join($tevento), implode(',', $id_group), implode(',', $id_group) @@ -5308,7 +5308,7 @@ function events_get_count_events_by_criticity( '%s INNER JOIN tgrupo tg ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))', events_get_secondary_groups_left_join($tevento), implode(',', $id_group), implode(',', $id_group) @@ -5490,7 +5490,7 @@ function events_get_count_events_validated( '%s INNER JOIN tgrupo tg ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s)) - OR (te.id_agente = tasg.id_agent AND tasg.id_group IN (%s))', + OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))', events_get_secondary_groups_left_join($tevento), implode(',', $id_group), implode(',', $id_group) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 818af98197..f5372e1404 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3909,30 +3909,10 @@ function reporting_alert_report_group($report, $content) $return['description'] = $content['description']; $return['date'] = reporting_get_date_text($report, $content); - if ($content['id_group'] == 0) { - $agent_modules = db_get_all_rows_sql( - ' - SELECT distinct(id_agent_module) - FROM talert_template_modules - WHERE disabled = 0 - AND id_agent_module IN ( - SELECT id_agente_modulo - FROM tagente_modulo)' - ); - } else { - $agent_modules = db_get_all_rows_sql( - ' - SELECT distinct(id_agent_module) - FROM talert_template_modules - WHERE disabled = 0 - AND id_agent_module IN ( - SELECT id_agente_modulo - FROM tagente_modulo - WHERE id_agente IN ( - SELECT id_agente - FROM tagente WHERE id_grupo = '.$content['id_group'].'))' - ); - } + $agent_modules = alerts_get_agent_modules( + $content['id_group'], + $content['recursion'] + ); if (empty($alerts)) { $alerts = []; From ed434135c2dfed97a73bc3c5d0750177841102e8 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 8 Oct 2020 01:00:17 +0200 Subject: [PATCH 016/180] 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 b7de7656f0..1e0d0dc641 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201007 +Version: 7.0NG.749-201008 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 fed7f61ad6..5670beee36 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.749-201007" +pandora_version="7.0NG.749-201008" 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 01d76aff1e..5b4dec359b 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.749'; -use constant AGENT_BUILD => '201007'; +use constant AGENT_BUILD => '201008'; # 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 2af257e3d5..3ad4cabf92 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.749 -%define release 201007 +%define release 201008 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 edeff90cf5..d47a01c36c 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.749 -%define release 201007 +%define release 201008 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 98327f9d7a..9e6917ed1b 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201007" +PI_BUILD="201008" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 92c1f27e6b..d5a4bdb11d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201007} +{201008} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 98d8c673fa..892a6604c0 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.749(Build 201007)") +#define PANDORA_VERSION ("7.0NG.749(Build 201008)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5bd038d9bc..6f717019ad 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.749(Build 201007))" + VALUE "ProductVersion", "(7.0NG.749(Build 201008))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 1b44a6c01d..3eda2359e5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201007 +Version: 7.0NG.749-201008 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 17dd52f39c..747fb4edf3 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.749-201007" +pandora_version="7.0NG.749-201008" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6b406cdc5c..9704e3c70e 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 = 'PC201007'; +$build_version = 'PC201008'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 732a45ac7f..e1184bc3b7 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 4cfe31b2b4..9009dfa730 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.749 -%define release 201007 +%define release 201008 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index f28dfe362b..2996176267 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.749 -%define release 201007 +%define release 201008 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d477612229..2ab8300206 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201007" +PI_BUILD="201008" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index e9e1a38838..35ab2c3eaa 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.749 PS201007"; +my $version = "7.0NG.749 PS201008"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 4600e9dfb6..7b9c910ecf 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.749 PS201007"; +my $version = "7.0NG.749 PS201008"; # save program name for logging my $progname = basename($0); From 90dae531b8c164cfac69d24dd2e27ea10635761e Mon Sep 17 00:00:00 2001 From: rafael Date: Thu, 8 Oct 2020 11:26:56 +0200 Subject: [PATCH 017/180] Refactoring dockerfile for pandora agent base centos8 --- pandora_agents/Dockerfile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pandora_agents/Dockerfile b/pandora_agents/Dockerfile index 69117e2ca7..0ee2515a75 100644 --- a/pandora_agents/Dockerfile +++ b/pandora_agents/Dockerfile @@ -1,20 +1,27 @@ -FROM centos:centos7 +FROM centos:centos8 MAINTAINER Pandora FMS Team # Add Pandora FMS agent installer -ADD unix /tmp/pandora_agent/unix +ADD unix /opt/pandora/pandora_agent/unix + +RUN export LC_ALL=C + +RUN dnf install -y dnf-plugins-core; dnf config-manager --set-enabled PowerTools # Install dependencies -RUN yum -y install \ +RUN dnf -y install \ epel-release \ unzip \ perl \ python3 \ sed \ - "perl(Sys::Syslog)" + perl-YAML-Tiny \ + "perl(Sys::Syslog)" \ + && dnf clean all + # Install Pandora FMS agent -RUN cd /tmp/pandora_agent/unix \ +RUN cd /opt/pandora/pandora_agent/unix \ && chmod +x pandora_agent_installer \ && ./pandora_agent_installer --install @@ -41,8 +48,7 @@ if [ $TIMEZONE != "" ]; then\n \ \tln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime\n \ fi\n \ /etc/init.d/pandora_agent_daemon start\n \ -rm -f $0\n \ -tail -f /var/log/pandora/pandora_agent.log' \ +tail -F /var/log/pandora/pandora_agent.log' \ >> /entrypoint.sh && \ chmod +x /entrypoint.sh From 54035e96152233ba7eabcbb528b0281fdceb760e Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Thu, 8 Oct 2020 11:54:10 +0200 Subject: [PATCH 018/180] fixed error with sql query pie graph --- pandora_console/include/functions_graph.php | 25 +++++++++++-------- .../include/functions_reporting.php | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index b4505df1a0..0a243ccc66 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3718,7 +3718,7 @@ function grafico_eventos_usuario($width, $height) * @param integer Graph type 1 vbar, 2 hbar, 3 pie */ function graph_custom_sql_graph( - $id, + $content, $width, $height, $type='sql_graph_vbar', @@ -3731,26 +3731,29 @@ function graph_custom_sql_graph( $SQL_GRAPH_MAX_LABEL_SIZE = 20; - if (is_metaconsole()) { + if (is_metaconsole() && $content['server_name'] !== '0') { $server = metaconsole_get_connection_names(); $connection = metaconsole_get_connection($server); metaconsole_connect($connection); } - $report_content = db_get_row('treport_content', 'id_rc', $id); + $report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']); if ($report_content == false || $report_content == '') { - $report_content = db_get_row('treport_content_template', 'id_rc', $id); + $report_content = db_get_row('treport_content_template', 'id_rc', $content['id_rc']); } if ($report_content == false || $report_content == '') { - enterprise_hook('metaconsole_restore_db'); - $report_content = db_get_row('treport_content', 'id_rc', $id); - if ($report_content == false || $report_content == '') { - $report_content = db_get_row('treport_content_template', 'id_rc', $id); + if (is_metaconsole() && $content['server_name'] !== '0') { + enterprise_hook('metaconsole_restore_db'); } - if (is_metaconsole()) { + $report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']); + if ($report_content == false || $report_content == '') { + $report_content = db_get_row('treport_content_template', 'id_rc', $content['id_rc']); + } + + if ((is_metaconsole() & $content['server_name']) !== '0') { $server = metaconsole_get_connection_names(); $connection = metaconsole_get_connection($server); metaconsole_connect($connection); @@ -3758,7 +3761,7 @@ function graph_custom_sql_graph( } if ($id != null) { - $historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$id); + $historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$content['id_rc']); } else { $historical_db = $content['historical_db']; } @@ -3772,7 +3775,7 @@ function graph_custom_sql_graph( $data_result = db_get_all_rows_sql($sql, $historical_db); - if (is_metaconsole()) { + if ((is_metaconsole() & $content['server_name']) !== '0') { enterprise_hook('metaconsole_restore_db'); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index aee57cd287..9eed30c03d 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4462,7 +4462,7 @@ function reporting_sql_graph( case 'dinamic': case 'static': $return['chart'] = graph_custom_sql_graph( - $content['id_rc'], + $content, $width, $height, $content['type'], From a4b2e38ffcb13dbb9aa1e144ceeb21f182d6cdf4 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 8 Oct 2020 16:41:26 +0200 Subject: [PATCH 019/180] Fix unhandled extra-options in group selector inclusions --- .../godmode/massive/massive_edit_agents.php | 19 +++++++- pandora_console/include/functions_html.php | 5 +++ pandora_console/include/lib/Group.php | 44 +++++++++++++++---- 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 6a4ca61fcb..7f04eb2b29 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -548,7 +548,24 @@ $table->data[0][1] .= ''.__('Cascade protection').''.html_print_select( $table->data[0][1] .= '  '.__('Module').' '.html_print_select($modules, 'cascade_protection_module', $cascade_protection_module, '', '', 0, true); $table->data[1][0] = __('Group'); -$table->data[1][1] = html_print_select_groups(false, 'AR', false, 'group', $group, '', __('No change'), -1, true, false, true, '', false, 'width: 150px;'); +$table->data[1][1] = '
'; +$table->data[1][1] .= html_print_select_groups( + false, + 'AR', + false, + 'group', + $group, + '', + __('No change'), + -1, + true, + false, + true, + '', + false, + 'width: 150px;' +); +$table->data[1][1] .= '
'; $table->data[2][0] = __('Interval'); diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 6dedb85927..092044765c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -514,6 +514,11 @@ function html_print_select_groups( } } + if (empty($nothing) === false) { + $fields[$nothing_value] = $nothing; + $include_groups[$nothing_value] = $nothing; + } + if (is_array($delete_groups) === true) { $json_exclusions = json_encode($delete_groups); } diff --git a/pandora_console/include/lib/Group.php b/pandora_console/include/lib/Group.php index d054f67abe..cf4ffa9ab0 100644 --- a/pandora_console/include/lib/Group.php +++ b/pandora_console/include/lib/Group.php @@ -170,8 +170,8 @@ class Group extends Entity private static function prepareGroups(array $groups):array { $return = []; - $groups = \groups_get_groups_tree_recursive($groups); - foreach ($groups as $k => $v) { + $tree_groups = \groups_get_groups_tree_recursive($groups); + foreach ($tree_groups as $k => $v) { $return[] = [ 'id' => $k, 'text' => \io_safe_output( @@ -187,8 +187,29 @@ class Group extends Entity ]; } - return $return; + $unassigned = []; + $processed = array_keys($tree_groups); + foreach ($groups as $k => $v) { + if (in_array($k, $processed) === true) { + continue; + } + $unassigned[] = [ + 'id' => $k, + 'text' => \io_safe_output( + \ui_print_truncate_text( + $v, + GENERIC_SIZE_TEXT, + false, + true, + false + ) + ), + 'level' => 0, + ]; + } + + return array_merge($unassigned, $return); } @@ -291,18 +312,25 @@ class Group extends Entity ] ); - $exclusions = json_decode(\io_safe_output($exclusions)); + $exclusions = json_decode(\io_safe_output($exclusions), true); if (empty($exclusions) === false) { foreach ($exclusions as $ex) { unset($groups[$ex]); } } - $inclusions = json_decode(\io_safe_output($inclusions)); + $inclusions = json_decode(\io_safe_output($inclusions), true); if (empty($inclusions) === false) { - foreach ($inclusions as $g) { - if (empty($groups[$g]) === true) { - $groups[$g] = \groups_get_name($g); + foreach ($inclusions as $k => $g) { + if (empty($groups[$k]) === true) { + if (is_numeric($g) === true) { + $groups[$k] = \groups_get_name($k); + } + + if (empty($groups[$k]) === true) { + // Group does not exist, direct value assigned. + $groups[$k] = $g; + } } } } From 70cea5cdff091e9677c58bbc4ff102015adcd024 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 9 Oct 2020 01:00:21 +0200 Subject: [PATCH 020/180] 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 1e0d0dc641..931227cb1c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201008 +Version: 7.0NG.749-201009 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 5670beee36..c790405fd9 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.749-201008" +pandora_version="7.0NG.749-201009" 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 5b4dec359b..fce515ec5e 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.749'; -use constant AGENT_BUILD => '201008'; +use constant AGENT_BUILD => '201009'; # 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 3ad4cabf92..821e35c8c1 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.749 -%define release 201008 +%define release 201009 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 d47a01c36c..1876636c6c 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.749 -%define release 201008 +%define release 201009 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 9e6917ed1b..633712a62d 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201008" +PI_BUILD="201009" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d5a4bdb11d..900ad04092 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201008} +{201009} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 892a6604c0..6f5363d8f3 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.749(Build 201008)") +#define PANDORA_VERSION ("7.0NG.749(Build 201009)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 6f717019ad..6f95a53f39 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.749(Build 201008))" + VALUE "ProductVersion", "(7.0NG.749(Build 201009))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3eda2359e5..3d42315359 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201008 +Version: 7.0NG.749-201009 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 747fb4edf3..e02ad512ca 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.749-201008" +pandora_version="7.0NG.749-201009" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9704e3c70e..f30fa54b86 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 = 'PC201008'; +$build_version = 'PC201009'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e1184bc3b7..14003e83ae 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 9009dfa730..d61a75d3c3 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.749 -%define release 201008 +%define release 201009 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 2996176267..7011ea7753 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.749 -%define release 201008 +%define release 201009 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2ab8300206..c82ccb7d97 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201008" +PI_BUILD="201009" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 35ab2c3eaa..6406188de3 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.749 PS201008"; +my $version = "7.0NG.749 PS201009"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 7b9c910ecf..395e9bd08c 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.749 PS201008"; +my $version = "7.0NG.749 PS201009"; # save program name for logging my $progname = basename($0); From 8a72074a8a9230d50922b487fcb16a4e4599ee21 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Fri, 9 Oct 2020 12:05:57 +0200 Subject: [PATCH 021/180] fixed sql graph pie --- pandora_console/include/functions_graph.php | 86 ++++++++++++++----- .../include/functions_reporting.php | 45 ++++++---- .../include/graphs/functions_flot.php | 49 ++++++++--- pandora_console/include/styles/pandora.css | 9 ++ 4 files changed, 137 insertions(+), 52 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 0a243ccc66..55ef41ef31 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3710,12 +3710,19 @@ function grafico_eventos_usuario($width, $height) /** - * Print a custom SQL-defined graph + * Undocumented function * - * @param integer ID of report content, used to get SQL code to get information for graph - * @param integer height graph height - * @param integer width graph width - * @param integer Graph type 1 vbar, 2 hbar, 3 pie + * @param array $content ID of report content + * used to get SQL code to get information for graph. + * @param integer $width Graph width. + * @param integer $height Graph height. + * @param string $type Graph type 1 vbar, 2 hbar, 3 pie. + * @param boolean $only_image Only image. + * @param string $homeurl Url. + * @param integer $ttl Ttl. + * @param integer $max_num_elements Max elements. + * + * @return string Graph. */ function graph_custom_sql_graph( $content, @@ -3740,7 +3747,11 @@ function graph_custom_sql_graph( $report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']); if ($report_content == false || $report_content == '') { - $report_content = db_get_row('treport_content_template', 'id_rc', $content['id_rc']); + $report_content = db_get_row( + 'treport_content_template', + 'id_rc', + $content['id_rc'] + ); } if ($report_content == false || $report_content == '') { @@ -3748,9 +3759,17 @@ function graph_custom_sql_graph( enterprise_hook('metaconsole_restore_db'); } - $report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']); + $report_content = db_get_row( + 'treport_content', + 'id_rc', + $content['id_rc'] + ); if ($report_content == false || $report_content == '') { - $report_content = db_get_row('treport_content_template', 'id_rc', $content['id_rc']); + $report_content = db_get_row( + 'treport_content_template', + 'id_rc', + $content['id_rc'] + ); } if ((is_metaconsole() & $content['server_name']) !== '0') { @@ -3761,7 +3780,9 @@ function graph_custom_sql_graph( } if ($id != null) { - $historical_db = db_get_value_sql('SELECT historical_db from treport_content where id_rc ='.$content['id_rc']); + $historical_db = db_get_value_sql( + 'SELECT historical_db from treport_content where id_rc ='.$content['id_rc'] + ); } else { $historical_db = $content['historical_db']; } @@ -3769,7 +3790,11 @@ function graph_custom_sql_graph( if ($report_content['external_source'] != '') { $sql = io_safe_output($report_content['external_source']); } else { - $sql = db_get_row('treport_custom_sql', 'id', $report_content['treport_custom_sql_id']); + $sql = db_get_row( + 'treport_custom_sql', + 'id', + $report_content['treport_custom_sql_id'] + ); $sql = io_safe_output($sql['sql']); } @@ -3790,24 +3815,32 @@ function graph_custom_sql_graph( foreach ($data_result as $data_item) { $count++; $value = 0; - if (!empty($data_item['value'])) { + if (empty($data_item['value']) === false) { $value = $data_item['value']; } if ($count <= $max_num_elements) { $label = __('Data'); - if (!empty($data_item['label'])) { + if (empty($data_item['label']) === false) { $label = io_safe_output($data_item['label']); if (strlen($label) > $SQL_GRAPH_MAX_LABEL_SIZE) { $first_label = $label; - $label = substr($first_label, 0, floor($SQL_GRAPH_MAX_LABEL_SIZE / 2)); + $label = substr( + $first_label, + 0, + floor($SQL_GRAPH_MAX_LABEL_SIZE / 2) + ); $label .= '...'; - $label .= substr($first_label, floor(-$SQL_GRAPH_MAX_LABEL_SIZE / 2)); + $label .= substr( + $first_label, + floor(-$SQL_GRAPH_MAX_LABEL_SIZE / 2) + ); } } switch ($type) { case 'sql_graph_vbar': + default: // Vertical bar. $data[] = [ 'tick' => $label.'_'.$count, @@ -3816,18 +3849,19 @@ function graph_custom_sql_graph( break; case 'sql_graph_hbar': - // horizontal bar + // Horizontal bar. $data[$label.'_'.$count]['g'] = $value; break; case 'sql_graph_pie': - // Pie + // Pie. $data[$label.'_'.$count] = $value; break; } } else { switch ($type) { case 'sql_graph_vbar': + default: // Vertical bar. if ($flagOther === false) { $data[] = [ @@ -3842,8 +3876,8 @@ function graph_custom_sql_graph( break; case 'sql_graph_hbar': - // horizontal bar - if (!isset($data[__('Other')]['g'])) { + // Horizontal bar. + if (isset($data[__('Other')]['g']) === false) { $data[__('Other')]['g'] = 0; } @@ -3851,8 +3885,8 @@ function graph_custom_sql_graph( break; case 'sql_graph_pie': - // Pie - if (!isset($data[__('Other')])) { + // Pie. + if (isset($data[__('Other')]) === false) { $data[__('Other')] = 0; } @@ -3865,12 +3899,18 @@ function graph_custom_sql_graph( 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 + ), ]; } switch ($type) { case 'sql_graph_vbar': + default: // Vertical bar. $color = color_graph_array(); @@ -3900,7 +3940,7 @@ function graph_custom_sql_graph( break; case 'sql_graph_hbar': - // horizontal bar + // Horizontal bar. return hbar_graph( $data, $width, @@ -3923,7 +3963,7 @@ function graph_custom_sql_graph( break; case 'sql_graph_pie': - // Pie + // Pie. return pie_graph( $data, $width, diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 3c530f3115..10a1992e18 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4368,6 +4368,18 @@ function reporting_alert_report_module($report, $content) } +/** + * Sql graph. + * + * @param array $report Info report. + * @param array $content Content. + * @param string $type Type. + * @param integer $force_width_chart Width. + * @param integer $force_height_chart Height. + * @param string $type_sql_graph Type. + * + * @return array Return array. + */ function reporting_sql_graph( $report, $content, @@ -4380,6 +4392,7 @@ function reporting_sql_graph( switch ($type_sql_graph) { case 'sql_graph_hbar': + default: $return['type'] = 'sql_graph_hbar'; break; @@ -4392,9 +4405,10 @@ function reporting_sql_graph( break; } - if (empty($content['name'])) { + if (empty($content['name']) === true) { switch ($type_sql_graph) { case 'sql_graph_vbar': + default: $content['name'] = __('SQL Graph Vertical Bars'); break; @@ -4409,13 +4423,20 @@ function reporting_sql_graph( } // Get chart. - reporting_set_conf_charts($width, $height, $only_image, $type, $content, $ttl); + reporting_set_conf_charts( + $width, + $height, + $only_image, + $type, + $content, + $ttl + ); - if (!empty($force_width_chart)) { + if (empty($force_width_chart) === false) { $width = $force_width_chart; } - if (!empty($force_height_chart)) { + if (empty($force_height_chart) === false) { $height = $force_height_chart; } @@ -4431,7 +4452,7 @@ function reporting_sql_graph( WHERE id_graph = '.$content['id_gs'] ); - if (isset($module_source) && is_array($module_source)) { + if (isset($module_source) === true && is_array($module_source) === true) { $modules = []; foreach ($module_source as $key => $value) { $modules[$key] = $value['id_agent_module']; @@ -4441,6 +4462,7 @@ function reporting_sql_graph( switch ($type) { case 'dinamic': case 'static': + default: $return['chart'] = graph_custom_sql_graph( $content, $width, @@ -8575,6 +8597,7 @@ function reporting_set_conf_charts( ) { switch ($type) { case 'dinamic': + default: $only_image = false; $width = 900; $height = isset($content['style']['dyn_height']) ? $content['style']['dyn_height'] : 230; @@ -8584,25 +8607,17 @@ function reporting_set_conf_charts( case 'static': $ttl = 2; $only_image = true; - $height = 360; + $height = isset($content['style']['dyn_height']) ? $content['style']['dyn_height'] : 230; $width = 780; break; case 'data': + // Nothing. break; } } -// -// -// -// MAYBE MOVE THE NEXT FUNCTIONS TO A FILE NAMED AS FUNCTION_REPORTING.UTILS.PHP // -// -// -// - - /** * Get a detailed report of summarized events per agent * diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 4b0bde1408..dc4e556292 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -376,10 +376,22 @@ function menu_graph( } -// -// -// -// Prints a FLOT pie chart +/** + * Pie chart. + * + * @param array $values Values. + * @param array $labels Labels. + * @param integer $width Width. + * @param integer $height Height. + * @param boolean $water_mark Water mark. + * @param string $font Font. + * @param integer $font_size Font Size. + * @param string $legend_position Psition Legend. + * @param string $colors Array Colors. + * @param boolean $hide_labels Hide labels. + * + * @return void + */ function flot_pie_chart( $values, $labels, @@ -392,9 +404,9 @@ function flot_pie_chart( $colors='', $hide_labels=false ) { - // include_javascript_dependencies_flot_graph(); - $series = sizeof($values); - if (($series != sizeof($labels)) || ($series == 0)) { + $series = count($values); + + if (($series !== count($labels)) || ($series === 0)) { return; } @@ -407,11 +419,11 @@ function flot_pie_chart( case 'right': default: - // TODO FOR TOP OR LEFT OR RIGHT + // TODO FOR TOP OR LEFT OR RIGHT. break; } - $return = "
"; + $return = "
"; if ($water_mark != '') { $return .= ""; @@ -424,15 +436,24 @@ function flot_pie_chart( $labels = implode($separator, $labels); $values = implode($separator, $values); - if (!empty($colors)) { + if (empty($colors) === false) { $colors = implode($separator, $colors); } - // include_javascript_dependencies_flot_graph(); $return .= "'; return $return; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0a5d7afb21..6b48ab13ae 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -6019,3 +6019,12 @@ form#form-filter-interfaces ul li.select-interfaces { li .select2 { max-width: 400px !important; } + +div.graph td.legendLabel { + text-align: justify; +} + +div.graph div.legend div, +div.graph div.legend table { + top: 25px !important; +} From 02c4fe30a3574b983851238bd91ba02524089686 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 9 Oct 2020 14:50:37 +0200 Subject: [PATCH 022/180] OID naming compatibility when starts with "." or not --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 1f6e13f2e6..e14b200fa3 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -2144,7 +2144,7 @@ sub snmp_get_value($$$) { foreach my $line (@output) { $line =~ s/[\r\n]//g; - return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)/); + return $1 if ($line =~ /^\.{0,1}$effective_oid\s+=\s+\S+:\s+(.*)/); } return undef; @@ -2160,7 +2160,7 @@ sub snmp_get_value_array($$$) { my @output = $self->snmp_get($device, $oid); foreach my $line (@output) { chomp($line); - push(@values, $1) if ($line =~ /^$oid\S*\s+=\s+\S+:\s+(.*)$/); + push(@values, $1) if ($line =~ /^\.{0,1}$oid\S*\s+=\s+\S+:\s+(.*)$/); } return @values; From d5b0966669948e22170c5c3ae29641f435c11ca4 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 10 Oct 2020 01:00:18 +0200 Subject: [PATCH 023/180] 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 931227cb1c..dffcd86cb5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201009 +Version: 7.0NG.749-201010 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 c790405fd9..e356bc0fab 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.749-201009" +pandora_version="7.0NG.749-201010" 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 fce515ec5e..9a4a6a2d48 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.749'; -use constant AGENT_BUILD => '201009'; +use constant AGENT_BUILD => '201010'; # 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 821e35c8c1..f695815720 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.749 -%define release 201009 +%define release 201010 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 1876636c6c..9f65648337 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.749 -%define release 201009 +%define release 201010 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 633712a62d..c9bd3ca742 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201009" +PI_BUILD="201010" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 900ad04092..5c19b3db19 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201009} +{201010} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 6f5363d8f3..b44605a1d0 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.749(Build 201009)") +#define PANDORA_VERSION ("7.0NG.749(Build 201010)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 6f95a53f39..d6920784e5 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.749(Build 201009))" + VALUE "ProductVersion", "(7.0NG.749(Build 201010))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3d42315359..345cc0ba3d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201009 +Version: 7.0NG.749-201010 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 e02ad512ca..4af407172b 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.749-201009" +pandora_version="7.0NG.749-201010" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f30fa54b86..28859c17c5 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 = 'PC201009'; +$build_version = 'PC201010'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 14003e83ae..4b1d34e6cc 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 d61a75d3c3..f3a5706cc4 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.749 -%define release 201009 +%define release 201010 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7011ea7753..64e9f20ea6 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.749 -%define release 201009 +%define release 201010 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index c82ccb7d97..17c49de25b 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201009" +PI_BUILD="201010" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6406188de3..0fb526c5bb 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.749 PS201009"; +my $version = "7.0NG.749 PS201010"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 395e9bd08c..cc1a9fb5a3 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.749 PS201009"; +my $version = "7.0NG.749 PS201010"; # save program name for logging my $progname = basename($0); From 2c1ed80925215c750599b294fe38d2c5ad96e387 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 11 Oct 2020 01:00:16 +0200 Subject: [PATCH 024/180] 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 dffcd86cb5..47c566563a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201010 +Version: 7.0NG.749-201011 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 e356bc0fab..3e80164f05 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.749-201010" +pandora_version="7.0NG.749-201011" 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 9a4a6a2d48..004f4cf3a5 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.749'; -use constant AGENT_BUILD => '201010'; +use constant AGENT_BUILD => '201011'; # 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 f695815720..38fd7d6d9e 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.749 -%define release 201010 +%define release 201011 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 9f65648337..09fd616e88 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.749 -%define release 201010 +%define release 201011 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 c9bd3ca742..e6fe9e9b04 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201010" +PI_BUILD="201011" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 5c19b3db19..da6b2bc35e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201010} +{201011} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b44605a1d0..ddeac5e290 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.749(Build 201010)") +#define PANDORA_VERSION ("7.0NG.749(Build 201011)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d6920784e5..e37ed283ac 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.749(Build 201010))" + VALUE "ProductVersion", "(7.0NG.749(Build 201011))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 345cc0ba3d..71691309a5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201010 +Version: 7.0NG.749-201011 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 4af407172b..764bc97e01 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.749-201010" +pandora_version="7.0NG.749-201011" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 28859c17c5..a38adc302d 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 = 'PC201010'; +$build_version = 'PC201011'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4b1d34e6cc..f097aa9bd9 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 f3a5706cc4..10ca32498f 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.749 -%define release 201010 +%define release 201011 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 64e9f20ea6..a83486719c 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.749 -%define release 201010 +%define release 201011 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 17c49de25b..29f3bb5f2f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201010" +PI_BUILD="201011" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0fb526c5bb..b660d6dfb0 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.749 PS201010"; +my $version = "7.0NG.749 PS201011"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index cc1a9fb5a3..51f077732a 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.749 PS201010"; +my $version = "7.0NG.749 PS201011"; # save program name for logging my $progname = basename($0); From 8146e5377e014cd7868dbb194a2b040805ba7cb9 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 12 Oct 2020 01:00:16 +0200 Subject: [PATCH 025/180] 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 47c566563a..d30bfd99c0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201011 +Version: 7.0NG.749-201012 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 3e80164f05..924b3a90f5 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.749-201011" +pandora_version="7.0NG.749-201012" 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 004f4cf3a5..03233bcd43 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.749'; -use constant AGENT_BUILD => '201011'; +use constant AGENT_BUILD => '201012'; # 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 38fd7d6d9e..bd92c09e02 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.749 -%define release 201011 +%define release 201012 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 09fd616e88..c49acacd78 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.749 -%define release 201011 +%define release 201012 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 e6fe9e9b04..cb1b1c6482 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201011" +PI_BUILD="201012" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index da6b2bc35e..3e43dd7ffd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201011} +{201012} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ddeac5e290..c83540f47d 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.749(Build 201011)") +#define PANDORA_VERSION ("7.0NG.749(Build 201012)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e37ed283ac..892cef6269 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.749(Build 201011))" + VALUE "ProductVersion", "(7.0NG.749(Build 201012))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 71691309a5..2542a93b6c 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201011 +Version: 7.0NG.749-201012 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 764bc97e01..d3db175af7 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.749-201011" +pandora_version="7.0NG.749-201012" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a38adc302d..d11796b5be 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 = 'PC201011'; +$build_version = 'PC201012'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f097aa9bd9..79dd0ec335 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 10ca32498f..58931f4dba 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.749 -%define release 201011 +%define release 201012 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a83486719c..94b5e4e423 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.749 -%define release 201011 +%define release 201012 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 29f3bb5f2f..8023b11b82 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201011" +PI_BUILD="201012" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b660d6dfb0..6e6e1e92f3 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.749 PS201011"; +my $version = "7.0NG.749 PS201012"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 51f077732a..2b279a734d 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.749 PS201011"; +my $version = "7.0NG.749 PS201012"; # save program name for logging my $progname = basename($0); From 2b06c5babc59a0a71329cad637eaf8dd08b4028b Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 13 Oct 2020 01:00:16 +0200 Subject: [PATCH 026/180] 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 d30bfd99c0..fbac56e44f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201012 +Version: 7.0NG.749-201013 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 924b3a90f5..0472cbd6f0 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.749-201012" +pandora_version="7.0NG.749-201013" 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 03233bcd43..4d42a1168c 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.749'; -use constant AGENT_BUILD => '201012'; +use constant AGENT_BUILD => '201013'; # 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 bd92c09e02..bfc0361708 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.749 -%define release 201012 +%define release 201013 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 c49acacd78..b49278d781 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.749 -%define release 201012 +%define release 201013 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 cb1b1c6482..57a810a863 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201012" +PI_BUILD="201013" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3e43dd7ffd..45b73f89b9 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201012} +{201013} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index c83540f47d..d67a055291 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.749(Build 201012)") +#define PANDORA_VERSION ("7.0NG.749(Build 201013)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 892cef6269..69b7fce845 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.749(Build 201012))" + VALUE "ProductVersion", "(7.0NG.749(Build 201013))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2542a93b6c..acd45ef0e5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201012 +Version: 7.0NG.749-201013 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 d3db175af7..5e05f07806 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.749-201012" +pandora_version="7.0NG.749-201013" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d11796b5be..977e0f1fc3 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 = 'PC201012'; +$build_version = 'PC201013'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 79dd0ec335..a1a01b311c 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 58931f4dba..d45a1e19b2 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.749 -%define release 201012 +%define release 201013 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 94b5e4e423..ff807c9c96 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.749 -%define release 201012 +%define release 201013 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 8023b11b82..2d661c548a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201012" +PI_BUILD="201013" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6e6e1e92f3..91690a480c 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.749 PS201012"; +my $version = "7.0NG.749 PS201013"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2b279a734d..ed987fd394 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.749 PS201012"; +my $version = "7.0NG.749 PS201013"; # save program name for logging my $progname = basename($0); From 8c6c4d99a092a480c6fcaf857751f5bd9906e1a6 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 13 Oct 2020 09:32:28 +0200 Subject: [PATCH 027/180] fixed sql graph pie --- pandora_console/include/functions_graph.php | 98 +++++++++++---------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 55ef41ef31..4ac74e9637 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3737,14 +3737,18 @@ function graph_custom_sql_graph( global $config; $SQL_GRAPH_MAX_LABEL_SIZE = 20; - - if (is_metaconsole() && $content['server_name'] !== '0') { - $server = metaconsole_get_connection_names(); - $connection = metaconsole_get_connection($server); + if (is_metaconsole() === true + && empty($content['server_name']) === false + ) { + $connection = metaconsole_get_connection($content['server_name']); metaconsole_connect($connection); } - $report_content = db_get_row('treport_content', 'id_rc', $content['id_rc']); + $report_content = db_get_row( + 'treport_content', + 'id_rc', + $content['id_rc'] + ); if ($report_content == false || $report_content == '') { $report_content = db_get_row( @@ -3755,7 +3759,9 @@ function graph_custom_sql_graph( } if ($report_content == false || $report_content == '') { - if (is_metaconsole() && $content['server_name'] !== '0') { + if (is_metaconsole() === true + && empty($content['server_name']) === false + ) { enterprise_hook('metaconsole_restore_db'); } @@ -3772,9 +3778,10 @@ function graph_custom_sql_graph( ); } - if ((is_metaconsole() & $content['server_name']) !== '0') { - $server = metaconsole_get_connection_names(); - $connection = metaconsole_get_connection($server); + if (is_metaconsole() === true + && empty($content['server_name']) === false + ) { + $connection = metaconsole_get_connection($content['server_name']); metaconsole_connect($connection); } } @@ -3800,7 +3807,7 @@ function graph_custom_sql_graph( $data_result = db_get_all_rows_sql($sql, $historical_db); - if ((is_metaconsole() & $content['server_name']) !== '0') { + if (is_metaconsole() === true && empty($content['server_name']) === false) { enterprise_hook('metaconsole_restore_db'); } @@ -3908,6 +3915,7 @@ function graph_custom_sql_graph( ]; } + $output = ''; switch ($type) { case 'sql_graph_vbar': default: @@ -3936,48 +3944,48 @@ function graph_custom_sql_graph( $output .= vbar_graph($data, $options, $ttl); $output .= '
'; } - return $output; + break; - break; case 'sql_graph_hbar': // Horizontal bar. - return hbar_graph( - $data, - $width, - $height, - [], - [], - '', - '', - '', - '', - $water_mark, - $config['fontpath'], - $config['font_size'], - false, - $ttl, - $homeurl, - 'white', - '#c1c1c1' - ); + $output .= hbar_graph( + $data, + $width, + $height, + [], + [], + '', + '', + '', + '', + $water_mark, + $config['fontpath'], + $config['font_size'], + false, + $ttl, + $homeurl, + 'white', + '#c1c1c1' + ); + break; - break; case 'sql_graph_pie': // Pie. - return pie_graph( - $data, - $width, - $height, - __('other'), - $homeurl, - $water_mark, - $config['fontpath'], - $config['font_size'], - $ttl - ); - - break; + $output .= pie_graph( + $data, + $width, + $height, + __('other'), + $homeurl, + $water_mark, + $config['fontpath'], + $config['font_size'], + $ttl + ); + break; } + + return $output; } From 148384f8fbde390bdd48993ef95a9e95091fc68a Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 13 Oct 2020 18:24:10 +0200 Subject: [PATCH 028/180] phantomjs performance --- .../include/ajax/update_manager.ajax.php | 6 ++ pandora_console/include/chart_generator.php | 25 +++-- .../include/class/ConsoleSupervisor.php | 51 +++++++++- pandora_console/include/functions.php | 32 +++++- pandora_console/include/functions_graph.php | 2 +- .../include/functions_update_manager.php | 6 ++ pandora_console/include/web2image.js | 99 +++++++++++++++---- 7 files changed, 186 insertions(+), 35 deletions(-) diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php index 023766a99e..36034fefa4 100644 --- a/pandora_console/include/ajax/update_manager.ajax.php +++ b/pandora_console/include/ajax/update_manager.ajax.php @@ -272,6 +272,12 @@ if ($install_package) { "Update version: $version of ".$product_name.' by '.$config['id_user'] ); + // An update have been applied, clean phantomjs cache. + config_update_value( + 'clean_phantomjs_cache', + 1 + ); + $return['status'] = 'success'; echo json_encode($return); return; diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index 3ed8e294db..eb67a326e6 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -41,6 +41,17 @@ require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_tags.php'; +$data_raw = get_parameter('data'); +$data_decoded = json_decode(base64_decode($data_raw), true); +if (json_last_error() === JSON_ERROR_NONE) { + $data = urldecode($data_decoded['data']); + $session_id = urldecode($data_decoded['session_id']); + $data_combined = urldecode($data_decoded['data_combined']); + $data_module_list = urldecode($data_decoded['data_module_list']); + $type_graph_pdf = urldecode($data_decoded['type_graph_pdf']); + $viewport_width = urldecode($data_decoded['viewport_width']); +} + /** * Echo to stdout a PhantomJS callback call. @@ -69,7 +80,7 @@ function echoPhantomCallback() global $config; // Try to initialize session using existing php session id. -$user = new PandoraFMS\User(['phpsessionid' => $_REQUEST['session_id']]); +$user = new PandoraFMS\User(['phpsessionid' => $session_id]); if (check_login(false) === false) { // Error handler. ?> @@ -97,12 +108,12 @@ if (check_login(false) === false) { } // Access granted. -$params = json_decode($_REQUEST['data'], true); +$params = json_decode($data, true); // Metaconsole connection to the node. $server_id = $params['server_id']; -if (is_metaconsole() && !empty($server_id)) { +if (is_metaconsole() === true && empty($server_id) === false) { $server = metaconsole_get_connection_by_id($server_id); // Error connecting. if (metaconsole_connect($server) !== NOERR) { @@ -165,12 +176,12 @@ if (file_exists('languages/'.$user_language.'.mo') === true) { $params['only_image'] = false; $params['menu'] = false; - $params_combined = json_decode($_REQUEST['data_combined'], true); - $module_list = json_decode($_REQUEST['data_module_list'], true); - $type_graph_pdf = $_REQUEST['type_graph_pdf']; + $params_combined = json_decode($data_combined, true); + $module_list = json_decode($data_module_list, true); + $type_graph_pdf = $type_graph_pdf; if (isset($params['vconsole']) === false || $params['vconsole'] === false) { - $params['width'] = (int) $_REQUEST['viewport_width']; + $params['width'] = (int) $viewport_width; if ((isset($params['width']) === false || ($params['width'] <= 0)) ) { diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 5caad6f9e8..473a5d3be5 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -107,13 +107,13 @@ class ConsoleSupervisor $this->verbose = $verbose; if ($source === false) { - $this->enabled = false; + $this->notificationsEnabled = false; $this->sourceId = null; $this->targetGroups = null; $this->targetUsers = null; } else { - $this->enabled = (bool) $source['enabled']; + $this->notificationsEnabled = (bool) $source['enabled']; $this->sourceId = $source['id']; // Assign targets. @@ -251,8 +251,10 @@ class ConsoleSupervisor { global $config; - if ($this->enabled === false) { - // Feature not enabled. + $this->maintenanceOperations(); + + if ($this->notificationsEnabled === false) { + // Notifications not enabled. return; } @@ -490,6 +492,21 @@ class ConsoleSupervisor } + /** + * Executes console maintenance operations. Executed ALWAYS through CRON. + * + * @return void + */ + public function maintenanceOperations() + { + /* + * Process cache clean if needed. + */ + + $this->checkCleanPhantomCache(); + } + + /** * Update targets for given notification using object targets. * @@ -2597,4 +2614,30 @@ class ConsoleSupervisor } + /** + * Clean Phantom cache if needed. + * + * @return void + */ + public function checkCleanPhantomCache() + { + global $config; + + if ((int) $config['clean_phantomjs_cache'] !== 1) { + return; + } + + $cache_dir = $config['homedir'].'/attachment/cache'; + if (is_dir($cache_dir) === true) { + rrmdir($cache_dir); + } + + // Clean process has ended. + config_update_value( + 'clean_phantomjs_cache', + 0 + ); + } + + } diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 49de19a9ee..0147168ebf 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3973,8 +3973,22 @@ function series_type_graph_array($data, $show_elements_graph) } -function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false, $module_list=false) -{ +/** + * Draw chart pdf. + * + * @param string $type_graph_pdf Type graph. + * @param array $params Params. + * @param boolean $params_combined Params only charts combined. + * @param boolean $module_list Array modules. + * + * @return string Img or base64. + */ +function generator_chart_to_pdf( + $type_graph_pdf, + $params, + $params_combined=false, + $module_list=false +) { global $config; if (is_metaconsole()) { @@ -4016,8 +4030,18 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false } $session_id = session_id(); + $cache_dir = $config['homedir'].'/attachment/cache'; - $cmd = '"'.io_safe_output($config['phantomjs_bin']).DIRECTORY_SEPARATOR.'phantomjs" --ssl-protocol=any --ignore-ssl-errors=true "'.$file_js.'" '.' "'.$url.'"'.' "'.$type_graph_pdf.'"'.' "'.$params_encode_json.'"'.' "'.$params_combined.'"'.' "'.$module_list.'"'.' "'.$img_path.'"'.' "'.$width_img.'"'.' "'.$height_img.'"'.' "'.$session_id.'"'.' "'.$params['return_img_base_64'].'"'; + $cmd = '"'.io_safe_output($config['phantomjs_bin']); + $cmd .= DIRECTORY_SEPARATOR.'phantomjs" '; + $cmd .= ' --disk-cache=true --disk-cache-path="'.$cache_dir.'"'; + $cmd .= ' --max-disk-cache-size=10000 '; + $cmd .= ' --ssl-protocol=any --ignore-ssl-errors=true '; + $cmd .= '"'.$file_js.'" "'.$url.'" "'.$type_graph_pdf.'"'; + $cmd .= ' "'.$params_encode_json.'" "'.$params_combined.'"'; + $cmd .= ' "'.$module_list.'" "'.$img_path.'"'; + $cmd .= ' "'.$width_img.'" "'.$height_img.'"'; + $cmd .= ' "'.$session_id.'" "'.$params['return_img_base_64'].'"'; $result = null; $retcode = null; @@ -4029,7 +4053,7 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false // To be used in alerts. return $img_content; } else { - // to be used in PDF files. + // To be used in PDF files. $config['temp_images'][] = $img_path; return ''; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 55ef41ef31..9a02ad1dbc 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1349,7 +1349,7 @@ function graphic_combined_module( if ($count_modules > 0) { foreach ($module_list as $key => $value) { $sources[$key]['id_server'] = (isset($value['id_server']) === true) ? $value['id_server'] : $params['server_id']; - $sources[$key]['id_agent_module'] = $value['module']; + $sources[$key]['id_agent_module'] = (isset($value['module']) === true) ? $value['module'] : $value; $sources[$key]['weight'] = $weights[$key]; $sources[$key]['label'] = $params_combined['labels']; } diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index 77b6e5e432..2b3dcbc093 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -1753,6 +1753,12 @@ function update_manager_extract_package() return false; } + // An update have been applied, clean phantomjs cache. + config_update_value( + 'clean_phantomjs_cache', + 1 + ); + db_process_sql_update( 'tconfig', ['value' => 50], diff --git a/pandora_console/include/web2image.js b/pandora_console/include/web2image.js index b1fb421c7e..e7014d3f5b 100644 --- a/pandora_console/include/web2image.js +++ b/pandora_console/include/web2image.js @@ -27,27 +27,79 @@ if (!viewport_height) { } if (type_graph_pdf == "combined") { - post_data = - "data=" + - url_params + - "&data_combined=" + - url_params_comb + - "&data_module_list=" + - url_module_list + - "&type_graph_pdf=" + - type_graph_pdf + - "&session_id=" + - session_id; + post_data = { + data: url_params, + session_id: session_id, + type_graph_pdf: type_graph_pdf, + data_module_list: url_module_list, + data_combined: url_params_comb + }; } else { - post_data = - "data=" + - url_params + - "&type_graph_pdf=" + - type_graph_pdf + - "&session_id=" + - session_id; + post_data = { + data: url_params, + session_id: session_id, + type_graph_pdf: type_graph_pdf + }; } +/* DEBUG +page.onAlert = function() { + console.log("onAlert"); +}; +page.onCallback = function() { + console.log("onCallback"); +}; +page.onClosing = function() { + console.log("onClosing"); +}; +page.onConfirm = function() { + console.log("onConfirm"); +}; +page.onConsoleMessage = function() { + console.log("onConsoleMessage"); +}; +page.onError = function() { + console.log("onError"); +}; +page.onFilePicker = function() { + console.log("onFilePicker"); +}; +page.onInitialized = function() { + console.log("onInitialized"); +}; +page.onLoadFinished = function() { + console.log("onLoadFinished"); +}; +page.onLoadStarted = function() { + console.log("onLoadStarted"); +}; +page.onNavigationRequested = function() { + console.log("onNavigationRequested"); +}; +page.onPageCreated = function() { + console.log("onPageCreated"); +}; +page.onPrompt = function() { + console.log("onPrompt"); +}; +page.onResourceError = function() { + console.log("onResourceError"); +}; +page.onResourceReceived = function(res) { + console.log("onResourceReceived" + ";" + res.url + ";" + res.status); +}; +page.onResourceRequested = function(res) { + console.log("onResourceRequested" + ";" + res.url); +}; +page.onResourceTimeout = function() { + console.log("onResourceTimeout"); +}; +page.onUrlChanged = function(url) { + console.log("onUrlChanged" + ";" + url); +}; + +*/ + var page = require("webpage").create(); page.onResourceError = function(resourceError) { @@ -80,8 +132,15 @@ page.viewportSize = { page.zoomFactor = 1; +page.settings.userAgent = + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"; +page.settings.resourceTimeout = 2000; +page.settings.localToRemoteUrlAccessEnabled = true; + page.onConsoleMessage = function(msg) { console.log(msg); + page.close(); + phantom.exit(); }; page.onError = function(msg) { @@ -102,7 +161,9 @@ page.onCallback = function() { phantom.exit(); }; -page.open(url, "POST", post_data, function(status) { +page.open(url, "POST", "data=" + btoa(JSON.stringify(post_data)), function( + status +) { if (status == "fail") { console.out("Failed to generate chart."); phantom.exit(); From 4c67e17e84c31042845843b2caa0bb80ecd4fee2 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 14 Oct 2020 01:00:19 +0200 Subject: [PATCH 029/180] 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 fbac56e44f..dbf6ebb817 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201013 +Version: 7.0NG.749-201014 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 0472cbd6f0..14d168f35c 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.749-201013" +pandora_version="7.0NG.749-201014" 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 4d42a1168c..27f71c6c2a 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.749'; -use constant AGENT_BUILD => '201013'; +use constant AGENT_BUILD => '201014'; # 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 bfc0361708..87059ce3d2 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.749 -%define release 201013 +%define release 201014 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 b49278d781..a94381724f 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.749 -%define release 201013 +%define release 201014 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 57a810a863..754cc379a5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201013" +PI_BUILD="201014" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 45b73f89b9..9d349bbec6 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201013} +{201014} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d67a055291..8a4d2ec0a4 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.749(Build 201013)") +#define PANDORA_VERSION ("7.0NG.749(Build 201014)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 69b7fce845..e549088dc5 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.749(Build 201013))" + VALUE "ProductVersion", "(7.0NG.749(Build 201014))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index acd45ef0e5..ed5cdbe487 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201013 +Version: 7.0NG.749-201014 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 5e05f07806..77a36857de 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.749-201013" +pandora_version="7.0NG.749-201014" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 977e0f1fc3..aaeb151a33 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 = 'PC201013'; +$build_version = 'PC201014'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index a1a01b311c..85f07f7acf 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 d45a1e19b2..79476360db 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.749 -%define release 201013 +%define release 201014 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index ff807c9c96..675ab09a83 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.749 -%define release 201013 +%define release 201014 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2d661c548a..306aef3aee 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201013" +PI_BUILD="201014" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 91690a480c..eeccd870fd 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.749 PS201013"; +my $version = "7.0NG.749 PS201014"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ed987fd394..a60f2e5942 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.749 PS201013"; +my $version = "7.0NG.749 PS201014"; # save program name for logging my $progname = basename($0); From b97e8697f9f5550d9227492d530182724149f990 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 14 Oct 2020 10:31:46 +0200 Subject: [PATCH 030/180] Include SAML in pandora standard session handler (php) --- pandora_console/include/load_session.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/load_session.php b/pandora_console/include/load_session.php index 7d06cea88d..3575310141 100644 --- a/pandora_console/include/load_session.php +++ b/pandora_console/include/load_session.php @@ -198,14 +198,11 @@ function pandora_session_gc($max_lifetime=300) } -// TODO: SAML should work with pandora session handlers. -if (db_get_value('value', 'tconfig', 'token', 'auth') != 'saml') { - $result_handler = session_set_save_handler( - 'pandora_session_open', - 'pandora_session_close', - 'pandora_session_read', - 'pandora_session_write', - 'pandora_session_destroy', - 'pandora_session_gc' - ); -} +$result_handler = session_set_save_handler( + 'pandora_session_open', + 'pandora_session_close', + 'pandora_session_read', + 'pandora_session_write', + 'pandora_session_destroy', + 'pandora_session_gc' +); From 510a96af8f68ee9fbd2bd27977ad758aefa28155 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 14 Oct 2020 11:17:05 +0200 Subject: [PATCH 031/180] fixed sql grph --- .../images/image_problem_area_150.png | Bin 0 -> 14298 bytes pandora_console/include/functions_graph.php | 9 +++------ pandora_console/include/functions_reporting.php | 2 +- pandora_console/include/graphs/fgraph.php | 9 ++++++++- 4 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 pandora_console/images/image_problem_area_150.png diff --git a/pandora_console/images/image_problem_area_150.png b/pandora_console/images/image_problem_area_150.png new file mode 100644 index 0000000000000000000000000000000000000000..b1e8e3668306cae131f401b79db6471e97590e9b GIT binary patch literal 14298 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 'width:150px;'] - ) + $config['homedir'].'/images/image_problem_area_150.png' ); return base64_encode($dataImg); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 10a1992e18..0bfe96e864 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -8608,7 +8608,7 @@ function reporting_set_conf_charts( $ttl = 2; $only_image = true; $height = isset($content['style']['dyn_height']) ? $content['style']['dyn_height'] : 230; - $width = 780; + $width = 650; break; case 'data': diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 6f341381c5..6637f5729a 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -535,7 +535,14 @@ function vbar_graph( ]; if (empty($params['data']) === true) { - return graph_nodata_image(0, 0, 'vbar', '', true); + return graph_nodata_image( + 0, + 0, + 'vbar', + '', + true, + ($ttl === 2) ? true : false + ); } if ((int) $ttl === 2) { From 7cd56b6f940daeb75bc993c12dea3d3eb712088c Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 14 Oct 2020 11:48:34 +0200 Subject: [PATCH 032/180] Ent 6466 borrado de eventos con pandora db --- pandora_server/util/pandora_db.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index eeccd870fd..60280f164f 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -1011,7 +1011,7 @@ sub pandoradb_main ($$$) { # Move old data to the history DB if (defined ($history_dbh)) { undef ($history_dbh) unless defined (enterprise_hook ('pandora_historydb', [$dbh, $history_dbh, $conf->{'_history_db_days'}, $conf->{'_history_db_step'}, $conf->{'_history_db_delay'}])); - if (defined($conf{'_history_event_enabled'})) { + if (defined($conf{'_history_event_enabled'}) && $conf->{'_history_event_enabled'} ne "" && $conf->{'_history_event_enabled'} == 1) { undef ($history_dbh) unless defined (enterprise_hook ('pandora_history_event', [$dbh, $history_dbh, $conf->{'_history_event_days'}, $conf->{'_history_db_step'}, $conf->{'_history_db_delay'}])); } } From 6aaa4802e5be67211bfff4c8aab00978e04b61fe Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 15 Oct 2020 01:00:18 +0200 Subject: [PATCH 033/180] 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 dbf6ebb817..0bcf6686f9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201014 +Version: 7.0NG.749-201015 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 14d168f35c..5d7e59fab3 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.749-201014" +pandora_version="7.0NG.749-201015" 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 27f71c6c2a..8d22e4a60a 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.749'; -use constant AGENT_BUILD => '201014'; +use constant AGENT_BUILD => '201015'; # 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 87059ce3d2..c2d504b6c8 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.749 -%define release 201014 +%define release 201015 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 a94381724f..2b265f0c3c 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.749 -%define release 201014 +%define release 201015 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 754cc379a5..c7dc691c73 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201014" +PI_BUILD="201015" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9d349bbec6..572964e2fd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{201014} +{201015} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8a4d2ec0a4..39b36eb7b8 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.749(Build 201014)") +#define PANDORA_VERSION ("7.0NG.749(Build 201015)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e549088dc5..d19d05cf77 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.749(Build 201014))" + VALUE "ProductVersion", "(7.0NG.749(Build 201015))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ed5cdbe487..af6d734ef8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.749-201014 +Version: 7.0NG.749-201015 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 77a36857de..d69ab9ef05 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.749-201014" +pandora_version="7.0NG.749-201015" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index aaeb151a33..a4f9e897ca 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 = 'PC201014'; +$build_version = 'PC201015'; $pandora_version = 'v7.0NG.749'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 85f07f7acf..95c485a93e 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 79476360db..d0492bcd9e 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.749 -%define release 201014 +%define release 201015 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 675ab09a83..cbed3d6108 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.749 -%define release 201014 +%define release 201015 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 306aef3aee..27ccf4c8b6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.749" -PI_BUILD="201014" +PI_BUILD="201015" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 60280f164f..057655db8f 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.749 PS201014"; +my $version = "7.0NG.749 PS201015"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a60f2e5942..a78dc52f9c 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.749 PS201014"; +my $version = "7.0NG.749 PS201015"; # save program name for logging my $progname = basename($0); From 3a890dc8b81ec15c905194cad58a2d2066877cbd Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 15 Oct 2020 10:19:42 +0200 Subject: [PATCH 034/180] Updated version and build strings. --- pandora_agents/pc/AIX/pandora_agent.conf | 2 +- pandora_agents/pc/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/pc/HP-UX/pandora_agent.conf | 2 +- pandora_agents/pc/Linux/pandora_agent.conf | 2 +- pandora_agents/pc/NT4/pandora_agent.conf | 2 +- pandora_agents/pc/SunOS/pandora_agent.conf | 2 +- pandora_agents/pc/Win32/pandora_agent.conf | 2 +- pandora_agents/shellscript/aix/pandora_agent.conf | 2 +- pandora_agents/shellscript/bsd-ipso/pandora_agent.conf | 2 +- pandora_agents/shellscript/hp-ux/pandora_agent.conf | 2 +- pandora_agents/shellscript/linux/pandora_agent.conf | 2 +- pandora_agents/shellscript/mac_osx/pandora_agent.conf | 2 +- pandora_agents/shellscript/openWRT/pandora_agent.conf | 2 +- pandora_agents/shellscript/solaris/pandora_agent.conf | 2 +- pandora_agents/unix/AIX/pandora_agent.conf | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh | 4 ++-- pandora_agents/unix/Darwin/dmg/extras/distribution.xml | 4 ++-- .../PandoraFMS agent uninstaller.app/Contents/Info.plist | 6 +++--- pandora_agents/unix/Darwin/pandora_agent.conf | 2 +- pandora_agents/unix/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/unix/HP-UX/pandora_agent.conf | 2 +- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/unix/NT4/pandora_agent.conf | 2 +- pandora_agents/unix/NetBSD/pandora_agent.conf | 2 +- pandora_agents/unix/SunOS/pandora_agent.conf | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 4 ++-- pandora_agents/unix/pandora_agent.spec | 4 ++-- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/bin/pandora_agent.conf | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- 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 | 4 ++-- pandora_console/pandora_console.rhel7.spec | 4 ++-- pandora_console/pandora_console.spec | 4 ++-- pandora_console/pandora_console_install | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/conf/pandora_server.conf.new | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 4 ++-- pandora_server/pandora_server.spec | 4 ++-- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 53 files changed, 65 insertions(+), 65 deletions(-) diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index a8976d5b1d..cd13d53c4e 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, AIX version +# Version 7.0NG.750, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index db354ce74e..07fc99958f 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, FreeBSD Version +# Version 7.0NG.750, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index 35ab968b83..9848b081b0 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, HP-UX Version +# Version 7.0NG.750, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index d01aedfcb6..e2f3b686a4 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, GNU/Linux +# Version 7.0NG.750, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index d3d6bbe3ad..7ba414f284 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, GNU/Linux +# Version 7.0NG.750, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index a1c0730d7d..f2dd07f5e7 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, Solaris Version +# Version 7.0NG.750, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 58f0273c5f..76f75a08b2 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.749 +# Version 7.0NG.750 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 0a03ed9406..fea0ce1041 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.749, AIX version +# Version 7.0NG.750, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index 960b5c6571..aa89b138b6 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.749 +# Version 7.0NG.750 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index 06f9dad4e7..0401702d44 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.749, HPUX Version +# Version 7.0NG.750, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index c648bdbc26..b0704ea7fd 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749 +# Version 7.0NG.750 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index c8806e32c8..219df052e2 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749 +# Version 7.0NG.750 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index c11692b728..7a655da9fc 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749 +# Version 7.0NG.750 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index 59db4e115a..c6ee8fddeb 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.749, Solaris version +# Version 7.0NG.750, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 52c9ac9686..0b32587052 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.749, AIX version +# Version 7.0NG.750, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0bcf6686f9..727847ab44 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.749-201015 +Version: 7.0NG.750 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 5d7e59fab3..62105af82f 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.749-201015" +pandora_version="7.0NG.750" 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/Darwin/dmg/build_darwin_dmg.sh b/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh index d1bfdb860a..325d149578 100644 --- a/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh +++ b/pandora_agents/unix/Darwin/dmg/build_darwin_dmg.sh @@ -22,9 +22,9 @@ fi # DMG package version if [ "$#" -ge 2 ]; then - VERSION="7.0NG.749" + VERSION="7.0NG.750" else - VERSION="7.0NG.749" + VERSION="7.0NG.750" fi # Path for the generated DMG file diff --git a/pandora_agents/unix/Darwin/dmg/extras/distribution.xml b/pandora_agents/unix/Darwin/dmg/extras/distribution.xml index 18a2823e8d..90ce4baef9 100644 --- a/pandora_agents/unix/Darwin/dmg/extras/distribution.xml +++ b/pandora_agents/unix/Darwin/dmg/extras/distribution.xml @@ -19,11 +19,11 @@ - pandorafms_src.pdk + pandorafms_src.pdk - pandorafms_uninstall.pdk + pandorafms_uninstall.pdk