From b007e2d924055c61b4c72620d221bc38321ff6f8 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Mon, 27 Aug 2018 12:12:09 +0200 Subject: [PATCH 01/66] Suppress entities in System audit log comments --- pandora_console/godmode/admin_access_logs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 82f0af0f7e..219177402f 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -235,7 +235,7 @@ foreach ($result as $row) { $data[2] = ui_print_help_tip(date($config["date_format"], $row["utimestamp"]), true) . ui_print_timestamp($row["utimestamp"], true); $data[3] = $row["ip_origen"]; - $data[4] = $row["descripcion"]; + $data[4] = io_safe_output($row["descripcion"]); if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { $data[5] = enterprise_hook("cell1EntepriseAudit", array($row["id_sesion"])); From 997b1e21d72acf0f4e97cb856e33efa822f55023 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Tue, 4 Sep 2018 12:26:47 +0200 Subject: [PATCH 02/66] Fixed bug in modules deletion: parent id set to 0 in case parent has been deleted --- pandora_server/util/pandora_db.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2989207841..8f10bc4c8e 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -292,12 +292,22 @@ sub pandora_purgedb ($$) { # Delete pending modules log_message ('PURGE', "Deleting pending delete modules (data table).", ''); + my @deleted_modules = get_db_rows ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE delete_pending = 1'); + my @all_modules = get_db_rows ($dbh, 'SELECT id_agente_modulo, parent_module_id FROM tagente_modulo'); foreach my $module (@deleted_modules) { my $buffer = 1000; my $id_module = $module->{'id_agente_modulo'}; - + + foreach my $m (@all_modules) { + my $id_parent = $m->{'parent_module_id'}; + my $id_module_fetched = $m->{'id_agente_modulo'}; + if ($id_parent == $id_module) { + db_do ($dbh, 'UPDATE tagente_modulo SET parent_module_id=0 WHERE id_agente_modulo=?', $id_module_fetched); + } + } + log_message ('', "."); while(1) { From a0470114a53da2a6361ea2f710081a0bddb016ea Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Tue, 4 Sep 2018 13:00:43 +0200 Subject: [PATCH 03/66] Fixed bug in module manager --- pandora_console/godmode/agentes/module_manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index b475e29e2b..c5fb96b591 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -138,7 +138,7 @@ if (($policy_page) || (isset($agent))) { echo '</td>'; } echo '<td class="datos" style="font-weight: bold; width:20%;">'; - echo __("Type"); + echo __("<p>Type</p>"); html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' ); html_print_input_hidden ('edit_module', 1); echo '</td>'; @@ -638,7 +638,7 @@ foreach ($modules as $module) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) $table->colspan[$i - 1][0] = 10; else - $table->colspan[$i - 1][0] = 8; + $table->colspan[$i - 1][0] = 9; $data = array (); } From 7d6bf289f8fcebd78fa25909edf33f509808a1a5 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Wed, 5 Sep 2018 08:23:57 +0200 Subject: [PATCH 04/66] visuals fix in visual styles --- .../godmode/setup/setup_visuals.php | 105 ++++++------------ 1 file changed, 31 insertions(+), 74 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 88b2392e14..0a7d36f8f5 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -83,13 +83,8 @@ $table_behaviour->data[$row][1] = html_print_checkbox('paginate_module', 1, $row++; $table_behaviour->data[$row][0] = __('Display data of proc modules in other format'); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('render_proc', 1, '', - $config["render_proc"], true) . - ' '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('render_proc', 0, '', - $config["render_proc"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('render_proc', 1, + $config['render_proc'], true); $row++; $table_behaviour->data[$row][0] = __('Display text proc modules have state is ok'); @@ -103,13 +98,8 @@ $row++; //Daniel maya 02/06/2016 Display menu with click --INI $table_behaviour->data[$row][0] = __('Click to display lateral menus'). ui_print_help_tip(__('When enabled, the lateral menus are shown when left clicking them, instead of hovering over them'), true); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('click_display', 1, '', - $config["click_display"], true) . - ' '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('click_display', 0, '', - $config["click_display"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('click_display', 1, + $config['click_display'], true); $row++; //Daniel maya 02/06/2016 Display menu with click --END @@ -126,13 +116,8 @@ if (enterprise_installed()) { $table_behaviour->data[$row][0] = __('Classic menu mode'). ui_print_help_tip(__('Text menu options always visible, don\'t hide'), true); -$table_behaviour->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('classic_menu', 1, '', - $config["classic_menu"], true) . - ' '; -$table_behaviour->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('classic_menu', 0, '', - $config["classic_menu"], true); +$table_behaviour->data[$row][1] = html_print_checkbox('classic_menu', 1, + $config['classic_menu'], true); $row++; echo "<fieldset>"; @@ -398,41 +383,31 @@ if(enterprise_installed()) { $row++; } -$table_styles->data[$row][0] = __('Disable logo in graphs'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) . - ' '; +if (enterprise_installed()){ + $table_styles->data[$row][0] = __('Disable logo in graphs'); + $table_styles->data[$row][1] = html_print_checkbox('fixed_graph', 1, + $config['fixed_graph'], true); + $row++; +} + /* Hello there! :) We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. */ - -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button_extended ('fixed_graph', 0, '', $config["fixed_graph"], $open, '','',true, $open,'visualmodal'); -$row++; $table_styles->data[$row][0] = __('Disable helps'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('disable_help', 1, '', $config["disable_help"], true) . - ' '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('disable_help', 0, '', $config["disable_help"], true); +$table_styles->data[$row][1] = html_print_checkbox('disable_help', 1, + $config['disable_help'], true); $row++; $table_styles->data[$row][0] = __('Fixed header'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) . - ' '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true); +$table_styles->data[$row][1] = html_print_checkbox('fixed_header', 1, + $config['fixed_header'], true); $row++; $table_styles->data[$row][0] = __('Fixed menu'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) . - ' '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true); +$table_styles->data[$row][1] = html_print_checkbox('fixed_menu', 1, + $config['fixed_menu'], true); $row++; // For 5.1 Autohidden menu feature @@ -441,11 +416,8 @@ $table_styles->data['autohidden'][1] = html_print_checkbox('autohidden_menu', 1, $config['autohidden_menu'], true); $table_styles->data[$row][0] = __('Visual effects and animation'); -$table_styles->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('visual_animation', 1, '', $config["visual_animation"], true) . - ' '; -$table_styles->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('visual_animation', 0, '', $config["visual_animation"], true); +$table_styles->data[$row][1] = html_print_checkbox('visual_animation', 1, + $config['visual_animation'], true); echo "<fieldset>"; echo "<legend>" . __('Style configuration') . "</legend>"; @@ -465,10 +437,8 @@ $table_gis->data = array (); $table_gis->data[$row][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); -$table_gis->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).' '; -$table_gis->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true); +$table_gis->data[$row][1] = html_print_checkbox('gis_label', 1, +$config['gis_label'], true); $row++; $listIcons = gis_get_array_list_icons(); @@ -558,10 +528,8 @@ $row++; $table_font->data[$row][0] = __('Show unit along with value in reports') . ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true); -$table_font->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('simple_module_value', 1, '', $config["simple_module_value"], true).' '; -$table_font->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('simple_module_value', 0, '', $config["simple_module_value"], true); +$table_font->data[$row][1] = html_print_checkbox('simple_module_value', 1, +$config['simple_module_value'], true); $row++; echo "<fieldset>"; @@ -647,8 +615,8 @@ $table_chars->data[$row][1] = html_print_input_text ('custom_graph_width', $row++; $table_chars->data[$row][0] = __('Use round corners'); -$table_chars->data[$row][1] = __('Yes').' '.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).' '; -$table_chars->data[$row][1] .= __('No').' '.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true); +$table_chars->data[$row][1] = html_print_checkbox('round_corner', 1, +$config['round_corner'], true); $row++; $table_chars->data[$row][0] = __('Type of module charts'); @@ -855,14 +823,8 @@ $table_other->data['custom_report_front-footer'][1] = html_print_textarea('custo $table_other->data[$row][0] = __('Show QR Code icon in the header'); -$table_other->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('show_qr_code_header', 1, '', - $config["show_qr_code_header"], true) . - ' '; -$table_other->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('show_qr_code_header', 0, '', - $config["show_qr_code_header"], true); - +$table_other->data[$row][1] = html_print_checkbox('show_qr_code_header', 1, +$config['show_qr_code_header'], true); $row++; $table_other->data[$row][0] = __('Custom graphviz directory') . @@ -882,13 +844,8 @@ $row++; $table_other->data[$row][0] = __('Show only the group name'); $table_other->data[$row][0] .= ui_print_help_tip( __('Show the group name instead the group icon.'), true); -$table_other->data[$row][1] = __('Yes') . ' ' . - html_print_radio_button ('show_group_name', 1, '', - $config["show_group_name"], true) . - ' '; -$table_other->data[$row][1] .= __('No') . ' ' . - html_print_radio_button ('show_group_name', 0, '', - $config["show_group_name"], true); + html_print_checkbox('show_group_name', 1, + $config['show_group_name'], true); $row++; $table_other->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true); From 481582f62856f983cf4500135985f22da0f49028 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Thu, 6 Sep 2018 16:42:52 +0200 Subject: [PATCH 05/66] Changed event type 'Going down to critical' to 'Going up to critical' --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 0d496bf9c4..3df864156f 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1162,7 +1162,7 @@ function events_print_type_description ($type, $return = false) { break; case "going_down_critical": case "going_up_critical": //This is to be backwards compatible - $output .= __('Going down to critical state'); + $output .= __('Going up to critical state'); break; case "going_up_normal": case "going_down_normal": //This is to be backwards compatible From a721eadcbd6ef3154e6030030d7b6a55b0cf5644 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Fri, 7 Sep 2018 08:36:06 +0200 Subject: [PATCH 06/66] Fixed bug in the construction of the name of the xml file --- pandora_console/extensions/insert_data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index 5cfcc331d0..b930462fe5 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -48,7 +48,7 @@ function createXMLData($agent, $agentModule, $time, $data) { $data ); - $file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . str_replace($time, " ", "_") . ".data"; + $file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . strtotime($time) . ".data"; return (bool) @file_put_contents($file_name, $xml); } @@ -115,7 +115,7 @@ function mainInsertData() { $utimestamp = strtotime($date . " " . $time) - get_fixed_offset(); $timestamp = date(DATE_FORMAT . " " . TIME_FORMAT, $utimestamp); $result = createXMLData($agent, $agentModule, $timestamp, $data); - + if ($result) { $done++; } From a807763c1f44aa93d27112d501f3fe379e42b6ac Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Fri, 7 Sep 2018 13:56:35 +0200 Subject: [PATCH 07/66] Added horizontal scroll in the interfaces select --- .../godmode/agentes/agent_wizard.snmp_interfaces_explorer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index e27c014a1f..7e1e8bd2f7 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -541,7 +541,7 @@ if (!empty($interfaces_list)) { $table->data[0][1] = ''; $table->data[0][2] = '<b>'.__('Modules').'</b>'; - $table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px;'); + $table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;'); $table->data[1][1] = html_print_image('images/darrowright.png', true); $table->data[1][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;'); $table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true); From 3c251257138a0551798797489f80d51fbde7941b Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Mon, 10 Sep 2018 13:01:48 +0200 Subject: [PATCH 08/66] fixed bug: hide not init agents not working in report item creation --- .../include/functions_reporting_html.php | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 9ed6ab16e1..b2dc71c756 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -381,7 +381,7 @@ function reporting_html_SLA($table, $item, $mini) { } } - if(isset($item['data'])){ + if(!(!isset($item['data']) && $hide_notinit_agent == 1)) { $table1 = new stdClass(); $table1->width = '99%'; @@ -471,20 +471,23 @@ function reporting_html_SLA($table, $item, $mini) { foreach ($item['data'] as $sla) { if(isset($sla)){ $the_first_men_time = get_agent_first_time(io_safe_output($sla['agent'])); - if (!$hide_notinit_agent) { - //first_table - $row = array(); - $row[] = $sla['agent']; - $row[] = $sla['module']; - if(is_numeric($sla['dinamic_text'])){ - $row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " . - sla_truncate($sla['min'], $config['graph_precision']); - } - else{ - $row[] = $sla['dinamic_text']; - } - $row[] = round($sla['sla_limit'], 2) . "%"; + //first_table + $row = array(); + $row[] = $sla['agent']; + $row[] = $sla['module']; + + if(is_numeric($sla['dinamic_text'])){ + $row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " . + sla_truncate($sla['min'], $config['graph_precision']); + } + else{ + $row[] = $sla['dinamic_text']; + } + $row[] = round($sla['sla_limit'], 2) . "%"; + + if (!$hide_notinit_agent) { + if (reporting_sla_is_not_init_from_array($sla)) { $row[] = '<span style="font: bold '.$font_size.'em Arial, Sans-serif; color: '.COL_NOTINIT.';">' . @@ -646,6 +649,11 @@ function reporting_html_SLA($table, $item, $mini) { $table->colspan['checks_global']['cell'] = 2; $table->data['checks_global']['cell'] = html_print_table($table3, true); } + else { + $table->colspan['error']['cell'] = 3; + $table->data['error']['cell'] = + __('There are no Agent/Modules defined'); + } if (!empty($item['charts'])) { $table1 = new stdClass(); @@ -2313,7 +2321,7 @@ function reporting_html_availability(&$table, $item) { global $config; - if (!empty($item["data"])) { + if (!empty($item["data"]) || ($hide_notinit_agent !=1 && ($item['type'] == "availability" || $item['type'] == "sla"))) { $table1 = new stdClass(); $table1->width = '99%'; $table1->data = array (); From e0242462ebc9b7f0d406a4a07c89ed23860f8673 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Mon, 10 Sep 2018 13:10:27 +0200 Subject: [PATCH 09/66] modified function for availability reporting --- pandora_console/include/functions_reporting_html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index b2dc71c756..df58255356 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2321,7 +2321,7 @@ function reporting_html_availability(&$table, $item) { global $config; - if (!empty($item["data"]) || ($hide_notinit_agent !=1 && ($item['type'] == "availability" || $item['type'] == "sla"))) { + if (!empty($item["data"]) || $hide_notinit_agent !=1) { $table1 = new stdClass(); $table1->width = '99%'; $table1->data = array (); From d36c10fa089858a7ca1e2a8fcd4bc8ebe117c4ac Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Mon, 10 Sep 2018 13:22:02 +0200 Subject: [PATCH 10/66] new function that adds a border to the image if the status is warning - #2723 --- pandora_console/images/tip_border.png | Bin 0 -> 1281 bytes pandora_console/include/functions_ui.php | 17 +++++++++++++++++ .../operation/events/events.build_table.php | 9 ++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 pandora_console/images/tip_border.png diff --git a/pandora_console/images/tip_border.png b/pandora_console/images/tip_border.png new file mode 100755 index 0000000000000000000000000000000000000000..a7a9663a311034bc1f1a959ae01f2b80ed700f08 GIT binary patch literal 1281 zcmeAS@N?(olHy`uVBq!ia0vp^d_c_2!3HG#TlXXZDajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_cg49rTIArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{<S3ODsN@GWpo&B*kqDoPEm@(W3>%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY0?5R~r2Ntn zTP2`NAzsKWfE$}v3=Jk=fazBx7U&!58GyV5Q|Rl9UukYGTy=3tP%6T`SPd=?sVqp< z4@xc0FD*(2MqHXQ$f^P>=c3falKi5O{QMkPC<bKYm*f{`<QFJ72b(EqglFcZ<d+v~ zg4O%_T6yLbmn7yTr+T{BDgjN<%gju%ax$<mG;lF?b24!ShPtbTqqCWtg`=yJxuJ=H ztE-6tOs`9Ra%paAUI|QZ3S6&=0ZzT3q>x(xwAm%KD6=dz#jPkmR{`v0t4!Q(alvUG zRBsASw-~$P)T<A4j6Nu0ks=x<1WY|3COp{!Iq-y^ng>knMZjdOc->c+fq}8q)5S5Q z;#SEdZ*QhRk>mfbZ=bT%F{z((>I98wmsHk=i#qOX<xqU#z2%&1{KEXeb+>OMD+WsF zYH4H(+D(XaGwEFK^V~0enTYW256{n3{y8_Zc&E>_)GgMH4hx!n<X@@^b&5oNUL(80 zL9IDtLushOv)&(TGIZB|ke|R{Jd-Q)&ei$*qdul@C^u?3(wsUeX}XHAsfPB}S!pL0 zJXbxI(s}2>g1s#NUBsI9u2>Q-$sGP^|JjAvv+Ujq7Jca5yD;i<i`yK_7o{?%i~9v+ zj`}wH9je?Tex36+&sDeC2iHUxEZY5<n>+Y??}F>PtGePWJ_H)9D1BQt=W5oIhyugj zuMUd@@7oqA*F16ZP5Qj$@yq$LQ=JbQcWxGVZvSs}M$lT9y_~mJIloo2dTaai%CTFz z?=FSCInK7>Np(|s#F203G&a3YGe5ZU+UdaA#peX<N)+d9(F~sRrTgXVC89BDS^w^{ xI|Q>D$z3umT|a64@_hT3^ZxkkeHY!p$k3C#FudDT^%1C0@^tlcS?83{1OT=M&XNEC literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 54334e4ecf..d43e2a6e22 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1952,6 +1952,23 @@ function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png', $is echo $output; } +function ui_print_help_tip_border ($text, $return = false, $img = 'images/tip_border.png', $is_relative = false) { + $output = + '<a href="javascript:" class="tip" >' . + html_print_image ( + $img, + true, + array('title' => $text), + false, + $is_relative && is_metaconsole() + ) . + '</a>'; + + if ($return) + return $output; + echo $output; +} + /** * Powerful debug function that also shows a backtrace. * diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 84b995af28..a26572f9e0 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -676,7 +676,14 @@ else { } $comments_help_tip = ""; if (!empty($event_user_comment_str)) { - $comments_help_tip = ui_print_help_tip($event_user_comment_str, true); + + if($myclass == 'datos_yellow'){ + $comments_help_tip = ui_print_help_tip_border($event_user_comment_str, true); + } + else{ + $comments_help_tip = ui_print_help_tip($event_user_comment_str, true); + } + } $data[$i] = '<span id="comment_header_' . $event['id_evento'] . '">' . $comments_help_tip . '</span>'; From 31c153ec27b99995e652569f2dc2d2062d1e13bc Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Tue, 11 Sep 2018 11:01:37 +0200 Subject: [PATCH 11/66] Changed Actions column with the right icons - #2637 --- pandora_console/include/help/en/help_eventview.php | 5 +++-- pandora_console/include/help/es/help_eventview.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/help/en/help_eventview.php b/pandora_console/include/help/en/help_eventview.php index 58bcc49d5a..4d2a5c8d1a 100644 --- a/pandora_console/include/help/en/help_eventview.php +++ b/pandora_console/include/help/en/help_eventview.php @@ -11,7 +11,7 @@ <div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;"> <h3>Validate</h3> <?php html_print_image("images/tick.png", false, array("title" => "Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validated event<br> - <?php html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Event not validated + <?php //html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?><div style="width: 10px;height: 10px; display: inline-block;"></div> - Event not validated </div> <div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;"> @@ -27,7 +27,8 @@ <h3>Actions</h3> <?php html_print_image("images/ok.png", false, array("title" => "Validate event", "alt" => "Validate event")); ?> - Validate event<br> <?php html_print_image("images/cross.png", false, array("title" => "Delete event", "alt" => "Delete event")); ?> - Delete event<br> - <?php html_print_image("images/page_lightning.png", false, array("title" => "Create incident from event", "alt" => "Create incident from event")); ?> - Create incident from event + <?php html_print_image("images/eye.png", false, array("title" => "Show more", "alt" => "Show more")); ?> - Show more<br> + <?php html_print_image("images/hourglass.png", false, array("title" => "In progress", "alt" => "In progress")); ?> - In progress </div> <div style="clear: both;"> </div> diff --git a/pandora_console/include/help/es/help_eventview.php b/pandora_console/include/help/es/help_eventview.php index a01bf52eae..94dc475b43 100644 --- a/pandora_console/include/help/es/help_eventview.php +++ b/pandora_console/include/help/es/help_eventview.php @@ -11,7 +11,7 @@ <div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;"> <h3>Validar</h3> <?php html_print_image("images/tick.png", false, array("title" => "Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validar evento<br> - <?php html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Evento no validado + <?php //html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?><div style="width: 10px;height: 10px; display: inline-block;"></div> - Evento no validado </div> <div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;"> @@ -27,7 +27,8 @@ <h3>Acciones</h3> <?php html_print_image("images/ok.png", false, array("title" => "Validate event", "alt" => "Validate event")); ?> - Validar evento<br> <?php html_print_image("images/cross.png", false, array("title" => "Delete event", "alt" => "Delete event")); ?> - Borrar evento<br> - <?php html_print_image("images/page_lightning.png", false, array("title" => "Create incident from event", "alt" => "Create incident from event")); ?> - Crear incidente del evento + <?php html_print_image("images/eye.png", false, array("title" => "Mostrar más", "alt" => "Mostrar más")); ?> - Mostrar más<br> + <?php html_print_image("images/hourglass.png", false, array("title" => "En progreso", "alt" => "En progreso")); ?> - En progreso </div> <div style="clear: both;"> </div> From 2fb8c99b2a79c41c0032f1eddea7a46fa4ee8a8b Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Tue, 11 Sep 2018 15:30:16 +0200 Subject: [PATCH 12/66] Database and application_osx icons added to select icon of group - #2572 --- .../images/groups_small/application_osx.png | Bin 0 -> 274 bytes pandora_console/images/groups_small/database.png | Bin 0 -> 397 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/groups_small/application_osx.png create mode 100644 pandora_console/images/groups_small/database.png diff --git a/pandora_console/images/groups_small/application_osx.png b/pandora_console/images/groups_small/application_osx.png new file mode 100644 index 0000000000000000000000000000000000000000..14a1a6e2b67d2af36f9bbb5252bfaa64449dac06 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc#=yY%t50_}kRw^*8c`CQpH@<ySd_}(n3A8A zs^FQMn4TJxnwU~qcrw)nsA!9)i(^Q|t)v78rXGbu_wN0(??`i+#>k=2BE*x~z~FR| zg*n2MnMI(Ed1Gcg!x7<xCY=DQ#s#hnj4Z{I7$*oFNVhz5;<Lv$)r8=VJYOa~;m+?C z8yOTDI`}<Tte53jQO)rAYaJ68ze4pg!TDY(t?~=LusCu3URc8D`p~1c)rGl%A$gf6 zPts|>lqTko@5Xk_jx*IKhQ;k;Sjx*$IkVNHo0m=JZopj!u`M0}3oh(w4mq#Mu<3`? Vm-$nlMgZN<;OXk;vd$@?2>_d<UFZM+ literal 0 HcmV?d00001 diff --git a/pandora_console/images/groups_small/database.png b/pandora_console/images/groups_small/database.png new file mode 100644 index 0000000000000000000000000000000000000000..57b46d41365568bf3fe77bb00eebe70c27be0bc4 GIT binary patch literal 397 zcmV;80doF{P)<h;3K|Lk000e1NJLTq000yK000yS1^@s7`i?D|0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzFG)l}RCwBAU_b(lAj00>J^)A=us{XZ zg9v~Cf+J?2^nL{eg@+(%2M`7bAeg5A$jX?Y^aW%=fB?dZuxWRM+3g6WK^A?03GPQy zxqu0akqQ6-#E8rTn(Y8J0tP++@qvQ}4_;tIQuH5>BORF-hy*NH#10_44T>2Exsd_t z#sdHWM6AsWjKrD-3-bL~6u|*dF(b*oJ_yAhkfL4y%Ab#{&>o-F$O&j79yJ$`P0Ys< z*s!EyfGuVmhzUoK&H!|4fkCqY!~h5|sw4C?(GR2w$S?;K+>W61jUIspWI9X$iW$%i zYy{#BP#Z}BAUzMT8CVYuZ~+nx41nb;CTd3tdb*hiP2&@wHWK4fkXQR*UPd=CADS5J r$#5LVF%QtaypfCufhC&{G)dS1j9*7y&jLmy00000NkvXXu0mjf-zkjC literal 0 HcmV?d00001 From 69ec75e39242cb3fadf6d8121a382387fb3ef2ad Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Fri, 14 Sep 2018 09:38:36 +0200 Subject: [PATCH 13/66] Capital letter in the letter a of audit - #2762 --- pandora_console/godmode/setup/setup_general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 37f595a9fb..7d95828b68 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -222,7 +222,7 @@ $table->data[36][0] = __('Include agents manually disabled'); $table->data[36][1] = __('Yes').' '.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).' '; $table->data[36][1] .= __('No').' '.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true); -$table->data[37][0] = __('audit log directory') . +$table->data[37][0] = __('Audit log directory') . ui_print_help_tip (__("Directory where audit log is stored."), true); $table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true); From 7e4ca193cfd73000863155e1cce330edc62cd282 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Fri, 14 Sep 2018 14:19:49 +0200 Subject: [PATCH 14/66] Countdown in group view for autorefresh --- pandora_console/operation/users/user_edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index 83b69c85d2..e5162f967d 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -385,10 +385,11 @@ $data = array(); $autorefresh_list_out = array(); if(is_metaconsole()) { $autorefresh_list_out['monitoring/tactical'] = "tactical"; + $autorefresh_list_out['monitoring/group_view'] = "group_view"; } else { $autorefresh_list_out['operation/agentes/tactical'] = "tactical"; + $autorefresh_list_out['operation/agentes/group_view'] = "group_view"; } -$autorefresh_list_out['operation/agentes/group_view'] = "group_view"; $autorefresh_list_out['operation/agentes/estado_agente'] = "agent_status"; $autorefresh_list_out['operation/agentes/alerts_status'] = "alerts_status"; $autorefresh_list_out['operation/agentes/status_monitor'] = "status_monitor"; From d0e7b86112540ddc89c0ec20bc40bdb5a72ff4e0 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@support.artica.es> Date: Tue, 18 Sep 2018 09:41:05 +0200 Subject: [PATCH 15/66] Fixed bug in deleted policies from the metaconsole --- pandora_console/include/functions.php | 5 +- pandora_console/include/functions_api.php | 275 ---------------------- 2 files changed, 3 insertions(+), 277 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index e2c5c742a3..5ee67a4638 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1369,10 +1369,11 @@ function is_metaconsole() { * * @return bool */ -function is_management_allowed() { +function is_management_allowed($hkey = '') { global $config; return ( (is_metaconsole() && $config["centralized_management"]) - || (!is_metaconsole() && !$config["centralized_management"])); + || (!is_metaconsole() && !$config["centralized_management"]) + || (!is_metaconsole() && $config["centralized_management"]) && $hkey == hash('sha256', db_get_value ('value', 'tupdate_settings', 'token', 'customer_key'))); } /** diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 189cc4203b..76968e1e75 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -30,7 +30,6 @@ include_once($config['homedir'] . "/include/functions_network_components.php"); include_once($config['homedir'] . "/include/functions_netflow.php"); include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_planned_downtimes.php"); -include_once($config['homedir'] . "/include/functions_db.php"); enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); @@ -11398,282 +11397,8 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access = return false; } -function api_get_user_info($thrash1, $thrash2, $other, $returnType) { - if (defined ('METACONSOLE')) { - return; - } - - $separator = ';'; - - $other = json_decode(base64_decode($other['data']),true); - - $sql = 'select * from tusuario where id_user = "'.$other[0]['id_user'].'" and password = "'.$other[0]['password'].'"'; - - $user_info = db_get_all_rows_sql($sql); - - if (count($user_info) > 0 and $user_info !== false) { - $data = array('type' => 'array', 'data' => $user_info); - returnData($returnType, $data, $separator); - } - else { - return 0; - } -} -/* - -This function receives different parameters to process one of these actions the logging process in our application from the records in the audit of pandora fms, to avoid concurrent access of administrator users, and optionally to prohibit access to non-administrator users: - -Parameter 0 - -The User ID that attempts the action is used to check the status of the application for access. - -Parameter 1 - -Login, logout, exclude, browse. - -These requests receive a response that we can treat as we consider, this function only sends answers, does not perform any action in your application, you must customize them. - -Login action: free (register our access), taken, denied (if you are not an administrator user and parameter four is set to 1, register the expulsion). - -Browse action: It has the same answers as login, but does not register anything in the audit. - -Logout action: It records the deslogeo but does not send a response. - -All other actions do not return a response, - -Parameter 2 - -IP address of the application is also used to check the status of the application for access. - -Parameter 3 - -Name of the application, it is also used to check the status of the application for access. - -Parameter 4 - -If you mark 1 you will avoid the access to the non-administrators users, returning the response `denied' and registering that expulsion in the audit of pandora fms. - -*/ - - - -function api_set_access_process($thrash1, $thrash2, $other, $returnType) { - if (defined ('METACONSOLE')) { - return; - } - - $other['data'] = explode('|',$other['data']); - - $sql = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario != "'.$other['data'][0].'" order by utimestamp DESC limit 1'; - $audit_concurrence = db_get_all_rows_sql($sql); - $sql_user = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario = "'.$other['data'][0].'" order by utimestamp DESC limit 1'; - $audit_concurrence_user = db_get_all_rows_sql($sql_user); - $sql2 = 'select id_usuario,utimestamp,accion from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logoff%" and id_usuario = "'.$audit_concurrence[0]['id_usuario'].'" order by utimestamp DESC limit 1'; - $audit_concurrence_2 = db_get_all_rows_sql($sql2); - - //The user trying to log in is an administrator - if(users_is_admin($other['data'][0])){ - //The admin user is trying to login - if($other['data'][1] == 'login'){ - // Check if there is an administrator user logged in prior to our last login - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ - // Check if the administrator user logged in later to us has unlogged and left the node free - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ - // The administrator user logged in later has not yet unlogged - returnData('string', array('type' => 'string', 'data' => 'taken')); - } - else{ - // The administrator user logged in later has already unlogged - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - else{ - // There is no administrator user who has logged in since then to log us in. - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'free')); - } - - } - elseif ($other['data'][1] == 'logout') { - // The administrator user wants to log out - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); - } - elseif ($other['data'][1] == 'exclude') { - // The administrator user has ejected another administrator user who was logged in - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2] , $audit_concurrence[0]['id_usuario']); - - } - //The admin user is trying to browse - elseif ($other['data'][1] == 'browse') { - // Check if there is an administrator user logged in prior to our last login - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){ - // Check if the administrator user logged in later to us has unlogged and left the node free - if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){ - // The administrator user logged in later has not yet unlogged - returnData('string', array('type' => 'string', 'data' => $audit_concurrence[0]['id_usuario'])); - } - else{ - // The administrator user logged in later has already unlogged - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - else{ - // There is no administrator user who has logged in since then to log us in. - returnData('string', array('type' => 'string', 'data' => 'free')); - } - - } - elseif ($other['data'][1] == 'cancelled'){ - //The administrator user tries to log in having another administrator logged in, but instead of expelling him he cancels his log in. - db_pandora_audit($other['data'][3].' cancelled access', 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'cancelled')); - } - -} -else{ - - if($other['data'][4] == 1){ - //The user trying to log in is not an administrator and is not allowed no admin access - db_pandora_audit($other['data'][3].' denied access', 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'denied')); - } - else{ - //The user trying to log in is not an administrator and is allowed no admin access - if($other['data'][1] == 'login'){ - //The user trying to login is not admin, can enter without concurrent use filter - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]); - returnData('string', array('type' => 'string', 'data' => 'free')); - - } - elseif ($other['data'][1] == 'logout') { - //The user trying to logoff is not admin - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); - } - elseif ($other['data'][1] == 'browse'){ - //The user trying to browse in an app page is not admin, can enter without concurrent use filter - returnData('string', array('type' => 'string', 'data' => 'free')); - } - } - } -} - - -function api_get_traps($thrash1, $thrash2, $other, $returnType) { - - if (defined ('METACONSOLE')) { - return; - } - - $other['data'] = explode('|',$other['data']); - - $other['data'][1] = date("Y-m-d H:i:s",$other['data'][1]); - - $sql = 'SELECT * from ttrap where timestamp >= "'.$other['data'][1].'"'; - - // $sql = 'SELECT * from ttrap where source = "'.$other['data'][0].'" and timestamp >= "'.$other['data'][1].'"'; - - if($other['data'][4]){ - $other['data'][4] = date("Y-m-d H:i:s",$other['data'][4]); - $sql .= ' and timestamp <= "'.$other['data'][4].'"'; - } - - if($other['data'][2]){ - $sql .= ' limit '.$other['data'][2]; - } - - if($other['data'][3]){ - $sql .= ' offset '.$other['data'][3]; - } - - if($other['data'][5]){ - $sql .= ' and status = 0'; - } - - if(sizeof($other['data']) == 0){ - $sql = 'SELECT * from ttrap'; - } - - - $traps = db_get_all_rows_sql($sql); - - if($other['data'][6]){ - - foreach ($traps as $key => $value) { - - if(!strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'false'){ - unset($traps[$key]); - } - - if(strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'true'){ - unset($traps[$key]); - } - - } - - } - - $traps_json = json_encode($traps); - - if (count($traps) > 0 and $traps !== false) { - returnData('string', array('type' => 'string', 'data' => $traps_json)); - } - else { - return 0; - } - -} - -function api_set_validate_traps ($id, $thrash2, $other, $thrash3) { - - if (defined ('METACONSOLE')) { - return; - } - - if($id == 'all'){ - $result = db_process_sql_update('ttrap',array('status' => 1)); - } - else{ - $result = db_process_sql_update('ttrap', - array('status' => 1), array('id_trap' => $id)); - } - - if (is_error($result)) { - // TODO: Improve the error returning more info - returnError('error_update_trap', __('Error in trap update.')); - } - else { - returnData('string', - array('type' => 'string', - 'data' => __('Validated traps.'))); - } - } - - function api_set_delete_traps ($id, $thrash2, $other, $thrash3) { - - if (defined ('METACONSOLE')) { - return; - } - - if($id == 'all'){ - $result = db_process_sql ('delete from ttrap'); - } - else{ - $result = db_process_sql_delete('ttrap',array('id_trap' => $id)); - } - - if (is_error($result)) { - // TODO: Improve the error returning more info - returnError('error_delete_trap', __('Error in trap delete.')); - } - else { - returnData('string', - array('type' => 'string', - 'data' => __('Deleted traps.'))); - } - } ?> From e22d9e6d9bddda34b1ed4a9160c7862df3a73ead Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Tue, 18 Sep 2018 14:31:01 +0200 Subject: [PATCH 16/66] Fixed bug in custom macros help --- .../include/help/en/help_module_macros.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/help/en/help_module_macros.php b/pandora_console/include/help/en/help_module_macros.php index 855da023e3..705b6f92e9 100644 --- a/pandora_console/include/help/en/help_module_macros.php +++ b/pandora_console/include/help/en/help_module_macros.php @@ -30,43 +30,43 @@ This macros can be used in module alerts. </p> -<h2>Si el módulo es de tipo analisis de módulo web:</h2> +<h2>IF THE MODULE IS A WEB MODULE ANALYSIS TYPE: </h2> <p> - Las macros dinámicas tendrán un formato especial que empieza por @ y tendrán estas posibles sustituciones: +Dynamic macros will have a special format starting with @ and will have these possible substitutions: </p> <ol> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT (fecha/hora actual con formato definido por el usuario) + @DATE_FORMAT (current date/time with user-defined format) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_nh (horas) + @DATE_FORMAT_nh (hours) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_nm (minutos) + @DATE_FORMAT_nm (minutes) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_nd (días) + @DATE_FORMAT_nd (days) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_ns (segundos) + @DATE_FORMAT_ns (seconds) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_nM (mes) + @DATE_FORMAT_nM (month) </li> <li style="font-family: 'lato-bolder'; font-size: 12pt;"> - @DATE_FORMAT_nY (años) + @DATE_FORMAT_nY (years) </li> </ol> <p> - Donde “n” puede ser un numero sin signo (positivo) o negativo. +Where "n" can be a number without a sign (positive) or negative. </p> <p> - Y FORMAT sigue el standard de strftime de perl: +And FORMAT follows the standard of perl's strftime: http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm </p> <p> - Ejemplos: + Examples: </p> <pre> @DATE_%Y-%m-%d %H:%M:%S From 3f046441f06afe590788d0693f6670ef70dfed58 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Wed, 19 Sep 2018 10:06:57 +0200 Subject: [PATCH 17/66] Changed custom graph item insertion and deletion to fix bug when sorting elements in list --- pandora_console/godmode/reporting/graph_builder.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 564c179f67..957720f59c 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -195,7 +195,8 @@ if ($add_module) { "')"); if (count($id_agent_modules) > 0 && $id_agent_modules != '') { - $order = db_get_row_sql("SELECT `field_order` from tgraph_source ORDER BY `field_order` DESC"); + $order = db_get_row_sql("SELECT `field_order` from tgraph_source WHERE id_graph=$id_graph ORDER BY `field_order` DESC"); + $order = $order['field_order']; foreach($id_agent_modules as $id_agent_module){ $order++; @@ -207,8 +208,13 @@ if ($add_module) { } if ($delete_module) { + $id_graph = get_parameter('id'); + $deleteGraph = get_parameter('delete'); + $order_val = db_get_value('field_order', 'tgraph_source', 'id_gs', $deleteGraph); $result = db_process_sql_delete('tgraph_source', array('id_gs' => $deleteGraph)); + db_process_sql ('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val); + } if ($change_weight) { From e0e098a7a649eaca71bce55b6a377be2b603fb71 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Wed, 19 Sep 2018 16:51:31 +0200 Subject: [PATCH 18/66] Added module name and agent name in actions enable and disable module - #2783 --- .../godmode/agentes/configurar_agente.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index b0999eb638..4fee505d10 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1760,13 +1760,15 @@ if (!empty($duplicate_module)) { // DUPLICATE agent module ! // ===================== if ($enable_module) { $result = modules_change_disabled($enable_module, 0); - + $modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$enable_module.""); + $modulo_nombre = $modulo_nombre['nombre']; + if ($result === NOERR) { enterprise_hook('config_agents_enable_module_conf', array($id_agente, $enable_module)); - db_pandora_audit("Module management", 'Enable ' . $enable_module); + db_pandora_audit("Module management", 'Enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } else { - db_pandora_audit("Module management", 'Fail to enable ' . $enable_module); + db_pandora_audit("Module management", 'Fail to enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } ui_print_result_message ($result, @@ -1775,13 +1777,15 @@ if ($enable_module) { if ($disable_module) { $result = modules_change_disabled($disable_module, 1); - + $modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$disable_module.""); + $modulo_nombre = $modulo_nombre['nombre']; + if ($result === NOERR) { enterprise_hook('config_agents_disable_module_conf', array($id_agente, $disable_module)); - db_pandora_audit("Module management", 'Disable ' . $disable_module); + db_pandora_audit("Module management", 'Disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } else { - db_pandora_audit("Module management", 'Fail to disable ' . $disable_module); + db_pandora_audit("Module management", 'Fail to disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]); } ui_print_result_message ($result, From 00badd671a517394afd5e289046a2b05e0908f2b Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Wed, 19 Sep 2018 18:39:19 +0200 Subject: [PATCH 19/66] Removed .empty from tarball and rpm --- pandora_agents/unix/collections/.empty | 1 - pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 4 ++-- pandora_agents/win32/bin/collections/.empty | 0 5 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 pandora_agents/unix/collections/.empty delete mode 100644 pandora_agents/win32/bin/collections/.empty diff --git a/pandora_agents/unix/collections/.empty b/pandora_agents/unix/collections/.empty deleted file mode 100644 index 8d1c8b69c3..0000000000 --- a/pandora_agents/unix/collections/.empty +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 57317deecf..a8348b9632 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -95,7 +95,7 @@ if [ ! -e /etc/pandora/plugins ]; then fi if [ ! -e /etc/pandora/collections ]; then - ln -s /usr/share/pandora_agent/collections /etc/pandora + mkdir -p /etc/pandora/collections fi mkdir -p /var/spool/pandora/data_out diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 04574d3e25..f2a5d5757d 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -88,7 +88,7 @@ if [ ! -e /etc/pandora/plugins ]; then fi if [ ! -e /etc/pandora/collections ]; then - ln -s /usr/share/pandora_agent/collections /etc/pandora + mkdir /etc/pandora/collections fi cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 5cb84bc1fb..504eaecbf8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -388,8 +388,8 @@ install () { ln -s $PANDORA_BASE_REAL$PANDORA_HOME/plugins $PANDORA_BASE$PANDORA_CFG - echo "Copying Pandora FMS Agent collections to $PANDORA_BASE$PANDORA_HOME/collections..." - cp -r collections $PANDORA_BASE$PANDORA_HOME + echo "Creating the collections directory in to $PANDORA_BASE$PANDORA_HOME/collections..." + mkdir -p $PANDORA_BASE$PANDORA_HOME/collections chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections ln -s $PANDORA_BASE_REAL$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG diff --git a/pandora_agents/win32/bin/collections/.empty b/pandora_agents/win32/bin/collections/.empty deleted file mode 100644 index e69de29bb2..0000000000 From bc38468e6cb3fbf38fb4ccead858018c82b3a489 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Thu, 20 Sep 2018 11:50:47 +0200 Subject: [PATCH 20/66] Fixed borders of tables with classes databox and data - #2768 --- pandora_console/include/styles/pandora.css | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8cdfa3a9e7..b580b90cfc 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1393,6 +1393,37 @@ table.databox { color: #222 !important; } +.databox.data>tbody>tr>td:first-child{ + border-left: 1px solid #e2e2e2; +} + +.databox.data>tbody>tr:last-child>td:first-child{ + border-bottom-left-radius: 4px; +} + +.databox.data>tbody>tr>td:last-child { + border-right: 1px solid #e2e2e2; +} + +.databox.data>tbody>tr:last-child >td:last-child { + border-bottom-right-radius: 4px; +} + +.databox.data>thead>tr>th:first-child { + border-left: 1px solid #e2e2e2; + border-top-left-radius: 4px; + border-color: #373737; +} + +.databox.data>thead>tr>th:last-child { + border-right: 1px solid #e2e2e2; + border-top-right-radius: 4px; + border-color: #373737; +} +.databox.data{ + border: none; +} + .tabletitle { color: #333; } From e49c0e3ae74bf169c99a6eaef5354f5eb92409f4 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Thu, 20 Sep 2018 12:18:31 +0200 Subject: [PATCH 21/66] Fixed a minor mistake in thead - #2768 --- pandora_console/include/styles/pandora.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b580b90cfc..1a1c9b513f 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1409,13 +1409,13 @@ table.databox { border-bottom-right-radius: 4px; } -.databox.data>thead>tr>th:first-child { +.databox.data>thead>tr:first-child>th:first-child { border-left: 1px solid #e2e2e2; border-top-left-radius: 4px; border-color: #373737; } -.databox.data>thead>tr>th:last-child { +.databox.data>thead>tr:first-child>th:last-child { border-right: 1px solid #e2e2e2; border-top-right-radius: 4px; border-color: #373737; From b66f3a9f6f9b7189ce91df6821f392dec31bf19d Mon Sep 17 00:00:00 2001 From: samucarc <samuel.carcases> Date: Thu, 20 Sep 2018 19:18:45 +0200 Subject: [PATCH 22/66] Fixed SQL graphs in reports --- pandora_console/include/chart_generator.php | 52 ++++++++++ pandora_console/include/functions_graph.php | 13 ++- pandora_console/include/graphs/fgraph.php | 102 ++++++++------------ 3 files changed, 100 insertions(+), 67 deletions(-) diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index f23107f39c..beeec9ed5c 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -126,6 +126,58 @@ if (file_exists ('languages/'.$user_language.'.mo')) { echo grafico_modulo_sparse($params); echo '</div>'; } + elseif($type_graph_pdf == 'hbar'){ + echo '<div>'; + echo hbar_graph( + $params['flash_chart'], + $params['chart_data'], + $params['width'], + $params['height'], + $params['color'], + $params['legend'], + $params['long_index'], + $params['no_data_image'], + $params['xaxisname'], + $params['yaxisname'], + $params['water_mark'], + $params['font'], + $params['font_size'], + $params['unit'], + $params['ttl'], + $params['homeurl'], + $params['backgroundColor'], + $params['tick_color'], + $params['val_min'], + $params['val_max'] + ); + echo '</div>'; + } + elseif($type_graph_pdf == 'vbar'){ + echo '<div>'; + echo vbar_graph( + $params['flash_chart'], + $params['chart_data'], + $params['width'], + $params['height'], + $params['color'], + $params['legend'], + $params['long_index'], + $params['no_data_image'], + $params['xaxisname'], + $params['yaxisname'], + $params['water_mark'], + $params['font'], + $params['font_size'], + $params['unit'], + $params['ttl'], + $params['homeurl'], + $params['backgroundColor'], + $params['from_ux'], + $params['from_wux'], + $params['tick_color'] + ); + echo '</div>'; + } $config['font_size'] = $aux_font_size; ?> diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index e8fa13df9f..a88b6bd535 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3726,10 +3726,9 @@ function graph_custom_sql_graph ($id, $width, $height, } } } - - $flash_charts = $config['flash_charts']; - - if ($only_image) { + + $flash_charts = true; + if ($ttl == 2) { $flash_charts = false; } @@ -3759,9 +3758,9 @@ function graph_custom_sql_graph ($id, $width, $height, $ttl, $homeurl, "white", + true, false, - false, - "c1c1c1" + "#c1c1c1" ); break; case 'sql_graph_hbar': // horizontal bar @@ -3783,7 +3782,7 @@ function graph_custom_sql_graph ($id, $width, $height, $ttl, $homeurl, 'white', - 'c1c1c1' + '#c1c1c1' ); break; case 'sql_graph_pie': // Pie diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index eb638f2c2a..be9a2bce23 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -187,35 +187,27 @@ function vbar_graph( $tick_color); } else { - $new_chart_data = array(); - foreach ($chart_data as $key => $value) { - if(strlen($key) > 20 && strpos($key, ' - ') !== false){ - $key_temp = explode(" - ",$key); - $key_temp[0] = $key_temp[0]." \n"; - $key_temp[1]= '...'.substr($key_temp[1],-15); - $key2 = $key_temp[0].$key_temp[1]; - io_safe_output($key2); - $new_chart_data[$key2]['g'] = $chart_data[$key]['g']; - } else { - $new_chart_data[$key] = $value; - } - } - - $graph = array(); - $graph['data'] = $new_chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=vbar&ttl=".$ttl."&id_graph=".$id_graph."'>"; + $params['flash_chart'] = true; + $params['chart_data'] = $chart_data; + $params['width'] = $width; + $params['height'] = $height; + $params['color'] = $color; + $params['legend'] = $legend; + $params['long_index'] = $long_index; + $params['no_data_image'] = $no_data_image; + $params['xaxisname'] = $xaxisname; + $params['yaxisname'] = $yaxisname; + $params['water_mark'] = $water_mark; + $params['font'] = $font; + $params['font_size'] = $font_size; + $params['unit'] = $unit; + $params['ttl'] = 2; + $params['homeurl'] = $homeurl; + $params['backgroundColor'] = $backgroundColor; + $params['from_ux'] = $from_ux; + $params['from_wux'] = $from_wux; + $params['tick_color'] = $tick_color; + return generator_chart_to_pdf('vbar', $params); } } @@ -312,37 +304,27 @@ function hbar_graph($flash_chart, $chart_data, $width, $height, $chart_data, $width, $height, $water_mark_url, $font, $font_size, $backgroundColor, $tick_color, $val_min, $val_max); } else { - foreach ($chart_data as $key => $value) { - $str_key = io_safe_output($key); - if(strlen($str_key) > 40){ - if(strpos($str_key, ' - ') != -1){ - $key_temp = explode(" - ",$str_key); - $key_temp[0] = $key_temp[0]." <br>"; - $key_temp[1]= '...'.substr($key_temp[1],-20); - $key2 = $key_temp[0].$key_temp[1]; - } - $chart_data[$key2]['g'] = $chart_data[$key]['g']; - unset($chart_data[$key]); - } - } - - $graph = array(); - $graph['data'] = $chart_data; - $graph['width'] = $width; - $graph['height'] = $height; - $graph['color'] = $color; - $graph['legend'] = $legend; - $graph['xaxisname'] = $xaxisname; - $graph['yaxisname'] = $yaxisname; - $graph['force_height'] = $force_height; - $graph['water_mark'] = $water_mark_file; - $graph['font'] = $font; - $graph['font_size'] = $font_size; - $graph['force_steps'] = $force_steps; - - $id_graph = serialize_in_temp($graph, null, $ttl); - - return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=hbar&ttl=".$ttl."&id_graph=".$id_graph."'>"; + $params['flash_chart'] = true; + $params['chart_data'] = $chart_data; + $params['width'] = $width; + $params['height'] = $height; + $params['color'] = $color; + $params['legend'] = $legend; + $params['long_index'] = $long_index; + $params['no_data_image'] = $no_data_image; + $params['xaxisname'] = $xaxisname; + $params['yaxisname'] = $yaxisname; + $params['water_mark'] = $water_mark; + $params['font'] = $font; + $params['font_size'] = $font_size; + $params['unit'] = $unit; + $params['ttl'] = 2; + $params['homeurl'] = $homeurl; + $params['backgroundColor'] = $backgroundColor; + $params['tick_color'] = $tick_color; + $params['val_min'] = $val_min; + $params['val_max'] = $val_max; + return generator_chart_to_pdf('hbar', $params); } } From 51af767549b9d8c202cec42fcaa2d434d5953b9c Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Fri, 21 Sep 2018 09:21:21 +0200 Subject: [PATCH 23/66] Limited number of characters shown in the table - #2783 --- pandora_console/general/logon_ok.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index c2ecec56da..1c720b6373 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -274,7 +274,12 @@ if (!empty($all_data)) { . human_time_comparation($session['utimestamp'], 'tiny'); $data[3] = $session_ip_origen; $description = str_replace(array(',', ', '), ', ', $session['descripcion']); - $data[4] = '<div >' . io_safe_output($description) . '</div>'; + if(strlen($description)>100){ + $data[4] = '<div >' . io_safe_output(substr($description, 0, 150).'...') . '</div>'; + } + else{ + $data[4] = '<div >' . io_safe_output($description) . '</div>'; + } array_push ($table->data, $data); } From a5a92519aa52f29559fb689506f5d4bbbcfa4b76 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Fri, 21 Sep 2018 10:07:01 +0200 Subject: [PATCH 24/66] Fixed bug: bad link in meta tree view's agent data, using relative path --- pandora_console/include/functions_treeview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 20d1f577bc..81701e02e2 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -522,7 +522,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals $hashdata = $user.$pwd_deserialiced['auth_token']; $hashdata = md5($hashdata); - $url = $server_data["server_url"] . "/index.php?" . + $url = "//" . $server_data["server_url"] . "index.php?" . "sec=estado&" . "sec2=operation/agentes/ver_agente&" . "id_agente=" . $agent["id_agente"] . "&" . From 1f801d5a3a83cc2b7653866ddb6a6e307f7d3d51 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Fri, 21 Sep 2018 10:14:21 +0200 Subject: [PATCH 25/66] fixed bug: bad link in meta tree view's agent data, go to agent edition button using relative path --- pandora_console/include/functions_treeview.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 81701e02e2..e9b64c15f5 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -522,7 +522,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals $hashdata = $user.$pwd_deserialiced['auth_token']; $hashdata = md5($hashdata); - $url = "//" . $server_data["server_url"] . "index.php?" . + $url = "//" . $server_data["server_url"] . "/index.php?" . "sec=estado&" . "sec2=operation/agentes/ver_agente&" . "id_agente=" . $agent["id_agente"] . "&" . @@ -608,7 +608,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals $go_to_agent = '<div style="text-align: right;">'; if($agent["id_os"] != 100){ - $go_to_agent .= '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">'; + $go_to_agent .= '<a target=_blank href="' . "//" . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">'; $go_to_agent .= html_print_submit_button (__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true); } else{ From 028cca0d66b4d519d3b614516fd87175b0b7ca64 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Fri, 21 Sep 2018 12:59:15 +0200 Subject: [PATCH 26/66] Changed colors for buttons - #2726 --- pandora_console/include/functions_visual_map_editor.php | 6 +++--- pandora_console/include/styles/pandora.css | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index a20a8c5e42..f3047ce561 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -478,20 +478,20 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['background_row_2']['items'] = array('background', 'datos'); $form_items['background_row_2']['html'] = '<td align="left">' . __('Original Size') . '</td> - <td align="left">' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub"', true) . '</td>'; + <td align="left">' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub vs_button_ghost"', true) . '</td>'; $form_items['background_row_3'] = array(); $form_items['background_row_3']['items'] = array('background', 'datos'); $form_items['background_row_3']['html'] = '<td align="left">' . __('Aspect ratio') . '</td> - <td align="left">' . html_print_button(__('Width proportional'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub"', true) . '</td>'; + <td align="left">' . html_print_button(__('Proportional Width'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub vs_button_ghost"', true) . '</td>'; $form_items['background_row_4'] = array(); $form_items['background_row_4']['items'] = array('background', 'datos'); $form_items['background_row_4']['html'] = '<td align="left"></td> - <td align="left">' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub"', true) . '</td>'; + <td align="left">' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub vs_button_ghost"', true) . '</td>'; $form_items['percentile_bar_row_1'] = array(); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 8cdfa3a9e7..eb7567393e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -653,6 +653,15 @@ input.sub[disabled] { cursor: default; } +input.vs_button_ghost{ + background-color: transparent !important; + border: 1px solid #82b92e; + color: #82b92e !important; + text-align: center; + padding: 4px 12px; + font-weight: bold; +} + input.next, input.upd, input.ok, input.wand, input.delete, input.cog, input.target, input.search, input.copy, input.add, input.graph, input.percentile, input.binary, input.camera, input.config, From e59c40d687dcd48b28d9951c135468c051ad2b78 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Mon, 24 Sep 2018 14:01:17 +0200 Subject: [PATCH 27/66] Fixed bug in events replication --- pandora_console/include/functions_events.php | 9 +- pandora_console/install.php | 983 ------------------- 2 files changed, 5 insertions(+), 987 deletions(-) delete mode 100755 pandora_console/install.php diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index f6b6da21cc..c6b5a78eee 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2706,13 +2706,14 @@ function events_page_comments ($event, $childrens_ids = array()) { } break; } - - if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) { - $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%;"', true); + + if (((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) && $config["show_events_in_local"] == false || $config["event_replication"] == false) { + $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); + $comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'),'comment_button',false,'event_comment();','class="sub next"',true).'</div><br></div>'; } else { - $comments_form = ''; + $comments_form = ui_print_message(__( 'If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')); } $comments = '<div id="extended_event_comments_page" class="extended_event_pages">'.$comments_form.html_print_table($table_comments, true).'</div>'; diff --git a/pandora_console/install.php b/pandora_console/install.php deleted file mode 100755 index d9160ee127..0000000000 --- a/pandora_console/install.php +++ /dev/null @@ -1,983 +0,0 @@ -<?php - -// Pandora FMS - http://pandorafms.com -// ================================================== -// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas -// Please see http://pandorafms.org for full contribution list - -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License -// as published by the Free Software Foundation; version 2 - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> - <head> - <title>Pandora FMS - Installation Wizard</title> - <meta http-equiv="expires" content="0"> - <meta http-equiv="content-type" content="text/html; charset=utf-8"> - <meta name="resource-type" content="document"> - <meta name="distribution" content="global"> - <meta name="author" content="Pandora FMS Development Team"> - <meta name="copyright" content="This is GPL software. Created by Sancho Lerena and many others"> - <meta name="keywords" content="pandora, fms, monitoring, network, system, GPL, software"> - <meta name="robots" content="index, follow"> - <link rel="icon" href="images/pandora.ico" type="image/ico"> - <link rel="stylesheet" href="include/styles/install.css" type="text/css"> - </head> - <script type="text/javascript"> - options_text = new Array('An existing Database','A new Database'); - options_values = new Array('db_exist','db_new'); - function ChangeDBDrop(causer) { - if (causer.value != 'db_exist') { - window.document.step2_form.drop.checked = 0; - window.document.step2_form.drop.disabled = 1; - } - else { - window.document.step2_form.drop.disabled = 0; - } - } - function ChangeDBAction(causer) { - var i = 0; - if (causer.value == 'oracle') { - window.document.step2_form.db_action.length = 1; - } - else { - window.document.step2_form.db_action.length = 2; - } - while (i < window.document.step2_form.db_action.length) { - window.document.step2_form.db_action.options[i].value = options_values[i]; - window.document.step2_form.db_action.options[i].text = options_text[i]; - i++; - } - window.document.step2_form.db_action.options[window.document.step2_form.db_action.length-1].selected=1; - ChangeDBDrop(window.document.step2_form.db_action); - } - function CheckDBhost(value){ - if (( value != "localhost") && ( value != "127.0.0.1")) { - document.getElementById('tr_dbgrant').style["display"] = "block"; - } - else { - document.getElementById('tr_dbgrant').style["display"] = "none"; - } - } - </script> - <body> - <div style='height: 10px'> - <?php -$version = '7.0NG.727'; -$build = '180924'; - $banner = "v$version Build $build"; - - error_reporting(0); - - // --------------- - // Main page code - // --------------- - - if (! isset($_GET["step"])) { - install_step1(); - } - else { - $step = $_GET["step"]; - switch ($step) { - case 11: install_step1_licence(); - break; - case 2: install_step2(); - break; - case 3: install_step3(); - break; - case 4: install_step4(); - break; - case 5: install_step5(); - break; - } - } - ?> - </div> - </body> -</html> - -<?php -function check_extension ( $ext, $label ) { - echo "<tr><td>"; - echo "<span class='arr'> $label </span>"; - echo "</td><td>"; - if (!extension_loaded($ext)) { - echo "<img src='images/dot_red.png'>"; - return 1; - } - else { - echo "<img src='images/dot_green.png'>"; - return 0; - } - echo "</td></tr>"; -} - -function check_include ( $ext, $label ) { - echo "<tr><td>"; - echo "<span class='arr'> $label </span>"; - echo "</td><td>"; - if (!include($ext)) { - echo "<img src='images/dot_red.png'>"; - return 1; - } - else { - echo "<img src='images/dot_green.png'>"; - return 0; - } - echo "</td></tr>"; -} - -function check_exists ( $file, $label ) { - echo "<tr><td>"; - echo "<span class='arr'> $label </span>"; - echo "</td><td>"; - if (!file_exists ($file)) { - echo " <img src='images/dot_red.png'>"; - return 1; - } - else { - echo " <img src='images/dot_green.png'>"; - return 0; - } - echo "</td></tr>"; -} - -function check_generic ( $ok, $label ) { - echo "<tr><td style='width:10%'>"; - if ($ok == 0 ) { - echo " <img src='images/dot_red.png'>"; - echo "<td>"; - echo "<span class='arr'> $label </span>"; - echo "</td>"; - echo "</td></tr>"; - return 1; - } - else { - echo " <img src='images/dot_green.png'>"; - echo "<td>"; - echo "<span class='arr'> $label </span>"; - echo "</td>"; - echo "</td></tr>"; - return 0; - } -} - -function check_writable ( $fullpath, $label ) { - echo "<tr><td style='width:10%;'>"; - if (file_exists($fullpath)) - if (is_writable($fullpath)) { - echo " <img style='margin-left:50px;' src='images/dot_green.png'>"; - echo "<td>"; - echo "<span class='arr'> $label </span>"; - echo "</td>"; - echo "</td></tr>"; - return 0; - } - else { - echo " <img style='margin-left:50px;' src='images/dot_red.png'>"; - echo "<td>"; - echo "<span class='arr'> $label </span>"; - echo "</td>"; - echo "</td></tr>"; - return 1; - } - else { - echo " <img style='margin-left:50px;' src='images/dot_red.png'>"; - echo "<td>"; - echo "<span class='arr'> $label </span>"; - echo "</td>"; - echo "</td></tr>"; - return 1; - } -} - -function check_variable ( $var, $value, $label, $mode ) { - echo "<tr><td>"; - echo "<span class='arr'> $label </span>"; - echo "</td><td>"; - if ($mode == 1) { - if ($var >= $value) { - echo " <img src='images/dot_green.png'>"; - return 0; - } - else { - echo " <img src='images/dot_red.png'>"; - return 1; - } - } - elseif ($var == $value) { - echo " <img src='images/dot_green.png'>"; - return 0; - } - else { - echo " <img src='images/dot_red.png'>"; - return 1; - } - echo "</td></tr>"; -} - -function parse_mysql_dump($url) { - if (file_exists($url)) { - $file_content = file($url); - $query = ""; - foreach($file_content as $sql_line) { - if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) { - $query .= $sql_line; - if(preg_match("/;[\040]*\$/", $sql_line)) { - if (!$result = mysql_query($query)) { - echo mysql_error(); //Uncomment for debug - echo "<i><br>$query<br></i>"; - return 0; - } - $query = ""; - } - } - } - return 1; - } - else - return 0; -} - -function parse_mysqli_dump($connection, $url) { - if (file_exists($url)) { - $file_content = file($url); - $query = ""; - foreach($file_content as $sql_line) { - if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) { - $query .= $sql_line; - if(preg_match("/;[\040]*\$/", $sql_line)) { - if (!$result = mysqli_query($connection, $query)) { - echo mysqli_error(); //Uncomment for debug - echo "<i><br>$query<br></i>"; - return 0; - } - $query = ""; - } - } - } - return 1; - } - else - return 0; -} - -function random_name ($size) { - $temp = ""; - for ($a=0;$a< $size;$a++) - $temp = $temp. chr(rand(122,97)); - - return $temp; -} - -function print_logo_status ($step, $step_total) { - global $banner; - - $header = " - <div id='logo_img' style='width: 100%;'> - <div style='width:100%; background-color:#333333;'> - <img src='images/logo_opensource.png' border='0'><br> - <span style='font-size: 9px;'>$banner</span> - </div> - </div>"; - $header .= " - <div class='installation_step'> - <b>Install step $step of $step_total</b> - </div>"; - - return $header; -} - -// -// This function adjusts path settings in pandora db for FreeBSD. -// -// All packages and configuration files except operating system's base files -// are installed under /usr/local in FreeBSD. So, path settings in pandora db -// for some programs should be changed from the Linux default. -// -function adjust_paths_for_freebsd($engine, $connection = false) { - - $adjust_sql = array( - "update trecon_script set script = REPLACE(script,'/usr/share','/usr/local/share');", - "update tconfig set value = REPLACE(value,'/usr/bin','/usr/local/bin') where token='netflow_daemon' OR token='netflow_nfdump' OR token='netflow_nfexpire';", - "update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');", - "update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');", - "update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');", - "update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');", - "insert into tconfig (token, value) VALUES ('graphviz_bin_dir', '/usr/local/bin');" - ); - - for ($i = 0; $i < count ($adjust_sql); $i++) { - switch ($engine) { - case 'mysql': - $result = mysql_query($adjust_sql[$i]); - break; - case 'mysqli': - $result = mysqli_query($connection, $adjust_sql[$i]); - break; - case 'oracle': - //Delete the last semicolon from current query - $query = substr($adjust_sql[$i], 0, strlen($adjust_sql[$i]) - 1); - $sql = oci_parse($connection, $query); - $result = oci_execute($sql); - break; - case 'pgsql': - pg_send_query($connection, $adjust_sql[$i]); - $result = pg_get_result($connection); - break; - } - if (!$result) { - return 0; - } - } - - return 1; -} - -function install_step1() { - global $banner; - - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status (1,6) . " - <div id='install_box'> - <h2>Welcome to Pandora FMS installation Wizard</h2> - <p>This wizard helps you to quick install Pandora FMS console and main database in your system.</p> - <p>In four steps, this installer will check all dependencies and will create your configuration, ready to use.</p> - <p>For more information, please refer to documentation.<br> - <i>Pandora FMS Development Team</i></p> - "; - if (file_exists("include/config.php")) { - echo "<div class='warn'><b>Warning:</b> You already have a config.php file. - Configuration and database would be overwritten if you continued.</div>"; - } - echo "<br>"; - echo "<table width=100%>"; - $writable = check_writable ( "include", "Checking if ./include is writable"); - if (file_exists("include/config.php")) - $writable += check_writable ( "include/config.php", "Checking if include/config.php is writable"); - echo "</table>"; - - echo "<div class='warn'><b>Warning:</b> This installer will <b>overwrite and destroy</b> - your existing Pandora FMS configuration and <b>Database</b>. Before continue, - please <b>be sure that you have no valuable Pandora FMS data in your Database</b>.<br> - </div>"; - - echo "<div class='info'><b>Upgrade</b>: - If you want to upgrade from Pandora FMS 4.x to 5.0 version, please use the migration tool inside /extras directory in this setup. - </div>"; - - echo "<br>"; - - if ($writable == 0) { - echo "<div style='text-align:right; width:100%;'>"; - echo "<a id='step11' href='install.php?step=11'><button type='submit' class='btn_install_next'><span class='btn_install_next_text'>Next</span></button></a>"; - echo "</div>"; - } - else { - echo "<div class='err'><b>ERROR:</b>You need to setup permissions to be able to write in ./include directory</div>"; - } - echo "</div>"; - - echo "<div style='clear:both;'></div>"; - echo " - </div> - <div id='foot_install'> - <i>Pandora FMS is an OpenSource Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> - </div>"; -} - -function install_step1_licence() { - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status (2,6) . " - <div id='install_box'> - <h2>GPL2 Licence terms agreement</h2> - <p>Pandora FMS is an OpenSource software project licensed under the GPL2 licence. Pandora FMS includes, as well, another software also licensed under LGPL and BSD licenses. Before continue, <i>you must accept the licence terms.</i>. - <p>For more information, please refer to our website at http://pandorafms.org and contact us if you have any kind of question about the usage of Pandora FMS</p> -<p>If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.</p> - "; - - if (!file_exists("COPYING")) { - echo "<div class='warn'><b>Licence file 'COPYING' is not present in your distribution. This means you have some 'partial' Pandora FMS distribution. We cannot continue without accepting the licence file.</b>"; - echo "</div>"; - } - else { - echo "<form method=post action='install.php?step=2'>"; - echo "<textarea name='gpl2' cols=52 rows=15 style='width: 100%;'>"; - echo file_get_contents ("COPYING"); - echo "</textarea>"; - echo "<p>"; - echo "<div style='text-align: right;'><button id='btn_accept' class='btn_install_next' type='submit'><span class='btn_install_next_text'>Yes, I accept licence terms</span></button></div>"; - } - echo "</div>"; - - echo "</div> - <div style='clear: both;height: 1px;'><!-- --></div> - <div id='foot_install'> - <i>Pandora FMS is an OpenSource Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> - </div>"; -} - -function install_step2() { - - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status (3,6) . " - <div id='install_box'>"; - echo "<h2>Checking software dependencies</h2>"; - echo "<table border=0 width=230>"; - $res = 0; - $res += check_variable(phpversion(),"5.2","PHP version >= 5.2",1); - $res += check_extension("gd","PHP GD extension"); - $res += check_extension("ldap","PHP LDAP extension"); - $res += check_extension("snmp","PHP SNMP extension"); - $res += check_extension("session","PHP session extension"); - $res += check_extension("gettext","PHP gettext extension"); - $res += check_extension("mbstring","PHP Multibyte String"); - $res += check_extension("zip","PHP Zip"); - $res += check_extension("zlib","PHP Zlib extension"); - $res += check_extension("json","PHP json extension"); - $res += check_extension("curl","CURL (Client URL Library)"); - $res += check_extension("filter","PHP filter extension"); - $res += check_extension("calendar","PHP calendar extension"); - if (PHP_OS == "FreeBSD") { - $res += check_exists ("/usr/local/bin/twopi","Graphviz Binary"); - } - else if (PHP_OS == "NetBSD") { - $res += check_exists ("/usr/pkg/bin/twopi","Graphviz Binary"); - } - else if ( substr(PHP_OS, 0, 3) == 'WIN' ) { - $res += check_exists ("..\\..\\..\\Graphviz\\bin\\twopi.exe", "Graphviz Binary"); - } - else { - $res += check_exists ("/usr/bin/twopi","Graphviz Binary"); - } - - echo "<tr><td>"; - echo "<span style='display: block; font-family: verdana,arial,sans; - font-size: 8.5pt;margin-top: 2px; font-weight: bolder;'>DB Engines</span>"; - echo "</td><td>"; - echo "</td></tr>"; - check_extension("mysql", "PHP MySQL extension"); - check_extension("mysqli", "PHP MySQL(mysqli) extension"); - echo "</table>"; - - if ($res > 0) { - echo " - <div class='err'>You have some incomplete - dependencies. Please correct them or this installer - will not be able to finish your installation. - </div> - <div class='err'> - Remember, if you install any PHP module to comply - with these dependences, you <b>need to restart</b> - your HTTP/Apache server after it to use the new - modules. - </div> - <div style='text-align:right; width:100%;'> - Ignore it. <a id='step3' href='install.php?step=3' style='font-weight: bolder;'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Force install Step #3</span></button></a> - </div>"; - } - else { - echo "<div style='text-align:right; width:100%;'>"; - echo "<a id='step3' href='install.php?step=3'> - <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; - echo "</div>"; - } - echo "</div>"; - echo "<div style='clear: both;'><!-- --></div>"; - echo " - </div> - <div style='clear: both;'><!-- --></div> - </div> - <div id='foot_install'> - <i>Pandora FMS is an OpenSource Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> - </div>"; -} - - -function install_step3() { - $options = ''; - if (extension_loaded("mysql")) { - $options .= "<option value='mysql'>MySQL</option>"; - } - if (extension_loaded("mysqli")) { - $options .= "<option value='mysqli'>MySQL(mysqli)</option>"; - } - - $error = false; - if (empty($options)) { - $error = true; - } - - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status (4,6) . " - <div id='install_box'> - <h2>Environment and database setup</h2> - <p> - This wizard will create your Pandora FMS database, - and populate it with all the data needed to run for the first time. - </p> - <p> - You need a privileged user to create database schema, this is usually <b>root</b> user. - Information about <b>root</b> user will not be used or stored anymore. - </p> - <p> - You can also deploy the scheme into an existing Database. - In this case you need a privileged Database user and password of that instance. - </p> - <p> - Now, please, complete all details to configure your database and environment setup. - </p> - <div class='warn'> - <b>Warning:</b> This installer will <b>overwrite and destroy</b> your existing - Pandora FMS configuration and <b>Database</b>. Before continue, - please <b>be sure that you have no valuable Pandora FMS data in your Database.</b> - <br><br> - </div>"; - - if (extension_loaded("oci8")) { - echo " <div class='warn'>For Oracle installation an existing Database with a privileged user is needed.</div>"; - } - if (!$error) { - echo "<form method='post' name='step2_form' action='install.php?step=4'>"; - } - - echo "<table cellpadding=6 width=100% border=0 style='text-align: left;'>"; - echo "<tr><td>"; - echo "DB Engine<br>"; - - - if ($error) { - echo " - <div class='warn'> - <b>Warning:</b> You haven't a any DB engine with PHP. Please check the previous step to DB engine dependencies. - </div>"; - } - else { - echo "<select name='engine' onChange=\"ChangeDBAction(this)\">"; - echo $options; - echo "</select>"; - - echo "<td>"; - echo " Installation in <br>"; - echo "<select name='db_action' onChange=\"ChangeDBDrop(this)\">"; - echo "<option value='db_new'>A new Database</option>"; - echo "<option value='db_exist'>An existing Database</option>"; - echo "</select>"; - } - echo " <tr><td>DB User with privileges<br> - <input class='login' type='text' name='user' value='root' size=20> - - <td>DB Password for this user<br> - <input class='login' type='password' name='pass' value='' size=20> - - <tr><td>DB Hostname<br> - <input class='login' type='text' name='host' value='localhost' onkeyup='CheckDBhost(this.value);'size=20> - - <td>DB Name (pandora by default)<br> - <input class='login' type='text' name='dbname' value='pandora' size=20> - - <tr>"; - - // the field dbgrant is only shown when the DB host is different from 127.0.0.1 or localhost - echo "<tr id='tr_dbgrant' style='display:none;'> - <td colspan=\"2\">DB Host Access <img style='cursor:help;' src='/pandora_console/images/tip.png' title='Ignored if DB Hostname is localhost or 127.0.0.1'/><br> - <input class='login' type='text' name='dbgrant' value='" . $_SERVER['SERVER_ADDR'] . "' size=20> - </td> - </tr>"; - - - echo " <td valign=top>Drop Database if exists<br> - <input class='login' type='checkbox' name='drop' value=1> - </td>"; - - echo "<td>Full path to HTTP publication directory<br> - <span style='font-size: 9px'>For example /var/www/pandora_console/</span> - <br> - <input class='login' type='text' name='path' style='width: 240px;' - value='".dirname (__FILE__)."'> - - <tr>"; - if ($_SERVER['SERVER_ADDR'] == 'localhost' || $_SERVER['SERVER_ADDR'] == '127.0.0.1') { - echo "<td valign=top> - Drop Database if exists<br> - <input class='login' type='checkbox' name='drop' value=1> - "; - } else { - echo "<td>"; - } - echo "<td>URL path to Pandora FMS Console<br> - <span style='font-size: 9px'>For example '/pandora_console'</span> - </br> - <input class='login' type='text' name='url' style='width: 250px;' - value='".dirname ($_SERVER["SCRIPT_NAME"])."'> - </table> - "; - - if (!$error) { - echo "<div style='text-align:right; width:100%;'>"; - echo "<a id='step4' href='install.php?step=4'> - <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; - echo "</div>"; - } - - echo "</div>"; - - echo "</form>"; - - echo "<div style='clear:both;'></div>"; - echo "</div> - <div id='foot_install'> - <i>Pandora FMS is an OpenSource Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> - </div>"; -} - -function install_step4() { - $pandora_config = "include/config.php"; - - if ( (! isset($_POST["user"])) || (! isset($_POST["dbname"])) || (! isset($_POST["host"])) || - (! isset($_POST["pass"])) || (!isset($_POST['engine'])) || (! isset($_POST["db_action"])) ) { - $dbpassword = ""; - $dbuser = ""; - $dbhost = ""; - $dbname = ""; - $engine = ""; - $dbaction = ""; - $dbgrant = ""; - } - else { - $engine = $_POST['engine']; - $dbpassword = $_POST["pass"]; - $dbuser = $_POST["user"]; - $dbhost = $_POST["host"]; - $dbaction = $_POST["db_action"]; - if (isset($_POST["dbgrant"]) && $_POST["dbgrant"] != "") - $dbgrant = $_POST["dbgrant"]; - else - $dbgrant = $_SERVER["SERVER_ADDR"]; - if (isset($_POST["drop"])) - $dbdrop = $_POST["drop"]; - else - $dbdrop = 0; - - $dbname = $_POST["dbname"]; - if (isset($_POST["url"])) - $url = $_POST["url"]; - else - $url = "http://localhost"; - if (isset($_POST["path"])) { - $path = $_POST["path"]; - $path = str_replace("\\", "/", $path); // Windows compatibility - } - else - $path = "/var/www"; - } - $everything_ok = 0; - $step1=0; - $step2=0; - $step3=0; - $step4=0; $step5=0; $step6=0; $step7=0; - - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status(5,6) . " - <div id='install_box'> - <h2>Creating database and default configuration file</h2> - <table width='100%'>"; - switch ($engine) { - case 'mysql': - if (! mysql_connect ($dbhost, $dbuser, $dbpassword)) { - check_generic ( 0, "Connection with Database"); - } - else { - check_generic ( 1, "Connection with Database"); - - // Drop database if needed and don't want to install over an existing DB - if ($dbdrop == 1) { - mysql_query ("DROP DATABASE IF EXISTS `$dbname`"); - } - - // Create schema - if ($dbaction == 'db_new' || $dbdrop == 1) { - $step1 = mysql_query ("CREATE DATABASE `$dbname`"); - check_generic ($step1, "Creating database '$dbname'"); - } - else { - $step1 = 1; - } - if ($step1 == 1) { - $step2 = mysql_select_db($dbname); - check_generic ($step2, "Opening database '$dbname'"); - - $step3 = parse_mysql_dump("pandoradb.sql"); - check_generic ($step3, "Creating schema"); - - $step4 = parse_mysql_dump("pandoradb_data.sql"); - check_generic ($step4, "Populating database"); - if (PHP_OS == "FreeBSD") { - $step_freebsd = adjust_paths_for_freebsd ($engine); - check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD"); - } - - $random_password = random_name (8); - $host = $dbhost; // set default granted origin to the origin of the queries - if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) - $host = $dbgrant; // if the granted origin is different from local machine, set the valid origin - $step5 = mysql_query ("GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host - IDENTIFIED BY '".$random_password."'"); - mysql_query ("FLUSH PRIVILEGES"); - check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>"); - - $step6 = is_writable("include"); - check_generic ($step6, "Write permissions to save config file in './include'"); - - $cfgin = fopen ("include/config.inc.php","r"); - $cfgout = fopen ($pandora_config,"w"); - $config_contents = fread ($cfgin, filesize("include/config.inc.php")); - $dbtype = 'mysql'; - $config_new = '<?php - // Begin of automatic config file - $config["dbtype"] = "' . $dbtype . '"; //DB type (mysql, postgresql...in future others) - $config["dbname"]="'.$dbname.'"; // MySQL DataBase name - $config["dbuser"]="pandora"; // DB User - $config["dbpass"]="'.$random_password.'"; // DB Password - $config["dbhost"]="'.$dbhost.'"; // DB Host - $config["homedir"]="'.$path.'"; // Config homedir - /* - ----------Attention-------------------- - Please note that in certain installations: - - reverse proxy. - - web server in other ports. - - https - - This variable might be dynamically altered. - - But it is save as backup in the - $config["homeurl_static"] - for expecial needs. - ----------Attention-------------------- - */ - $config["homeurl"]="'.$url.'"; // Base URL - $config["homeurl_static"]="'.$url.'"; // Don\'t delete - // End of automatic config file - ?>'; - $step7 = fputs ($cfgout, $config_new); - $step7 = $step7 + fputs ($cfgout, $config_contents); - if ($step7 > 0) - $step7 = 1; - fclose ($cfgin); - fclose ($cfgout); - chmod ($pandora_config, 0600); - check_generic ($step7, "Created new config file at '".$pandora_config."'"); - } - } - - if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { - $everything_ok = 1; - } - break; - case 'mysqli': - $connection = mysqli_connect ($dbhost, $dbuser, $dbpassword); - if (mysqli_connect_error() > 0) { - check_generic ( 0, "Connection with Database"); - } - else { - check_generic ( 1, "Connection with Database"); - - // Drop database if needed and don't want to install over an existing DB - if ($dbdrop == 1) { - mysqli_query ($connection, "DROP DATABASE IF EXISTS `$dbname`"); - } - - // Create schema - if ($dbaction == 'db_new' || $dbdrop == 1) { - $step1 = mysqli_query ($connection, "CREATE DATABASE `$dbname`"); - check_generic ($step1, "Creating database '$dbname'"); - } - else { - $step1 = 1; - } - if ($step1 == 1) { - $step2 = mysqli_select_db($connection, $dbname); - check_generic ($step2, "Opening database '$dbname'"); - - $step3 = parse_mysqli_dump($connection, "pandoradb.sql"); - check_generic ($step3, "Creating schema"); - - $step4 = parse_mysqli_dump($connection, "pandoradb_data.sql"); - check_generic ($step4, "Populating database"); - if (PHP_OS == "FreeBSD") { - $step_freebsd = adjust_paths_for_freebsd ($engine, $connection); - check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD"); - } - - $random_password = random_name (8); - $host = $dbhost; // set default granted origin to the origin of the queries - if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) - $host = $dbgrant; // if the granted origin is different from local machine, set the valid origin - $step5 = mysqli_query ($connection, "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host - IDENTIFIED BY '".$random_password."'"); - mysqli_query ($connection, "FLUSH PRIVILEGES"); - check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>"); - - $step6 = is_writable("include"); - check_generic ($step6, "Write permissions to save config file in './include'"); - - $cfgin = fopen ("include/config.inc.php","r"); - $cfgout = fopen ($pandora_config,"w"); - $config_contents = fread ($cfgin, filesize("include/config.inc.php")); - $dbtype = 'mysql'; - $config_new = '<?php - // Begin of automatic config file - $config["dbtype"] = "' . $dbtype . '"; //DB type (mysql, postgresql...in future others) - $config["mysqli"] = true; - $config["dbname"]="'.$dbname.'"; // MySQL DataBase name - $config["dbuser"]="pandora"; // DB User - $config["dbpass"]="'.$random_password.'"; // DB Password - $config["dbhost"]="'.$dbhost.'"; // DB Host - $config["homedir"]="'.$path.'"; // Config homedir - /* - ----------Attention-------------------- - Please note that in certain installations: - - reverse proxy. - - web server in other ports. - - https - - This variable might be dynamically altered. - - But it is save as backup in the - $config["homeurl_static"] - for expecial needs. - ----------Attention-------------------- - */ - $config["homeurl"]="'.$url.'"; // Base URL - $config["homeurl_static"]="'.$url.'"; // Don\'t delete - // End of automatic config file - ?>'; - $step7 = fputs ($cfgout, $config_new); - $step7 = $step7 + fputs ($cfgout, $config_contents); - if ($step7 > 0) - $step7 = 1; - fclose ($cfgin); - fclose ($cfgout); - chmod ($pandora_config, 0600); - check_generic ($step7, "Created new config file at '".$pandora_config."'"); - } - } - - if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { - $everything_ok = 1; - } - break; - } - echo "</table>"; - - if ($everything_ok == 1) { - echo "<div style='text-align:right; width:100%;'>"; - echo "<a id='step5' href='install.php?step=5'> - <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; - echo "</div>"; - } - else { - $info = "<div class='err'><b>There were some problems. - Installation was not completed.</b> - <p>Please correct failures before trying again. - All database "; - if ($engine == 'oracle') - $info .= "objects "; - else - $info .= "schemes "; - - $info .= "created in this step have been dropped. </p> - </div>"; - echo $info; - - switch ($engine) { - case 'mysql': - if (mysql_error() != "") { - echo "<div class='err'> <b>ERROR:</b> ". mysql_error().".</div>"; - } - - if ($step1 == 1) { - mysql_query ("DROP DATABASE $dbname"); - } - break; - case 'mysqli': - if (mysqli_error($connection) != "") { - echo "<div class='err'> <b>ERROR:</b> ". mysqli_error($connection).".</div>"; - } - - if ($step1 == 1) { - mysqli_query ($connection, "DROP DATABASE $dbname"); - } - break; - } - echo "</div>"; - } - echo "</div>"; - echo "<div style='clear: both;'></div>"; - echo " - </div> - <div id='foot_install'> - <i>Pandora FMS is an Open Source Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> - </div>"; -} - - -function install_step5() { - echo " - <div id='install_container'> - <div id='wizard'> - " . print_logo_status (6,6) . " - <div id='install_box'> - <h2>Installation complete</h2> - <p>For security, you now must manually delete this installer - ('<i>install.php</i>') file before trying to access to your Pandora FMS console. - <p>You should also install Pandora FMS Servers before trying to monitor anything; - please read documentation on how to install it.</p> - <p>Default user is <b>'admin'</b> with password <b>'pandora'</b>, - please change it both as soon as possible.</p> - <p>Don't forget to check <a href='http://pandorafms.com'>http://pandorafms.com</a> - for updates. - <p>Select if you want to rename '<i>install.php</i>'.</p> - <form method='post' action='index.php'> - <button class='btn_install_next' type='submit' name='rn_file'><span class='btn_install_next_text'>Yes, rename the file</span></button> - <input type='hidden' name='rename_file' value='1'> - </form> - <p><br><b><a id='access_pandora' href='index.php'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Click here to access to your Pandora FMS console</span></button></a>.</b> - </p> - </div>"; - - echo "</div> - <div id='foot_install'> - <i>Pandora FMS is an OpenSource Software project registered at - <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> - </div> -</div>"; -} -?> From 9a5675438484ebdbfecad9d5967221422b774f30 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Tue, 25 Sep 2018 11:59:37 +0200 Subject: [PATCH 28/66] Revert "Fixed bug in events replication" This reverts commit e59c40d687dcd48b28d9951c135468c051ad2b78. --- pandora_console/include/functions_events.php | 9 +- pandora_console/install.php | 983 +++++++++++++++++++ 2 files changed, 987 insertions(+), 5 deletions(-) create mode 100755 pandora_console/install.php diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index c6b5a78eee..f6b6da21cc 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2706,14 +2706,13 @@ function events_page_comments ($event, $childrens_ids = array()) { } break; } - - if (((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) && $config["show_events_in_local"] == false || $config["event_replication"] == false) { - $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); - + + if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) { + $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%;"', true); $comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'),'comment_button',false,'event_comment();','class="sub next"',true).'</div><br></div>'; } else { - $comments_form = ui_print_message(__( 'If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')); + $comments_form = ''; } $comments = '<div id="extended_event_comments_page" class="extended_event_pages">'.$comments_form.html_print_table($table_comments, true).'</div>'; diff --git a/pandora_console/install.php b/pandora_console/install.php new file mode 100755 index 0000000000..d9160ee127 --- /dev/null +++ b/pandora_console/install.php @@ -0,0 +1,983 @@ +<?php + +// Pandora FMS - http://pandorafms.com +// ================================================== +// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas +// Please see http://pandorafms.org for full contribution list + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation; version 2 + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <title>Pandora FMS - Installation Wizard</title> + <meta http-equiv="expires" content="0"> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <meta name="resource-type" content="document"> + <meta name="distribution" content="global"> + <meta name="author" content="Pandora FMS Development Team"> + <meta name="copyright" content="This is GPL software. Created by Sancho Lerena and many others"> + <meta name="keywords" content="pandora, fms, monitoring, network, system, GPL, software"> + <meta name="robots" content="index, follow"> + <link rel="icon" href="images/pandora.ico" type="image/ico"> + <link rel="stylesheet" href="include/styles/install.css" type="text/css"> + </head> + <script type="text/javascript"> + options_text = new Array('An existing Database','A new Database'); + options_values = new Array('db_exist','db_new'); + function ChangeDBDrop(causer) { + if (causer.value != 'db_exist') { + window.document.step2_form.drop.checked = 0; + window.document.step2_form.drop.disabled = 1; + } + else { + window.document.step2_form.drop.disabled = 0; + } + } + function ChangeDBAction(causer) { + var i = 0; + if (causer.value == 'oracle') { + window.document.step2_form.db_action.length = 1; + } + else { + window.document.step2_form.db_action.length = 2; + } + while (i < window.document.step2_form.db_action.length) { + window.document.step2_form.db_action.options[i].value = options_values[i]; + window.document.step2_form.db_action.options[i].text = options_text[i]; + i++; + } + window.document.step2_form.db_action.options[window.document.step2_form.db_action.length-1].selected=1; + ChangeDBDrop(window.document.step2_form.db_action); + } + function CheckDBhost(value){ + if (( value != "localhost") && ( value != "127.0.0.1")) { + document.getElementById('tr_dbgrant').style["display"] = "block"; + } + else { + document.getElementById('tr_dbgrant').style["display"] = "none"; + } + } + </script> + <body> + <div style='height: 10px'> + <?php +$version = '7.0NG.727'; +$build = '180924'; + $banner = "v$version Build $build"; + + error_reporting(0); + + // --------------- + // Main page code + // --------------- + + if (! isset($_GET["step"])) { + install_step1(); + } + else { + $step = $_GET["step"]; + switch ($step) { + case 11: install_step1_licence(); + break; + case 2: install_step2(); + break; + case 3: install_step3(); + break; + case 4: install_step4(); + break; + case 5: install_step5(); + break; + } + } + ?> + </div> + </body> +</html> + +<?php +function check_extension ( $ext, $label ) { + echo "<tr><td>"; + echo "<span class='arr'> $label </span>"; + echo "</td><td>"; + if (!extension_loaded($ext)) { + echo "<img src='images/dot_red.png'>"; + return 1; + } + else { + echo "<img src='images/dot_green.png'>"; + return 0; + } + echo "</td></tr>"; +} + +function check_include ( $ext, $label ) { + echo "<tr><td>"; + echo "<span class='arr'> $label </span>"; + echo "</td><td>"; + if (!include($ext)) { + echo "<img src='images/dot_red.png'>"; + return 1; + } + else { + echo "<img src='images/dot_green.png'>"; + return 0; + } + echo "</td></tr>"; +} + +function check_exists ( $file, $label ) { + echo "<tr><td>"; + echo "<span class='arr'> $label </span>"; + echo "</td><td>"; + if (!file_exists ($file)) { + echo " <img src='images/dot_red.png'>"; + return 1; + } + else { + echo " <img src='images/dot_green.png'>"; + return 0; + } + echo "</td></tr>"; +} + +function check_generic ( $ok, $label ) { + echo "<tr><td style='width:10%'>"; + if ($ok == 0 ) { + echo " <img src='images/dot_red.png'>"; + echo "<td>"; + echo "<span class='arr'> $label </span>"; + echo "</td>"; + echo "</td></tr>"; + return 1; + } + else { + echo " <img src='images/dot_green.png'>"; + echo "<td>"; + echo "<span class='arr'> $label </span>"; + echo "</td>"; + echo "</td></tr>"; + return 0; + } +} + +function check_writable ( $fullpath, $label ) { + echo "<tr><td style='width:10%;'>"; + if (file_exists($fullpath)) + if (is_writable($fullpath)) { + echo " <img style='margin-left:50px;' src='images/dot_green.png'>"; + echo "<td>"; + echo "<span class='arr'> $label </span>"; + echo "</td>"; + echo "</td></tr>"; + return 0; + } + else { + echo " <img style='margin-left:50px;' src='images/dot_red.png'>"; + echo "<td>"; + echo "<span class='arr'> $label </span>"; + echo "</td>"; + echo "</td></tr>"; + return 1; + } + else { + echo " <img style='margin-left:50px;' src='images/dot_red.png'>"; + echo "<td>"; + echo "<span class='arr'> $label </span>"; + echo "</td>"; + echo "</td></tr>"; + return 1; + } +} + +function check_variable ( $var, $value, $label, $mode ) { + echo "<tr><td>"; + echo "<span class='arr'> $label </span>"; + echo "</td><td>"; + if ($mode == 1) { + if ($var >= $value) { + echo " <img src='images/dot_green.png'>"; + return 0; + } + else { + echo " <img src='images/dot_red.png'>"; + return 1; + } + } + elseif ($var == $value) { + echo " <img src='images/dot_green.png'>"; + return 0; + } + else { + echo " <img src='images/dot_red.png'>"; + return 1; + } + echo "</td></tr>"; +} + +function parse_mysql_dump($url) { + if (file_exists($url)) { + $file_content = file($url); + $query = ""; + foreach($file_content as $sql_line) { + if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) { + $query .= $sql_line; + if(preg_match("/;[\040]*\$/", $sql_line)) { + if (!$result = mysql_query($query)) { + echo mysql_error(); //Uncomment for debug + echo "<i><br>$query<br></i>"; + return 0; + } + $query = ""; + } + } + } + return 1; + } + else + return 0; +} + +function parse_mysqli_dump($connection, $url) { + if (file_exists($url)) { + $file_content = file($url); + $query = ""; + foreach($file_content as $sql_line) { + if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) { + $query .= $sql_line; + if(preg_match("/;[\040]*\$/", $sql_line)) { + if (!$result = mysqli_query($connection, $query)) { + echo mysqli_error(); //Uncomment for debug + echo "<i><br>$query<br></i>"; + return 0; + } + $query = ""; + } + } + } + return 1; + } + else + return 0; +} + +function random_name ($size) { + $temp = ""; + for ($a=0;$a< $size;$a++) + $temp = $temp. chr(rand(122,97)); + + return $temp; +} + +function print_logo_status ($step, $step_total) { + global $banner; + + $header = " + <div id='logo_img' style='width: 100%;'> + <div style='width:100%; background-color:#333333;'> + <img src='images/logo_opensource.png' border='0'><br> + <span style='font-size: 9px;'>$banner</span> + </div> + </div>"; + $header .= " + <div class='installation_step'> + <b>Install step $step of $step_total</b> + </div>"; + + return $header; +} + +// +// This function adjusts path settings in pandora db for FreeBSD. +// +// All packages and configuration files except operating system's base files +// are installed under /usr/local in FreeBSD. So, path settings in pandora db +// for some programs should be changed from the Linux default. +// +function adjust_paths_for_freebsd($engine, $connection = false) { + + $adjust_sql = array( + "update trecon_script set script = REPLACE(script,'/usr/share','/usr/local/share');", + "update tconfig set value = REPLACE(value,'/usr/bin','/usr/local/bin') where token='netflow_daemon' OR token='netflow_nfdump' OR token='netflow_nfexpire';", + "update talert_commands set command = REPLACE(command,'/usr/bin','/usr/local/bin');", + "update talert_commands set command = REPLACE(command,'/usr/share', '/usr/local/share');", + "update tplugin set execute = REPLACE(execute,'/usr/share','/usr/local/share');", + "update tevent_response set target = REPLACE(target,'/usr/share','/usr/local/share');", + "insert into tconfig (token, value) VALUES ('graphviz_bin_dir', '/usr/local/bin');" + ); + + for ($i = 0; $i < count ($adjust_sql); $i++) { + switch ($engine) { + case 'mysql': + $result = mysql_query($adjust_sql[$i]); + break; + case 'mysqli': + $result = mysqli_query($connection, $adjust_sql[$i]); + break; + case 'oracle': + //Delete the last semicolon from current query + $query = substr($adjust_sql[$i], 0, strlen($adjust_sql[$i]) - 1); + $sql = oci_parse($connection, $query); + $result = oci_execute($sql); + break; + case 'pgsql': + pg_send_query($connection, $adjust_sql[$i]); + $result = pg_get_result($connection); + break; + } + if (!$result) { + return 0; + } + } + + return 1; +} + +function install_step1() { + global $banner; + + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status (1,6) . " + <div id='install_box'> + <h2>Welcome to Pandora FMS installation Wizard</h2> + <p>This wizard helps you to quick install Pandora FMS console and main database in your system.</p> + <p>In four steps, this installer will check all dependencies and will create your configuration, ready to use.</p> + <p>For more information, please refer to documentation.<br> + <i>Pandora FMS Development Team</i></p> + "; + if (file_exists("include/config.php")) { + echo "<div class='warn'><b>Warning:</b> You already have a config.php file. + Configuration and database would be overwritten if you continued.</div>"; + } + echo "<br>"; + echo "<table width=100%>"; + $writable = check_writable ( "include", "Checking if ./include is writable"); + if (file_exists("include/config.php")) + $writable += check_writable ( "include/config.php", "Checking if include/config.php is writable"); + echo "</table>"; + + echo "<div class='warn'><b>Warning:</b> This installer will <b>overwrite and destroy</b> + your existing Pandora FMS configuration and <b>Database</b>. Before continue, + please <b>be sure that you have no valuable Pandora FMS data in your Database</b>.<br> + </div>"; + + echo "<div class='info'><b>Upgrade</b>: + If you want to upgrade from Pandora FMS 4.x to 5.0 version, please use the migration tool inside /extras directory in this setup. + </div>"; + + echo "<br>"; + + if ($writable == 0) { + echo "<div style='text-align:right; width:100%;'>"; + echo "<a id='step11' href='install.php?step=11'><button type='submit' class='btn_install_next'><span class='btn_install_next_text'>Next</span></button></a>"; + echo "</div>"; + } + else { + echo "<div class='err'><b>ERROR:</b>You need to setup permissions to be able to write in ./include directory</div>"; + } + echo "</div>"; + + echo "<div style='clear:both;'></div>"; + echo " + </div> + <div id='foot_install'> + <i>Pandora FMS is an OpenSource Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> + </div>"; +} + +function install_step1_licence() { + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status (2,6) . " + <div id='install_box'> + <h2>GPL2 Licence terms agreement</h2> + <p>Pandora FMS is an OpenSource software project licensed under the GPL2 licence. Pandora FMS includes, as well, another software also licensed under LGPL and BSD licenses. Before continue, <i>you must accept the licence terms.</i>. + <p>For more information, please refer to our website at http://pandorafms.org and contact us if you have any kind of question about the usage of Pandora FMS</p> +<p>If you dont accept the licence terms, please, close your browser and delete Pandora FMS files.</p> + "; + + if (!file_exists("COPYING")) { + echo "<div class='warn'><b>Licence file 'COPYING' is not present in your distribution. This means you have some 'partial' Pandora FMS distribution. We cannot continue without accepting the licence file.</b>"; + echo "</div>"; + } + else { + echo "<form method=post action='install.php?step=2'>"; + echo "<textarea name='gpl2' cols=52 rows=15 style='width: 100%;'>"; + echo file_get_contents ("COPYING"); + echo "</textarea>"; + echo "<p>"; + echo "<div style='text-align: right;'><button id='btn_accept' class='btn_install_next' type='submit'><span class='btn_install_next_text'>Yes, I accept licence terms</span></button></div>"; + } + echo "</div>"; + + echo "</div> + <div style='clear: both;height: 1px;'><!-- --></div> + <div id='foot_install'> + <i>Pandora FMS is an OpenSource Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> + </div>"; +} + +function install_step2() { + + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status (3,6) . " + <div id='install_box'>"; + echo "<h2>Checking software dependencies</h2>"; + echo "<table border=0 width=230>"; + $res = 0; + $res += check_variable(phpversion(),"5.2","PHP version >= 5.2",1); + $res += check_extension("gd","PHP GD extension"); + $res += check_extension("ldap","PHP LDAP extension"); + $res += check_extension("snmp","PHP SNMP extension"); + $res += check_extension("session","PHP session extension"); + $res += check_extension("gettext","PHP gettext extension"); + $res += check_extension("mbstring","PHP Multibyte String"); + $res += check_extension("zip","PHP Zip"); + $res += check_extension("zlib","PHP Zlib extension"); + $res += check_extension("json","PHP json extension"); + $res += check_extension("curl","CURL (Client URL Library)"); + $res += check_extension("filter","PHP filter extension"); + $res += check_extension("calendar","PHP calendar extension"); + if (PHP_OS == "FreeBSD") { + $res += check_exists ("/usr/local/bin/twopi","Graphviz Binary"); + } + else if (PHP_OS == "NetBSD") { + $res += check_exists ("/usr/pkg/bin/twopi","Graphviz Binary"); + } + else if ( substr(PHP_OS, 0, 3) == 'WIN' ) { + $res += check_exists ("..\\..\\..\\Graphviz\\bin\\twopi.exe", "Graphviz Binary"); + } + else { + $res += check_exists ("/usr/bin/twopi","Graphviz Binary"); + } + + echo "<tr><td>"; + echo "<span style='display: block; font-family: verdana,arial,sans; + font-size: 8.5pt;margin-top: 2px; font-weight: bolder;'>DB Engines</span>"; + echo "</td><td>"; + echo "</td></tr>"; + check_extension("mysql", "PHP MySQL extension"); + check_extension("mysqli", "PHP MySQL(mysqli) extension"); + echo "</table>"; + + if ($res > 0) { + echo " + <div class='err'>You have some incomplete + dependencies. Please correct them or this installer + will not be able to finish your installation. + </div> + <div class='err'> + Remember, if you install any PHP module to comply + with these dependences, you <b>need to restart</b> + your HTTP/Apache server after it to use the new + modules. + </div> + <div style='text-align:right; width:100%;'> + Ignore it. <a id='step3' href='install.php?step=3' style='font-weight: bolder;'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Force install Step #3</span></button></a> + </div>"; + } + else { + echo "<div style='text-align:right; width:100%;'>"; + echo "<a id='step3' href='install.php?step=3'> + <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; + echo "</div>"; + } + echo "</div>"; + echo "<div style='clear: both;'><!-- --></div>"; + echo " + </div> + <div style='clear: both;'><!-- --></div> + </div> + <div id='foot_install'> + <i>Pandora FMS is an OpenSource Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> + </div>"; +} + + +function install_step3() { + $options = ''; + if (extension_loaded("mysql")) { + $options .= "<option value='mysql'>MySQL</option>"; + } + if (extension_loaded("mysqli")) { + $options .= "<option value='mysqli'>MySQL(mysqli)</option>"; + } + + $error = false; + if (empty($options)) { + $error = true; + } + + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status (4,6) . " + <div id='install_box'> + <h2>Environment and database setup</h2> + <p> + This wizard will create your Pandora FMS database, + and populate it with all the data needed to run for the first time. + </p> + <p> + You need a privileged user to create database schema, this is usually <b>root</b> user. + Information about <b>root</b> user will not be used or stored anymore. + </p> + <p> + You can also deploy the scheme into an existing Database. + In this case you need a privileged Database user and password of that instance. + </p> + <p> + Now, please, complete all details to configure your database and environment setup. + </p> + <div class='warn'> + <b>Warning:</b> This installer will <b>overwrite and destroy</b> your existing + Pandora FMS configuration and <b>Database</b>. Before continue, + please <b>be sure that you have no valuable Pandora FMS data in your Database.</b> + <br><br> + </div>"; + + if (extension_loaded("oci8")) { + echo " <div class='warn'>For Oracle installation an existing Database with a privileged user is needed.</div>"; + } + if (!$error) { + echo "<form method='post' name='step2_form' action='install.php?step=4'>"; + } + + echo "<table cellpadding=6 width=100% border=0 style='text-align: left;'>"; + echo "<tr><td>"; + echo "DB Engine<br>"; + + + if ($error) { + echo " + <div class='warn'> + <b>Warning:</b> You haven't a any DB engine with PHP. Please check the previous step to DB engine dependencies. + </div>"; + } + else { + echo "<select name='engine' onChange=\"ChangeDBAction(this)\">"; + echo $options; + echo "</select>"; + + echo "<td>"; + echo " Installation in <br>"; + echo "<select name='db_action' onChange=\"ChangeDBDrop(this)\">"; + echo "<option value='db_new'>A new Database</option>"; + echo "<option value='db_exist'>An existing Database</option>"; + echo "</select>"; + } + echo " <tr><td>DB User with privileges<br> + <input class='login' type='text' name='user' value='root' size=20> + + <td>DB Password for this user<br> + <input class='login' type='password' name='pass' value='' size=20> + + <tr><td>DB Hostname<br> + <input class='login' type='text' name='host' value='localhost' onkeyup='CheckDBhost(this.value);'size=20> + + <td>DB Name (pandora by default)<br> + <input class='login' type='text' name='dbname' value='pandora' size=20> + + <tr>"; + + // the field dbgrant is only shown when the DB host is different from 127.0.0.1 or localhost + echo "<tr id='tr_dbgrant' style='display:none;'> + <td colspan=\"2\">DB Host Access <img style='cursor:help;' src='/pandora_console/images/tip.png' title='Ignored if DB Hostname is localhost or 127.0.0.1'/><br> + <input class='login' type='text' name='dbgrant' value='" . $_SERVER['SERVER_ADDR'] . "' size=20> + </td> + </tr>"; + + + echo " <td valign=top>Drop Database if exists<br> + <input class='login' type='checkbox' name='drop' value=1> + </td>"; + + echo "<td>Full path to HTTP publication directory<br> + <span style='font-size: 9px'>For example /var/www/pandora_console/</span> + <br> + <input class='login' type='text' name='path' style='width: 240px;' + value='".dirname (__FILE__)."'> + + <tr>"; + if ($_SERVER['SERVER_ADDR'] == 'localhost' || $_SERVER['SERVER_ADDR'] == '127.0.0.1') { + echo "<td valign=top> + Drop Database if exists<br> + <input class='login' type='checkbox' name='drop' value=1> + "; + } else { + echo "<td>"; + } + echo "<td>URL path to Pandora FMS Console<br> + <span style='font-size: 9px'>For example '/pandora_console'</span> + </br> + <input class='login' type='text' name='url' style='width: 250px;' + value='".dirname ($_SERVER["SCRIPT_NAME"])."'> + </table> + "; + + if (!$error) { + echo "<div style='text-align:right; width:100%;'>"; + echo "<a id='step4' href='install.php?step=4'> + <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; + echo "</div>"; + } + + echo "</div>"; + + echo "</form>"; + + echo "<div style='clear:both;'></div>"; + echo "</div> + <div id='foot_install'> + <i>Pandora FMS is an OpenSource Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> + </div>"; +} + +function install_step4() { + $pandora_config = "include/config.php"; + + if ( (! isset($_POST["user"])) || (! isset($_POST["dbname"])) || (! isset($_POST["host"])) || + (! isset($_POST["pass"])) || (!isset($_POST['engine'])) || (! isset($_POST["db_action"])) ) { + $dbpassword = ""; + $dbuser = ""; + $dbhost = ""; + $dbname = ""; + $engine = ""; + $dbaction = ""; + $dbgrant = ""; + } + else { + $engine = $_POST['engine']; + $dbpassword = $_POST["pass"]; + $dbuser = $_POST["user"]; + $dbhost = $_POST["host"]; + $dbaction = $_POST["db_action"]; + if (isset($_POST["dbgrant"]) && $_POST["dbgrant"] != "") + $dbgrant = $_POST["dbgrant"]; + else + $dbgrant = $_SERVER["SERVER_ADDR"]; + if (isset($_POST["drop"])) + $dbdrop = $_POST["drop"]; + else + $dbdrop = 0; + + $dbname = $_POST["dbname"]; + if (isset($_POST["url"])) + $url = $_POST["url"]; + else + $url = "http://localhost"; + if (isset($_POST["path"])) { + $path = $_POST["path"]; + $path = str_replace("\\", "/", $path); // Windows compatibility + } + else + $path = "/var/www"; + } + $everything_ok = 0; + $step1=0; + $step2=0; + $step3=0; + $step4=0; $step5=0; $step6=0; $step7=0; + + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status(5,6) . " + <div id='install_box'> + <h2>Creating database and default configuration file</h2> + <table width='100%'>"; + switch ($engine) { + case 'mysql': + if (! mysql_connect ($dbhost, $dbuser, $dbpassword)) { + check_generic ( 0, "Connection with Database"); + } + else { + check_generic ( 1, "Connection with Database"); + + // Drop database if needed and don't want to install over an existing DB + if ($dbdrop == 1) { + mysql_query ("DROP DATABASE IF EXISTS `$dbname`"); + } + + // Create schema + if ($dbaction == 'db_new' || $dbdrop == 1) { + $step1 = mysql_query ("CREATE DATABASE `$dbname`"); + check_generic ($step1, "Creating database '$dbname'"); + } + else { + $step1 = 1; + } + if ($step1 == 1) { + $step2 = mysql_select_db($dbname); + check_generic ($step2, "Opening database '$dbname'"); + + $step3 = parse_mysql_dump("pandoradb.sql"); + check_generic ($step3, "Creating schema"); + + $step4 = parse_mysql_dump("pandoradb_data.sql"); + check_generic ($step4, "Populating database"); + if (PHP_OS == "FreeBSD") { + $step_freebsd = adjust_paths_for_freebsd ($engine); + check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD"); + } + + $random_password = random_name (8); + $host = $dbhost; // set default granted origin to the origin of the queries + if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) + $host = $dbgrant; // if the granted origin is different from local machine, set the valid origin + $step5 = mysql_query ("GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host + IDENTIFIED BY '".$random_password."'"); + mysql_query ("FLUSH PRIVILEGES"); + check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>"); + + $step6 = is_writable("include"); + check_generic ($step6, "Write permissions to save config file in './include'"); + + $cfgin = fopen ("include/config.inc.php","r"); + $cfgout = fopen ($pandora_config,"w"); + $config_contents = fread ($cfgin, filesize("include/config.inc.php")); + $dbtype = 'mysql'; + $config_new = '<?php + // Begin of automatic config file + $config["dbtype"] = "' . $dbtype . '"; //DB type (mysql, postgresql...in future others) + $config["dbname"]="'.$dbname.'"; // MySQL DataBase name + $config["dbuser"]="pandora"; // DB User + $config["dbpass"]="'.$random_password.'"; // DB Password + $config["dbhost"]="'.$dbhost.'"; // DB Host + $config["homedir"]="'.$path.'"; // Config homedir + /* + ----------Attention-------------------- + Please note that in certain installations: + - reverse proxy. + - web server in other ports. + - https + + This variable might be dynamically altered. + + But it is save as backup in the + $config["homeurl_static"] + for expecial needs. + ----------Attention-------------------- + */ + $config["homeurl"]="'.$url.'"; // Base URL + $config["homeurl_static"]="'.$url.'"; // Don\'t delete + // End of automatic config file + ?>'; + $step7 = fputs ($cfgout, $config_new); + $step7 = $step7 + fputs ($cfgout, $config_contents); + if ($step7 > 0) + $step7 = 1; + fclose ($cfgin); + fclose ($cfgout); + chmod ($pandora_config, 0600); + check_generic ($step7, "Created new config file at '".$pandora_config."'"); + } + } + + if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { + $everything_ok = 1; + } + break; + case 'mysqli': + $connection = mysqli_connect ($dbhost, $dbuser, $dbpassword); + if (mysqli_connect_error() > 0) { + check_generic ( 0, "Connection with Database"); + } + else { + check_generic ( 1, "Connection with Database"); + + // Drop database if needed and don't want to install over an existing DB + if ($dbdrop == 1) { + mysqli_query ($connection, "DROP DATABASE IF EXISTS `$dbname`"); + } + + // Create schema + if ($dbaction == 'db_new' || $dbdrop == 1) { + $step1 = mysqli_query ($connection, "CREATE DATABASE `$dbname`"); + check_generic ($step1, "Creating database '$dbname'"); + } + else { + $step1 = 1; + } + if ($step1 == 1) { + $step2 = mysqli_select_db($connection, $dbname); + check_generic ($step2, "Opening database '$dbname'"); + + $step3 = parse_mysqli_dump($connection, "pandoradb.sql"); + check_generic ($step3, "Creating schema"); + + $step4 = parse_mysqli_dump($connection, "pandoradb_data.sql"); + check_generic ($step4, "Populating database"); + if (PHP_OS == "FreeBSD") { + $step_freebsd = adjust_paths_for_freebsd ($engine, $connection); + check_generic ($step_freebsd, "Adjusting paths in database for FreeBSD"); + } + + $random_password = random_name (8); + $host = $dbhost; // set default granted origin to the origin of the queries + if (($dbhost != 'localhost') && ($dbhost != '127.0.0.1')) + $host = $dbgrant; // if the granted origin is different from local machine, set the valid origin + $step5 = mysqli_query ($connection, "GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host + IDENTIFIED BY '".$random_password."'"); + mysqli_query ($connection, "FLUSH PRIVILEGES"); + check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>"); + + $step6 = is_writable("include"); + check_generic ($step6, "Write permissions to save config file in './include'"); + + $cfgin = fopen ("include/config.inc.php","r"); + $cfgout = fopen ($pandora_config,"w"); + $config_contents = fread ($cfgin, filesize("include/config.inc.php")); + $dbtype = 'mysql'; + $config_new = '<?php + // Begin of automatic config file + $config["dbtype"] = "' . $dbtype . '"; //DB type (mysql, postgresql...in future others) + $config["mysqli"] = true; + $config["dbname"]="'.$dbname.'"; // MySQL DataBase name + $config["dbuser"]="pandora"; // DB User + $config["dbpass"]="'.$random_password.'"; // DB Password + $config["dbhost"]="'.$dbhost.'"; // DB Host + $config["homedir"]="'.$path.'"; // Config homedir + /* + ----------Attention-------------------- + Please note that in certain installations: + - reverse proxy. + - web server in other ports. + - https + + This variable might be dynamically altered. + + But it is save as backup in the + $config["homeurl_static"] + for expecial needs. + ----------Attention-------------------- + */ + $config["homeurl"]="'.$url.'"; // Base URL + $config["homeurl_static"]="'.$url.'"; // Don\'t delete + // End of automatic config file + ?>'; + $step7 = fputs ($cfgout, $config_new); + $step7 = $step7 + fputs ($cfgout, $config_contents); + if ($step7 > 0) + $step7 = 1; + fclose ($cfgin); + fclose ($cfgout); + chmod ($pandora_config, 0600); + check_generic ($step7, "Created new config file at '".$pandora_config."'"); + } + } + + if (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { + $everything_ok = 1; + } + break; + } + echo "</table>"; + + if ($everything_ok == 1) { + echo "<div style='text-align:right; width:100%;'>"; + echo "<a id='step5' href='install.php?step=5'> + <button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Next</span></button></a>"; + echo "</div>"; + } + else { + $info = "<div class='err'><b>There were some problems. + Installation was not completed.</b> + <p>Please correct failures before trying again. + All database "; + if ($engine == 'oracle') + $info .= "objects "; + else + $info .= "schemes "; + + $info .= "created in this step have been dropped. </p> + </div>"; + echo $info; + + switch ($engine) { + case 'mysql': + if (mysql_error() != "") { + echo "<div class='err'> <b>ERROR:</b> ". mysql_error().".</div>"; + } + + if ($step1 == 1) { + mysql_query ("DROP DATABASE $dbname"); + } + break; + case 'mysqli': + if (mysqli_error($connection) != "") { + echo "<div class='err'> <b>ERROR:</b> ". mysqli_error($connection).".</div>"; + } + + if ($step1 == 1) { + mysqli_query ($connection, "DROP DATABASE $dbname"); + } + break; + } + echo "</div>"; + } + echo "</div>"; + echo "<div style='clear: both;'></div>"; + echo " + </div> + <div id='foot_install'> + <i>Pandora FMS is an Open Source Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> + </div>"; +} + + +function install_step5() { + echo " + <div id='install_container'> + <div id='wizard'> + " . print_logo_status (6,6) . " + <div id='install_box'> + <h2>Installation complete</h2> + <p>For security, you now must manually delete this installer + ('<i>install.php</i>') file before trying to access to your Pandora FMS console. + <p>You should also install Pandora FMS Servers before trying to monitor anything; + please read documentation on how to install it.</p> + <p>Default user is <b>'admin'</b> with password <b>'pandora'</b>, + please change it both as soon as possible.</p> + <p>Don't forget to check <a href='http://pandorafms.com'>http://pandorafms.com</a> + for updates. + <p>Select if you want to rename '<i>install.php</i>'.</p> + <form method='post' action='index.php'> + <button class='btn_install_next' type='submit' name='rn_file'><span class='btn_install_next_text'>Yes, rename the file</span></button> + <input type='hidden' name='rename_file' value='1'> + </form> + <p><br><b><a id='access_pandora' href='index.php'><button class='btn_install_next' type='submit'><span class='btn_install_next_text'>Click here to access to your Pandora FMS console</span></button></a>.</b> + </p> + </div>"; + + echo "</div> + <div id='foot_install'> + <i>Pandora FMS is an OpenSource Software project registered at + <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i> + </div> +</div>"; +} +?> From c77bc2328f30e5a6d72212a4b0470dcf6c2eb33c Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Tue, 25 Sep 2018 12:04:18 +0200 Subject: [PATCH 29/66] Fixed bug in events replication --- pandora_console/include/functions_events.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index f6b6da21cc..c6b5a78eee 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2706,13 +2706,14 @@ function events_page_comments ($event, $childrens_ids = array()) { } break; } - - if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) { - $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%;"', true); + + if (((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) && $config["show_events_in_local"] == false || $config["event_replication"] == false) { + $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); + $comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'),'comment_button',false,'event_comment();','class="sub next"',true).'</div><br></div>'; } else { - $comments_form = ''; + $comments_form = ui_print_message(__( 'If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')); } $comments = '<div id="extended_event_comments_page" class="extended_event_pages">'.$comments_form.html_print_table($table_comments, true).'</div>'; From cc5104024d78c445367fd3d11b08622b2e477cd1 Mon Sep 17 00:00:00 2001 From: samucarc <samuel.carcases> Date: Tue, 25 Sep 2018 13:33:10 +0200 Subject: [PATCH 30/66] Fixed problems in scheduled downtime CLI --- pandora_console/include/functions_api.php | 2 +- pandora_console/include/functions_planned_downtimes.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 189cc4203b..62786471aa 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -100,7 +100,7 @@ function returnError($typeError, $returnType = 'string') { break; default: returnData("string", - array('type' => 'string', 'data' => __($typeError))); + array('type' => 'string', 'data' => __($returnType))); break; } } diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index eb0b730649..67f9ec9f29 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -666,6 +666,7 @@ function planned_downtimes_stop ($downtime) { function planned_downtimes_created ($values) { global $config; + $check_group = (bool) db_get_value ('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']); $check = (bool) db_get_value ('name', 'tplanned_downtime', 'name', $values['name']); $datetime_from = strtotime ($values['once_date_from'] . ' ' . $values['once_time_from']); @@ -702,6 +703,11 @@ function planned_downtimes_created ($values) { 'message' => __('Not created. Error inserting data') . ". " . __('The end day must be higher than the start day')); } + else if (!$check_group && $values['id_group'] != 0) { + return array('return' => false, + 'message' => __('Not created. Error inserting data') . ". " + . __('Group not exist')); + } else { if (trim(io_safe_output($values['name'])) != '') { if (!$check) { From 93f4b74c9c3ea6e7843ef01d01941fd8c1f95a64 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Wed, 26 Sep 2018 18:48:27 +0200 Subject: [PATCH 31/66] fixed bug: admin users not able to log in to node when they are created in metaconsole and included option assigned node at admin user creation form --- pandora_console/godmode/users/configure_user.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index f5b7fdc5bc..209817feff 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -154,6 +154,8 @@ if ($create_user) { } if (html_print_csrf_error()) return; + $user_is_admin = (int) get_parameter ('is_admin', 0); + $values = array (); $values['id_user'] = (string) get_parameter ('id_user'); $values['fullname'] = (string) get_parameter ('fullname'); @@ -164,7 +166,7 @@ if ($create_user) { $values['email'] = (string) get_parameter ('email'); $values['phone'] = (string) get_parameter ('phone'); $values['comments'] = (string) get_parameter ('comments'); - $values['is_admin'] = (int) get_parameter ('is_admin', 0); + $values['is_admin'] = $user_is_admin; $values['language'] = get_parameter ('language', 'default'); $values['timezone'] = (string) get_parameter('timezone'); $values['default_event_filter'] = (int) get_parameter('default_event_filter'); @@ -193,9 +195,9 @@ if ($create_user) { $values['last_pass_change'] = date ("Y/m/d H:i:s", get_system_time()); if(defined('METACONSOLE')) { $values['metaconsole_access'] = get_parameter ('metaconsole_access', 'basic'); - $values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0'); + $values['metaconsole_agents_manager'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_agents_manager', '0')); $values['metaconsole_assigned_server'] = get_parameter ('metaconsole_assigned_server', ''); - $values['metaconsole_access_node'] = get_parameter ('metaconsole_access_node', '0'); + $values['metaconsole_access_node'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_access_node', '0')); } } $values["not_login"] = (bool)get_parameter ('not_login', false); @@ -738,12 +740,11 @@ $(document).ready (function () { $('input:radio[name="is_admin"]').change(function() { if($('#radiobtn0002').prop('checked')) { $('#user_configuration_table-metaconsole_agents_manager').show(); - $('#user_configuration_table-metaconsole_assigned_server').show(); $('#user_configuration_table-metaconsole_access_node').show(); } else { $('#user_configuration_table-metaconsole_agents_manager').hide(); - $('#user_configuration_table-metaconsole_assigned_server').hide(); + $('#user_configuration_table-metaconsole_assigned_server').show(); $('#user_configuration_table-metaconsole_access_node').hide(); } }); From 712103c308472baf280ef95b52803ba8aa87bcaf Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Thu, 27 Sep 2018 17:35:52 +0200 Subject: [PATCH 32/66] Fixed bug in csv export graph --- .../include/graphs/flot/pandora.flot.js | 16 ++++++++++++---- pandora_console/operation/agentes/stat_win.php | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index a71cb5eb19..7a00258620 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2263,17 +2263,25 @@ function pandoraFlotArea( graph_id, values, legend, } $('#overview_' + graph_id).css('display', 'none'); - + if (menu) { var parent_height; $('#menu_overview_' + graph_id).click(function() { $('#overview_' + graph_id).toggle(); }); - $("#menu_export_csv_"+graph_id) - .click(function (event) { - event.preventDefault(); + $("#menu_export_csv_"+graph_id).click(function (e) { + e.preventDefault(); plot.exportDataCSV(); + var es_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + if(es_firefox){ + $("#dialog").css('visibility', 'visible').dialog(); + } + delete data_base[0].threshold; + plot = $.plot($('#' + graph_id), data_base, + $.extend(true, {}, options, { + legend: { show: true } + })); }); $('#menu_threshold_' + graph_id).click(function() { diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 6b98cc931c..a9e3666a28 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -100,8 +100,11 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); </script> </head> <body bgcolor="#ffffff" style='background:#ffffff;'> + <?php - + echo"<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>"; + echo"<p>" . __('The CSV export has been successful.') . "</p>"; + echo"</div>"; // Module id $id = (int) get_parameter ("id", 0); // Agent id From 9977f1ddf9b7665104079d0e04a9b54bf5387550 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Mon, 1 Oct 2018 09:51:58 +0200 Subject: [PATCH 33/66] Added code for function api_get_agent_alias for the API of the metaconsole - #2708 --- pandora_console/include/functions_agents.php | 12 ++++++---- pandora_console/include/functions_api.php | 25 +++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 45c72b2b83..5691750c69 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -28,13 +28,14 @@ require_once($config['homedir'] . '/include/functions_users.php'); * * @param int $id_agent The agent id. * @param boolean $show_disabled Show the agent found althought it is disabled. By default false. + * @param boolean $force_meta * * @return boolean The result to check if the agent is in the DB. */ -function agents_check_agent_exists($id_agent, $show_disabled = true) { +function agents_check_agent_exists($id_agent, $show_disabled = true, $force_meta = false) { $agent = db_get_value_filter( 'id_agente', - 'tagente', + $force_meta ? 'tmetaconsole_agent' : 'tagente', array('id_agente' => $id_agent, 'disabled' => !$show_disabled) ); @@ -2735,17 +2736,18 @@ function agents_count_agents_filter ($filter = array(), $access = "AR") { * * @param int Id agent * @param string ACL access bit + * @param boolean $force_meta * * @return True if user has access, false if user has not permissions and * null if id agent does not exist */ -function agents_check_access_agent ($id_agent, $access = "AR") { +function agents_check_access_agent ($id_agent, $access = "AR", $force_meta = false) { global $config; - if (users_access_to_agent($id_agent, $access)) return true; + if (users_access_to_agent($id_agent, $access, false, $force_meta)) return true; // If agent exist return false - if (agents_check_agent_exists($id_agent)) return false; + if (agents_check_agent_exists($id_agent, true, $force_meta)) return false; // Return null otherwise return null; } diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 189cc4203b..ca08e773c0 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9186,18 +9186,27 @@ function api_get_agent_id($trash1, $trash2, $data, $returnType) { * Agent alias for a given id * * @param int $id_agent + * @param int $id_node Only for metaconsole + * @param $thrash1 Don't use. + * @param $returnType * **/ -// http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora -function api_get_agent_alias($id_agent, $trash1, $trash2, $returnType) { - if (defined ('METACONSOLE')) { - return; +// http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora +// http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora +function api_get_agent_alias($id_agent, $id_node, $trash1, $returnType) { + $table_agent_alias = 'tagente'; + $force_meta=false; + + if (is_metaconsole()) { + $table_agent_alias = 'tmetaconsole_agent'; + $force_meta = true; + $id_agent = db_get_value_sql("SELECT id_agente FROM tmetaconsole_agent WHERE id_tagente = $id_agent AND id_tmetaconsole_setup = $id_node"); } - if (!util_api_check_agent_and_print_error($id_agent, $returnType)) return; + if (!util_api_check_agent_and_print_error($id_agent, $returnType, 'AR', $force_meta)) return; $sql = sprintf('SELECT alias - FROM tagente + FROM ' . $table_agent_alias . ' WHERE id_agente = %d', $id_agent); $value = db_get_value_sql($sql); @@ -11383,10 +11392,10 @@ function api_get_cluster_items ($cluster_id){ // AUX FUNCTIONS ///////////////////////////////////////////////////////////////////// -function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR") { +function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR", $force_meta = false) { global $config; - $check_agent = agents_check_access_agent($id_agent, $access); + $check_agent = agents_check_access_agent($id_agent, $access, $force_meta); if ($check_agent === true) return true; if ($check_agent === false || !check_acl($config['id_user'], 0, $access)) { From 04226c79402cda4cc449c098a3efb8797affa945 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Mon, 1 Oct 2018 12:26:06 +0200 Subject: [PATCH 34/66] Changed styles for the button create_network_component - #2814 --- pandora_console/operation/snmpconsole/snmp_browser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 22fa43e5a6..435aaeade2 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -50,7 +50,7 @@ if (is_ajax()) { else { snmp_browser_print_tree ($snmp_tree); echo html_print_submit_button(__('Create network components'),'create_network_component', - false, array('style' => 'display: none; position: fixed; bottom: 55px; right: 80px;', 'class' => 'sub add'), true); + false, array('style' => 'display: none; position: absolute; bottom: 0px; right: 35px;', 'class' => 'sub add'), true); echo '<div id="dialog_error" style="display: none" title="Network components">'; echo "<div>"; From c4c0e89cbeb3d2b1a51f8cd8bba0435d3ffacecb Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Mon, 1 Oct 2018 13:24:08 +0200 Subject: [PATCH 35/66] Added class data to the table for last activity - #2846 --- pandora_console/general/logon_ok.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index c2ecec56da..5cd214304a 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -210,6 +210,7 @@ if (!empty($all_data)) { echo '<div id="activity">'; $table = new stdClass(); + $table->class = "databox data"; $table->width = '100%'; //Don't specify px $table->data = array (); $table->size = array (); From ae4472d5c839da434d5136d30cb69d884ab6d9e6 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Mon, 1 Oct 2018 16:59:17 +0200 Subject: [PATCH 36/66] Added align center for the head of the table - #2848 --- pandora_console/operation/snmpconsole/snmp_view.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 25dfd563ab..8712406ed9 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -708,50 +708,61 @@ $table->head = array (); $table->size = array (); $table->data = array (); $table->align = array (); +$table->headstyle = array (); $table->head[0] = __('Status'); $table->align[0] = "center"; $table->size[0] = '5%'; +$table->headstyle[0] = 'text-align: center'; $table->head[1] = __('SNMP Agent'); $table->align[1] = "center"; $table->size[1] = '15%'; +$table->headstyle[1] = 'text-align: center'; $table->head[2] = __('Enterprise String'); $table->align[2] = "center"; $table->size[2] = '18%'; +$table->headstyle[2] = 'text-align: center'; if ($group_by) { $table->head[3] = __('Count'); $table->align[3] = "center"; $table->size[3] = '5%'; + $table->headstyle[3] = 'text-align: center'; } $table->head[4] = __('Trap subtype'); $table->align[4] = "center"; $table->size[4] = '10%'; +$table->headstyle[4] = 'text-align: center'; $table->head[5] = __('User ID'); $table->align[5] = "center"; $table->size[5] = '10%'; +$table->headstyle[5] = 'text-align: center'; $table->head[6] = __('Timestamp'); $table->align[6] = "center"; $table->size[6] = '10%'; +$table->headstyle[6] = 'text-align: center'; $table->head[7] = __('Alert'); $table->align[7] = "center"; $table->size[7] = '5%'; +$table->headstyle[7] = 'text-align: center'; $table->head[8] = __('Action'); $table->align[8] = "center"; $table->size[8] = '10%'; +$table->headstyle[8] = 'text-align: center'; $table->head[9] = html_print_checkbox_extended ("allbox", 1, false, false, "javascript:CheckAll();", 'class="chk" title="'.__('All').'"', true); $table->align[9] = "center"; $table->size[9] = '5%'; +$table->headstyle[9] = 'text-align: center'; $table->style[8] = "background: #F3F3F3; color: #111 !important;"; From eba9c58f18db9cea241a82ffbe45a21fa1b9ec7c Mon Sep 17 00:00:00 2001 From: Ramon Novoa <rnovoa@artica.es> Date: Tue, 2 Oct 2018 12:43:39 +0200 Subject: [PATCH 37/66] Prevent the counter from overflowing often when server_threshold is low. --- pandora_server/bin/pandora_server | 2 +- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index f26cf3d016..1edb896101 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -382,7 +382,7 @@ sub pandora_server_tasks ($) { } # Avoid counter overflow - if ($counter > 10000){ + if ($counter >= ~0){ $counter = 0; } else { diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 5ce5614d16..4530493471 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4882,7 +4882,7 @@ sub pandora_self_monitoring ($$) { my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{'servername'}.".self.".$utimestamp.".data"; - open (XMLFILE, ">> $filename") or die "[FATAL] Could not open internal monitoring XML file for deploying monitorization at '$filename'"; + open (XMLFILE, ">", $filename) or die "[FATAL] Could not open internal monitoring XML file for deploying monitorization at '$filename'"; print XMLFILE $xml_output; close (XMLFILE); } From 61a3d147afbada7342ac5c88829aff81d024a1d8 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Wed, 3 Oct 2018 16:41:58 +0200 Subject: [PATCH 38/66] Added descriptive error messages - #2858 --- .../godmode/alerts/alert_actions.php | 18 ++++++++++++-- .../godmode/alerts/alert_commands.php | 17 +++++++++++-- pandora_console/godmode/alerts/alert_list.php | 20 ++++++++++++++-- .../godmode/alerts/alert_special_days.php | 24 +++++++++++++++---- .../alerts/configure_alert_template.php | 16 +++++++++++-- 5 files changed, 82 insertions(+), 13 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 3bad38b982..a80ba40a23 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -179,9 +179,23 @@ if ($create_action) { db_pandora_audit("Command management", "Fail try to create alert action", false, false); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No name specified'); + } + + if ($id_alert_command == "") { + $messageAction = __('No command specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } if ($update_action) { diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 09e868f951..9ca4ea501a 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -307,9 +307,22 @@ if ($create_command) { db_pandora_audit("Command management", "Fail try to create alert command", false, false); } - ui_print_result_message ($result, + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No name specified'); + } + + if ($command == "") { + $messageAction = __('No command specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 9a6badcc24..4d61925550 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -126,9 +126,25 @@ if ($create_alert) { "Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'"); } - $messageAction = ui_print_result_message ($id, - __('Successfully created'), __('Could not be created'), '', true); + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + if ($id_alert_template == "") { + $messageAction = __('No template specified'); + } + + if ($id_agent_module == "") { + $messageAction = __('No module specified'); + } + + $messageAction = ui_print_result_message ($id, + __('Successfully created'), + $messageAction); + + if ($id !== false) { $action_select = get_parameter('action_select'); diff --git a/pandora_console/godmode/alerts/alert_special_days.php b/pandora_console/godmode/alerts/alert_special_days.php index c221f963af..0e4ce10a38 100644 --- a/pandora_console/godmode/alerts/alert_special_days.php +++ b/pandora_console/godmode/alerts/alert_special_days.php @@ -130,6 +130,7 @@ if ($create_special_day) { $date_check = db_get_value_filter ('date', 'talert_special_days', $filter); if ($date_check == $date) { $result = ''; + $messageAction = __('Could not be created, it already exists'); } else { $result = alerts_create_alert_special_day ($date, $same_day, $values); @@ -143,10 +144,16 @@ if ($create_special_day) { else { db_pandora_audit("Command management", "Fail try to create special day", false, false); } - - ui_print_result_message ($result, + + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); } if ($update_special_day) { @@ -183,6 +190,7 @@ if ($update_special_day) { $date_check = db_get_value_filter ('date', 'talert_special_days', $filter); if ($date_check == $date) { $result = ''; + $messageAction = __('Could not be updated, it already exists'); } else { $result = alerts_update_alert_special_day ($id, $values); @@ -202,9 +210,15 @@ if ($update_special_day) { db_pandora_audit("Command management", "Fail to update special day " . $id, false, false); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be updated'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully updated'), - __('Could not be updated')); + $messageAction); } if ($delete_special_day) { diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 5fc232490a..b75b26561f 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -428,9 +428,21 @@ if ($create_template) { json_encode($values)); } - ui_print_result_message ($result, + + /* Show errors */ + if (!isset($messageAction)) { + $messageAction = __('Could not be created'); + } + + if ($name == "") { + $messageAction = __('No template name specified'); + } + + $messageAction = ui_print_result_message ($result, __('Successfully created'), - __('Could not be created')); + $messageAction); + + /* Go to previous step in case of error */ if ($result === false) $step = $step - 1; From 0855d091562e16fb3074e3621dd635014f1ce5b5 Mon Sep 17 00:00:00 2001 From: "tatiana.llorente@artica.es" <tatiana.llorente@artica.es> Date: Wed, 3 Oct 2018 16:46:35 +0200 Subject: [PATCH 39/66] Fixed a minor mistake - #2858 --- pandora_console/godmode/alerts/alert_list.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 4d61925550..4df1ec4be5 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -141,9 +141,8 @@ if ($create_alert) { } $messageAction = ui_print_result_message ($id, - __('Successfully created'), - $messageAction); - + __('Successfully created'), $messageAction, '', true); + if ($id !== false) { $action_select = get_parameter('action_select'); From 7766881da623cf3b6ed4718c51cc8606edc0b6c9 Mon Sep 17 00:00:00 2001 From: fbsanchez <fborja.sanchez@artica.es> Date: Thu, 4 Oct 2018 17:07:34 +0200 Subject: [PATCH 40/66] Added option charset to db_connect Removed unused function db_get_table_count --- pandora_console/include/db/mysql.php | 47 +++-------------------- pandora_console/include/db/oracle.php | 36 ----------------- pandora_console/include/db/postgresql.php | 35 ----------------- pandora_console/include/functions_db.php | 26 +++---------- 4 files changed, 10 insertions(+), 134 deletions(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 7101f960de..45f0a22db6 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -14,7 +14,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null) { +function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = "utf8") { global $config; if ($host === null) @@ -42,6 +42,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, } db_change_cache_id ($db, $host); + mysqli_set_charset($connect_id, $charset); + mysqli_select_db($connect_id, $db); } else { @@ -52,6 +54,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, db_change_cache_id ($db, $host); + @mysql_set_charset($connect_id, $charset); + mysql_select_db($db, $connect_id); } @@ -1198,47 +1202,6 @@ function mysql_db_get_type_field_table($table, $field) { } } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function mysql_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = mysql_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - if ($config["mysqli"]) { - $config['history_db_connection'] = mysqli_connect_db ($config['history_db_host'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_name'], $config['history_db_port'], false); - } - else { - $config['history_db_connection'] = mysql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - } - if ($config['history_db_connection'] !== false) { - $history_count = mysql_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} - function mysql_get_fields($table) { global $config; diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index a651eeffa7..4e7cec79f4 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -1476,42 +1476,6 @@ function oracle_list_all_field_table($table_name, $return_mode = 'array') { } } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function oracle_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = oracle_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - $config['history_db_connection'] = oracle_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - if ($config['history_db_connection'] !== false) { - $history_count = oracle_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} - /** * Process a file with an oracle schema sentences. * Based on the function which installs the pandoradb.sql schema. diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index 7b1bd56ec0..1b74f21b07 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -1055,40 +1055,5 @@ function postgresql_db_get_type_field_table($table, $field) { return pg_field_type($result, $field); } -/** - * Get the element count of a table. - * - * @param string $sql SQL query to get the element count. - * - * @return int Return the number of elements in the table. - */ -function postgresql_db_get_table_count($sql, $search_history_db = false) { - global $config; - - $history_count = 0; - $count = postgresql_db_get_value_sql ($sql); - if ($count === false) { - $count = 0; - } - - // Search the history DB for matches - if ($search_history_db && $config['history_db_enabled'] == 1) { - - // Connect to the history DB - if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) { - $config['history_db_connection'] = postgresql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false); - } - if ($config['history_db_connection'] !== false) { - $history_count = postgresql_db_get_value_sql ($sql, $config['history_db_connection']); - if ($history_count === false) { - $history_count = 0; - } - } - } - - $count += $history_count; - - return $count; -} ?> diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index aaf61db8cd..063897ea74 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -43,13 +43,13 @@ function db_select_engine() { } } -function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true) { +function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = "utf8") { global $config; static $error = 0; switch ($config["dbtype"]) { case "mysql": - $return = mysql_connect_db($host, $db, $user, $pass, $port); + $return = mysql_connect_db($host, $db, $user, $pass, $port, $charset); break; case "postgresql": $return = postgresql_connect_db($host, $db, $user, $pass, $port); @@ -1654,28 +1654,12 @@ function db_get_type_field_table($table, $field) { } /** - * Get the element count of a table. + * Get the columns of a table. * - * @param string $sql SQL query to get the element count. + * @param string $table table to retrieve columns. * - * @return int Return the number of elements in the table. + * @return array with column names. */ -function db_get_table_count($table, $search_history_db = false) { - global $config; - - switch ($config["dbtype"]) { - case "mysql": - return mysql_db_get_table_count($table, $search_history_db); - break; - case "postgresql": - return postgresql_db_get_table_count($table, $search_history_db); - break; - case "oracle": - return oracle_db_get_table_count($table, $search_history_db); - break; - } -} - function db_get_fields($table) { global $config; From 015dcdb032cdc626ccfb89772c800e6fc75ce44a Mon Sep 17 00:00:00 2001 From: samucarc <samuel.carcases> Date: Thu, 11 Oct 2018 13:07:59 +0200 Subject: [PATCH 41/66] Fixed enterprise ACLs in Agents View --- pandora_console/operation/agentes/estado_agente.php | 4 ++-- pandora_console/operation/agentes/group_view.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index d37cc9396c..20d3f18a47 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -623,7 +623,7 @@ foreach ($agents as $agent) { $data[0] = '<div class="left_' . $agent["id_agente"] . '">'; $data[0] .= '<span>'; - $data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'"> <span style="font-size: 7pt;font-weight:bold" title ="' . $agent["nombre"]. '">'.$agent["alias"].'</span></a>'; + $data[0] .= '<a href="index.php?sec=view&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'"> <span style="font-size: 7pt;font-weight:bold" title ="' . $agent["nombre"]. '">'.$agent["alias"].'</span></a>'; $data[0] .= '</span>'; if ($agent['quiet']) { @@ -642,7 +642,7 @@ foreach ($agents as $agent) { $data[0] .= '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id='.$cluster['id'].'">'.__('View').'</a>'; } else{ - $data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>'; + $data[0] .= '<a href="index.php?sec=view&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>'; } if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) { diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index abc31b4ea4..d80870f334 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -246,7 +246,7 @@ if (!empty($result_groups)) { $link = "<a href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "'>"; } else { $deep = groups_get_group_deep ($data['_id_']); - $link = "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; + $link = "<a href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; } $group_name = "<b><span style='font-size: 7.5pt'>" . ui_print_truncate_text($data['_name_'], 50) . "</span></b>"; @@ -279,7 +279,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "'>"; } else { $link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;' - href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; } if ($data["_id_"] == 0) { echo $link . $total_agentes . "</a>"; @@ -296,7 +296,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_UNKNOWN ."'>"; } else { $link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;' - href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_UNKNOWN ."'>"; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_UNKNOWN ."'>"; } if (($data["_id_"] == 0) && ($agents_unknown != 0)) { echo $link . $agents_unknown . "</a>"; @@ -313,7 +313,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_NOT_INIT ."'>"; } else { $link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;' - href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_NOT_INIT ."'>"; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_NOT_INIT ."'>"; } if (($data["_id_"] == 0) && ($agents_notinit != 0)) { echo $link . $agents_notinit . "</a>"; @@ -331,7 +331,7 @@ if (!empty($result_groups)) { href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_CRITICAL ."'>"; } else { $link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;' - href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_CRITICAL ."'>"; + href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_CRITICAL ."'>"; } if (($data["_id_"] == 0) && ($agents_critical != 0)) { echo $link . $agents_critical . "</a>"; From c74e4a3d6ada19dcee3f2188d65cc1443c6e148b Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Thu, 11 Oct 2018 15:45:11 +0200 Subject: [PATCH 42/66] Fixed agent filter on agents/module view to see secondary groups --- .../operation/agentes/ver_agente.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index f98af59772..438132240e 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -68,14 +68,18 @@ if (is_ajax ()) { } } else { - $groups_orig = users_get_groups(false, $privilege); + $groups_orig = users_get_groups(false, $privilege, false); $groups = array_keys($groups_orig); } - + // Build filter $filter = array(); - $filter['id_grupo'] = $groups; - + // Group filter (primary and secondary) + $filter[] = "(" .db_format_array_where_clause_sql( + array('id_grupo' => $groups, 'id_group' => $groups), + 'OR' + ) . ")"; + if (!empty($id_os)) $filter['id_os'] = $id_os; if (!empty($agent_name)) @@ -158,12 +162,17 @@ if (is_ajax ()) { } } - + $filter['group'] = 'id_agente'; + // Build fields $fields = array('id_agente', 'alias'); // Perform search - $agents = db_get_all_rows_filter('tagente', $filter, $fields); + $agents = db_get_all_rows_filter( + 'tagente LEFT JOIN tagent_secondary_group ON id_agente=id_agent', + $filter, + $fields + ); if (empty($agents)) $agents = array(); foreach ($agents as $k => $v) { From 0747a5b263f7a8b81487507da0b9331ed6eb4dd1 Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Thu, 11 Oct 2018 16:00:49 +0200 Subject: [PATCH 43/66] Fixed secondary groups privileges in agent popup in tree view --- pandora_console/include/functions_treeview.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 2f2e899143..544c66b35a 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -468,8 +468,6 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals enterprise_include_once ('meta/include/functions_ui_meta.php'); include_graphs_dependencies(); - $strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); - $is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente)); if ($is_extra === ENTERPRISE_NOT_HOOK) { @@ -483,9 +481,13 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals return; } + // Get the agent info $agent = db_get_row ("tagente", "id_agente", $id_agente); - - if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) { + if ($agent == false) return; + + // Check all groups + $groups = agents_get_all_groups_agent($id_agente, $agent["id_grupo"], is_metaconsole()); + if (! check_acl_one_of_groups ($config["id_user"], $groups, "AR") && ! check_acl_one_of_groups ($config["id_user"], $groups, "AW") && !$is_extra) { db_pandora_audit("ACL Violation", "Trying to access Agent General Information"); require_once ("general/noaccess.php"); From 41d104ae2c2e85fb394dca67d2338d0f0ff08263 Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Mon, 15 Oct 2018 12:23:51 +0200 Subject: [PATCH 44/66] Improve performance on tactical view with a lot of events --- pandora_console/include/functions_events.php | 25 +- pandora_console/include/functions_graph.php | 59 ++--- .../include/functions_reporting.php | 214 +++++++----------- .../operation/agentes/tactical.php | 7 +- 4 files changed, 116 insertions(+), 189 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 39c5fa59ae..dd4c441b2a 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -850,25 +850,14 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret if ($filter == '') { $filter = '1 = 1'; } - - switch ($config["dbtype"]) { - case "mysql": - case "postgresql": - $sql = sprintf ("SELECT DISTINCT tevento.* - FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent - WHERE %s %s - ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit); - break; - case "oracle": - $sql = sprintf ("SELECT * - FROM tevento - WHERE %s %s AND rownum <= %d - ORDER BY utimestamp DESC", $agent_condition, $filter, $limit); - break; - } + + $sql = sprintf ("SELECT DISTINCT tevento.* + FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent + WHERE %s %s + ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit); $result = db_get_all_rows_sql ($sql); - + if ($result === false) { if ($return) { $returned = ui_print_info_message (__('No events'), '', true); @@ -997,8 +986,6 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret $data[4] = "<a class='$myclass' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$event["id_agente"]."'>". agents_get_alias($event["id_agente"]). "</A>"; - - // ui_print_agent_name ($event["id_agente"], true, 25, '', true); // for System or SNMP generated alerts } elseif ($event["event_type"] == "system") { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 4bb4a26b47..0de011beb8 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2719,10 +2719,8 @@ function graph_events_validated($width = 300, $height = 200, $extra_filters = ar * @param integer width pie graph width * @param integer height pie graph height * @param string url - * @param bool if the graph required is or not for metaconsole - * @param bool if the graph required is or not for history table */ -function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = false, $history = false, $noWaterMark = true) { +function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $noWaterMark = true, $time_limit = false) { global $config; global $graphic_type; @@ -2752,26 +2750,15 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $url = str_replace( 'SELECT_id_agente_modulo', 'SELECT id_agente_modulo', $url); - - // Choose the table where search if metaconsole or not - if ($meta) { - if ($history) { - $event_table = 'tmetaconsole_event_history'; - } - else { - $event_table = 'tmetaconsole_event'; - } - $field_extra = ', agent_name'; - $groupby_extra = ', server_id'; - } - else { - $event_table = 'tevento'; - $field_extra = ''; - $groupby_extra = ''; - } + $event_table = 'tevento'; + $field_extra = ''; + $groupby_extra = ''; // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); + if ($time_limit) { + $tags_condition .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; + } //This will give the distinct id_agente, give the id_grupo that goes //with it and then the number of times it occured. GROUP BY statement @@ -2805,13 +2792,8 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $system_events += $row["count"]; } else { - if ($meta) { - $name = mb_substr (io_safe_output($row['agent_name']), 0, 25)." (".$row["count"].")"; - } - else { - $alias = agents_get_alias($row["id_agente"]); - $name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")"; - } + $alias = agents_get_alias($row["id_agente"]); + $name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")"; $data[$name] = $row["count"]; } } @@ -2822,14 +2804,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $name = __('SYSTEM')." (".$system_events.")"; $data[$name] = $system_events; } - - /* - if ($other_events > 0) { - $name = __('Other')." (".$other_events.")"; - $data[$name] = $other_events; - } - */ - + // Sort the data arsort($data); if ($noWaterMark) { @@ -2851,7 +2826,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = * * @param string filter Filter for query in DB */ -function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true) { +function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true, $time_limit = false) { global $config; global $graphic_type; @@ -2860,23 +2835,25 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWat // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); $filter .= $tags_condition; - + if ($time_limit) { + $filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; + } + $data = array (); $legend = array (); $total = 0; - - $where = ''; + + $where = "WHERE 1=1"; if (!users_is_admin()) { $where = 'WHERE event_type NOT IN (\'recon_host_detected\', \'system\',\'error\', \'new_agent\', \'configuration_change\')'; } - + $sql = sprintf("SELECT criticity, COUNT(id_evento) events FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent %s %s GROUP BY criticity ORDER BY events DESC", $where , $filter); - $criticities = db_get_all_rows_sql ($sql, false, false); if (empty($criticities)) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 668e576c64..015bf1c8bd 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -10065,7 +10065,7 @@ function reporting_get_agentmodule_sla_array ($id_agent_module, $period = 0, $mi return $data_colors; } -function reporting_get_stats_servers($tiny = true) { +function reporting_get_stats_servers() { global $config; $server_performance = servers_get_performance(); @@ -10101,21 +10101,20 @@ function reporting_get_stats_servers($tiny = true) { $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; - if ($tiny) { + if (isset($server_performance ["total_network_modules"])) { $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Remote modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_remote_modules"]) . '</span>'; + $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_network_modules"]) . '</span>'; - /* Hello there! :) -We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( -You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. -*/ - - $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["remote_modules_rate"], 2) . '</span>'; + $tdata[2] = '<span class="med_data">' . + format_numeric($server_performance["network_modules_rate"], 2) . + '</span>'; + + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){ - $tdata[4] = "<div id='agentsmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; + $tdata[4] = "<div id='remotemodulesmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; } else{ $tdata[4] = ' '; @@ -10124,128 +10123,91 @@ You can of course remove the warnings, that's why we include the source and do n $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; } - else { - if (isset($server_performance ["total_network_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_network_modules"]) . '</span>'; - - $tdata[2] = '<span class="med_data">' . - format_numeric($server_performance["network_modules_rate"], 2) . - '</span>'; - - - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - - if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){ - $tdata[4] = "<div id='remotemodulesmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; - } - else{ - $tdata[4] = ' '; - } - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_plugin_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_plugin_modules"]) . '</span>'; - - $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["plugin_modules_rate"], 2) . '</span>'; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_prediction_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_prediction_modules"]) . '</span>'; - - $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["prediction_modules_rate"], 2) . '</span>'; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_wmi_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_wmi_modules"]) . '</span>'; - - $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["wmi_modules_rate"], 2) . '</span>'; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - - if (isset($server_performance ["total_web_modules"])) { - $tdata = array(); - $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . - format_numeric($server_performance ["total_web_modules"]) . - '</span>'; - - $tdata[2] = '<span class="med_data">' . - format_numeric($server_performance ["web_modules_rate"], 2) . - '</span>'; - $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; - } - + + if (isset($server_performance ["total_plugin_modules"])) { $tdata = array(); - $tdata[0] = '<hr style="border: 0; height: 1px; background: #DDD">'; - $table_srv->colspan[count($table_srv->data)][0] = 4; - $table_srv->rowclass[] = ''; - $table_srv->data[] = $tdata; + $tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_plugin_modules"]) . '</span>'; + $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["plugin_modules_rate"], 2) . '</span>'; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; - switch ($config["dbtype"]) { - case "mysql": - $system_events = db_get_value_sql( - 'SELECT SQL_NO_CACHE COUNT(id_evento) - FROM tevento'); - break; - case "postgresql": - case "oracle": - $system_events = db_get_value_sql( - 'SELECT COUNT(id_evento) - FROM tevento'); - break; - } - - - - $tdata = array(); - $tdata[0] = html_print_image('images/lightning_go.png', true, - array('title' => __('Total events'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . - format_numeric($system_events) . '</span>'; - - /* Hello there! :) -We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( -You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. -*/ - - if($system_events > 50000 && !enterprise_installed()){ - $tdata[2] = "<div id='monitoreventsmodal' class='publienterprise' title='Community version' style='text-align:left'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; - } - - else{ - $tdata[3] = " "; - } - $table_srv->colspan[count($table_srv->data)][1] = 2; $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; } + if (isset($server_performance ["total_prediction_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_prediction_modules"]) . '</span>'; + + $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["prediction_modules_rate"], 2) . '</span>'; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_wmi_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_wmi_modules"]) . '</span>'; + + $tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["wmi_modules_rate"], 2) . '</span>'; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + if (isset($server_performance ["total_web_modules"])) { + $tdata = array(); + $tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . + format_numeric($server_performance ["total_web_modules"]) . + '</span>'; + + $tdata[2] = '<span class="med_data">' . + format_numeric($server_performance ["web_modules_rate"], 2) . + '</span>'; + $tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>'; + + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + } + + $tdata = array(); + $tdata[0] = '<hr style="border: 0; height: 1px; background: #DDD">'; + $table_srv->colspan[count($table_srv->data)][0] = 4; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + + $system_events = db_get_value_sql( + 'SELECT SQL_NO_CACHE COUNT(id_evento) + FROM tevento + WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - ' . SECONDS_1DAY . ')' + ); + + $tdata = array(); + $tdata[0] = html_print_image('images/lightning_go.png', true, + array('title' => __('Total events'), 'width' => '25px')); + $tdata[1] = '<span class="big_data">' . + format_numeric($system_events) . '</span>'; + + /* Hello there! :) +We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( +You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. +*/ + + if($system_events > 50000 && !enterprise_installed()){ + $tdata[2] = "<div id='monitoreventsmodal' class='publienterprise' title='Community version' style='text-align:left'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; + } else { + $tdata[3] = " "; + } + $table_srv->colspan[count($table_srv->data)][1] = 2; + $table_srv->rowclass[] = ''; + $table_srv->data[] = $tdata; + $output = '<fieldset class="databox tactical_set"> <legend>' . __('Server performance') . diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index dd2472d7bc..657988661f 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -163,7 +163,7 @@ $table->rowclass[] = ''; // Server performance // --------------------------------------------------------------------- if ($is_admin) { - $table->data[4][0] = reporting_get_stats_servers(false); + $table->data[4][0] = reporting_get_stats_servers(); $table->rowclass[] = ''; } @@ -183,6 +183,7 @@ if (check_acl($config['id_user'],0,'ER')) { if (!empty($tags_condition)) { $event_filter .= " AND ($tags_condition)"; } + $event_filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; $events = events_print_event_table ($event_filter, 10, "100%",true,false,true); ui_toggle($events, __('Latest events'),false,false); } @@ -200,13 +201,13 @@ $out = '<table cellpadding=0 cellspacing=0 class="databox pies" style="margin-t <legend>' . __('Event graph') . '</legend>' . - grafico_eventos_total("", 280, 150, false) . '</fieldset>'; + grafico_eventos_total("", 280, 150, false, true) . '</fieldset>'; $out .="</td><td>"; $out .= '<fieldset class="databox tactical_set"> <legend>' . __('Event graph by agent') . '</legend>' . - grafico_eventos_grupo(280, 150, "", false, false, false) . '</fieldset>'; + grafico_eventos_grupo(280, 150, "", false, true) . '</fieldset>'; $out .= '</td></tr></table>'; echo $out; From 23fa30a514a51f5f193b09f4ca4100f7eacd3444 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Mon, 15 Oct 2018 16:59:39 +0200 Subject: [PATCH 45/66] Increased the character limit in Warning / Critical status string type when creating Network component --- .../godmode/modules/manage_network_components_form_common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 152369943c..eaeae908cb 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -125,7 +125,7 @@ $table->data[4][1] .= html_print_input_text ('max_warning', $max_warning, '', 5, 15, true) . '</span>'; $table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em> '; $table->data[4][1] .= html_print_input_text ('str_warning', $str_warning, - '', 5, 15, true) . '</span>'; + '', 5, 64, true) . '</span>'; $table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>'; $table->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true); @@ -142,7 +142,7 @@ $table->data[5][1] .= html_print_input_text ('max_critical', $max_critical, '', 5, 15, true) . '</span>'; $table->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').' </em> '; $table->data[5][1] .= html_print_input_text ('str_critical', $str_critical, - '', 5, 15, true) . '</span>'; + '', 5, 64, true) . '</span>'; $table->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>'; $table->data[5][1] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true); From 7a44f9dcddddf2faae986908508bb83435d0b199 Mon Sep 17 00:00:00 2001 From: fbsanchez <fborja.sanchez@artica.es> Date: Wed, 17 Oct 2018 13:26:41 +0200 Subject: [PATCH 46/66] Minor fix in cde cluster api methods --- pandora_console/include/functions_api.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index b71306456e..674c672616 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11306,6 +11306,7 @@ function api_get_cluster_status($id_cluster, $trash1, $trash2, $returnType) { if ($value === false) { returnError('id_not_found', $returnType); + return; } $data = array('type' => 'string', 'data' => $value); @@ -11323,6 +11324,7 @@ function api_get_cluster_id_by_name($cluster_name, $trash1, $trash2, $returnType $value = cluster_get_id_by_name($cluster_name); if(($value === false) || ($value === null)){ returnError('id_not_found', $returnType); + return; } $cluster_group = clusters_get_group($value); From aa0c4b41e7aa88dc601f1b1c8f10f924021e28cc Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Wed, 17 Oct 2018 13:31:14 +0200 Subject: [PATCH 47/66] Fixed bug in the data collection of network component when creating its corresponding module --- .../godmode/agentes/module_manager_editor.php | 5 +++++ .../include/javascript/pandora_modules.js | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 1bf189c660..f9347c8b9b 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -34,6 +34,11 @@ if (is_ajax ()) { // Decrypt passwords in the component. $component['plugin_pass'] = io_output_password($component['plugin_pass']); + + $component['str_warning'] = io_safe_output($component['str_warning']); + $component['str_critical'] = io_safe_output($component['str_critical']); + $component['warning_inverse'] = (bool)$component['warning_inverse']; + $component['critical_inverse'] = (bool)$component['critical_inverse']; echo io_json_mb_encode ($component); return; diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index f31ebb56d6..459776c5b2 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -91,8 +91,8 @@ function configure_modules_form () { $("#text-ff_event").attr ("value", 0); $("#text-post_process").attr("value", 0); $("#text-unit").attr("value", ''); - $("#text-critical_inverse").attr ("value", 0); - $("#text-warning_inverse").attr ("value", 0); + $("#checkbox-critical_inverse").attr ("value", 0); + $("#checkbox-warning_inverse").attr ("value", 0); $("#textarea_critical_instructions").attr ("value", ''); $("#textarea_warning_instructions").attr ("value", ''); $("#textarea_unknown_instructions").attr ("value", ''); @@ -138,8 +138,8 @@ function configure_modules_form () { $("#checkbox-history_data").check (); else $("#checkbox-history_data").uncheck (); - - $("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]); + + $("#dynamic_interval_select").val (data["dynamic_interval"]); $("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]); $("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]); @@ -157,8 +157,8 @@ function configure_modules_form () { $("#text-ff_event").attr ("value", (data["min_ff_event"] == 0) ? 0 : data["min_ff_event"]); $("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]); $("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]) - $("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]); - $("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]); + $("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]); + $("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]); $("#component_loading").hide (); $("#id_module_type").change (); if ($("#id_category").is("select")) { @@ -300,7 +300,7 @@ function configure_modules_form () { else $("#checkbox-history_data").uncheck (); - $("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]); + $("#dynamic_interval_select").val (data["dynamic_interval"]); $("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]); $("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]); @@ -322,8 +322,8 @@ function configure_modules_form () { $("#text-ff_event_critical").attr ("value", (data["min_ff_event_critical"] == 0) ? 0 : data["min_ff_event_critical"]); $("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]); $("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]); - $("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]); - $("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]); + $("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]); + $("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]); $("#component_loading").hide (); $("#id_module_type").change (); if ($("#id_category").is("select")) { From e7663fc5f0b8e98d3fe3aa87b7dd3c2f340cab2b Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Wed, 17 Oct 2018 19:20:22 +0200 Subject: [PATCH 48/66] Fixed booleans realtime graphs --- pandora_console/extensions/realtime_graphs/ajax.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/extensions/realtime_graphs/ajax.php b/pandora_console/extensions/realtime_graphs/ajax.php index 7c3eb0c3b5..caea2bda86 100644 --- a/pandora_console/extensions/realtime_graphs/ajax.php +++ b/pandora_console/extensions/realtime_graphs/ajax.php @@ -77,6 +77,15 @@ switch($graph) { if (count($data_array) > 1) { $data = $data_array[1]; } + // Redefine boolean data + switch ($data) { + case "up(1)": + $data = 1; + break; + case "down(0)": + $data = 0; + break; + } } } break; From cde7e011a5ccb3b3e24d18705640ecbeaf0cd1eb Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Thu, 18 Oct 2018 18:01:36 +0200 Subject: [PATCH 49/66] Fixed module_crontab in windows agent on minutes wildcard --- pandora_agents/win32/misc/cron.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/win32/misc/cron.cc b/pandora_agents/win32/misc/cron.cc index d712c2685c..2d3e5e0440 100644 --- a/pandora_agents/win32/misc/cron.cc +++ b/pandora_agents/win32/misc/cron.cc @@ -227,7 +227,7 @@ int Cron::getResetValue (int position) { * @return false if should not execute */ bool Cron::shouldExecuteAt (time_t date) { - return this->utimestamp < date; + return this->utimestamp <= date; } /** From 40ceec6561763acce9b57d1edba58c06de837b24 Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Thu, 18 Oct 2018 18:45:11 +0200 Subject: [PATCH 50/66] Fixed macro _agent_adress_ on events responses --- pandora_console/include/functions_events.php | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 39c5fa59ae..3d5e1d6c95 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1863,15 +1863,20 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor // Substitute each macro if (strpos($target, '_agent_address_') !== false) { if ($meta) { - $server = metaconsole_get_connection_by_id ($server_id); - metaconsole_connect($server); - } - - $target = str_replace('_agent_address_', $event['id_agente'], $target); - - if($meta) { - metaconsole_restore_db_force(); + $agente_table_name = 'tmetaconsole_agent'; + $filter = array( + 'id_tagente' => $event['id_agente'], + 'id_metaconsole_setup' => $server_id + ); + } else { + $agente_table_name = 'tagente'; + $filter = array('id_agente' => $event['id_agente']); } + + $ip = db_get_value_filter('direccion', $agente_table_name, $filter); + // If agent has not an ip, display N/A + if ($ip === false) $ip = __('N/A'); + $target = str_replace('_agent_address_', $ip, $target); } if (strpos($target, '_agent_id_') !== false) { $target = str_replace('_agent_id_', $event['id_agente'], $target); From 4d3c74ed3736e20d761b7181cf2f7ecb55beb60c Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Thu, 18 Oct 2018 19:20:37 +0200 Subject: [PATCH 51/66] Minor typo fix in events responses --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 3d5e1d6c95..ef6518b735 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1866,7 +1866,7 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor $agente_table_name = 'tmetaconsole_agent'; $filter = array( 'id_tagente' => $event['id_agente'], - 'id_metaconsole_setup' => $server_id + 'id_tmetaconsole_setup' => $server_id ); } else { $agente_table_name = 'tagente'; From 972f4b1e89cb6f8ffddac1e0f84c60f1f199eeea Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Fri, 19 Oct 2018 14:03:15 +0200 Subject: [PATCH 52/66] Added unit in label graphs --- pandora_console/include/functions.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index e2c5c742a3..b0d6076475 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3128,16 +3128,23 @@ function series_type_graph_array($data, $show_elements_graph){ if (isset($show_elements_graph['labels']) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0)){ - $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']] . ' ' ; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; } else{ if(strpos($key, 'baseline') !== false){ - $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . - $value['module_name'] . ' Baseline '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .'Baseline '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . 'Baseline '; } else{ - $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . - $value['module_name'] . ': '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; } } @@ -3173,6 +3180,11 @@ function series_type_graph_array($data, $show_elements_graph){ !$show_elements_graph['fullscale'] && strpos($key, 'max') !== false){ $data_return['series_type'][$key] = $type_graph; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; + $data_return['legend'][$key] = $name_legend; if($show_elements_graph['type_mode_graph']){ $data_return['legend'][$key] .= @@ -3234,6 +3246,10 @@ function series_type_graph_array($data, $show_elements_graph){ __('Percentil') . ' ' . $config['percentil'] . 'º ' . __('of module') . ' '; + if ($show_elements_graph['unit']) + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': '; + else + $name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': '; $data_return['legend'][$key] .= $name_legend; $data_return['legend'][$key] .= remove_right_zeros( number_format( From f899910dd0a888b0a9e3593b709305d38b57fcac Mon Sep 17 00:00:00 2001 From: artica <git@artica.es> Date: Mon, 22 Oct 2018 09:45:06 +0200 Subject: [PATCH 53/66] 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/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.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 +- 49 files changed, 56 insertions(+), 56 deletions(-) diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 520eaff838..c4c9d8e42e 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.727, AIX version +# Version 7.0NG.728, 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 c81ad7428b..53b7e5ed5d 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.727, FreeBSD Version +# Version 7.0NG.728, 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 50fc5ba4be..f12d0518f2 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.727, HP-UX Version +# Version 7.0NG.728, 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 82830cf957..9c36a4211c 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.727, GNU/Linux +# Version 7.0NG.728, 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 ea633488e4..5870e5283a 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.727, GNU/Linux +# Version 7.0NG.728, 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 c8a2153376..e6e468401e 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.727, Solaris Version +# Version 7.0NG.728, 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 6a01d22b4b..e1feeacc4e 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.727 +# Version 7.0NG.728 # 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 27cbee7dfb..8d9e405b99 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.727, AIX version +# Version 7.0NG.728, 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 6eaf0415c2..f428ddf5e1 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.727 +# Version 7.0NG.728 # 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 906269e8bb..6f1eded2ef 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.727, HPUX Version +# Version 7.0NG.728, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index b2cdc0e920..26b099a519 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.727 +# Version 7.0NG.728 # 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 82363fdb43..4f23ce219e 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.727 +# Version 7.0NG.728 # 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 2b4f58566b..8f272695ac 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.727 +# Version 7.0NG.728 # 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 a1c4130f17..cce42277f7 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.727, Solaris version +# Version 7.0NG.728, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 0d640badaa..476c53874f 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.727, AIX version +# Version 7.0NG.728, 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 3640efdea4..067701ee68 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-181022 +Version: 7.0NG.728 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 17c585dc0d..9308d53abd 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.727-181022" +pandora_version="7.0NG.728" 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/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 53dd20cf4f..ac53da9443 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, GNU/Linux +# Version 7.0NG.728, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 3590ee6551..12f0f7d805 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, FreeBSD Version +# Version 7.0NG.728, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index aa1dcb1592..3339e5443d 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, HP-UX Version +# Version 7.0NG.728, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index fc55d1d872..58fb118e99 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, GNU/Linux +# Version 7.0NG.728, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 7a47602abc..a47ae7137b 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, GNU/Linux +# Version 7.0NG.728, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index 42d8c19a25..701ee400e7 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, NetBSD Version +# Version 7.0NG.728, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index 625bc89848..95152aadf3 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.727, Solaris Version +# Version 7.0NG.728, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f24407df38..31b4e98917 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.727'; +use constant AGENT_VERSION => '7.0NG.728'; use constant AGENT_BUILD => '181022'; # Agent log default file size maximum and instances diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 268d4809be..c6910f7035 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 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 46c6ca011d..46a0503c4a 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 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 77c8ca8552..adc8565c50 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,7 +9,7 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.727" +PI_VERSION="7.0NG.728" PI_BUILD="181022" OS_NAME=`uname -s` diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 0901ac5234..bb4d1a6923 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.727 +# Version 7.0NG.728 # 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/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 31e08f7921..44b5fec507 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.727} +{Pandora FMS Windows Agent v7.0NG.728} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-<%Version%>-Setup<%Ext%>} +{<%AppName%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 433930f10f..f78d8b18de 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.727(Build 181022)") +#define PANDORA_VERSION ("7.0NG.728(Build 181022)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f1986cb8e2..27b49dfeb4 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.727(Build 181022))" + VALUE "ProductVersion", "(7.0NG.728(Build 181022))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 17b6956d8a..08701d134d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-181022 +Version: 7.0NG.728 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 c381d332fe..f4954e7371 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.727-181022" +pandora_version="7.0NG.728" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b2847711bf..c46b31a2fe 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -23,7 +23,7 @@ * Pandora build version and version */ $build_version = 'PC181022'; -$pandora_version = 'v7.0NG.727'; +$pandora_version = 'v7.0NG.728'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/install.php b/pandora_console/install.php index dff7da228d..d5e3fcb10b 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -70,7 +70,7 @@ <body> <div style='height: 10px'> <?php -$version = '7.0NG.727'; +$version = '7.0NG.728'; $build = '181022'; $banner = "v$version Build $build"; diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 291108fdb4..26d982c469 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -2,8 +2,8 @@ # Pandora FMS Console # %define name pandorafms_console -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 208985638d..6ac2b82f27 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -2,8 +2,8 @@ # Pandora FMS Console # %define name pandorafms_console -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandora_console_install b/pandora_console/pandora_console_install index 8e48a00720..3cbd12d4c0 100644 --- a/pandora_console/pandora_console_install +++ b/pandora_console/pandora_console_install @@ -9,7 +9,7 @@ # This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.727" +PI_VERSION="7.0NG.728" FORCE=0 DESTDIR="" LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index f538d8f6d0..14f1972ee0 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.727-181022 +Version: 7.0NG.728 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 5168b06ab8..ddad6b5b20 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.727-181022" +pandora_version="7.0NG.728" package_cpan=0 package_pandora=1 diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 53490bdf11..4e290ffb9f 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -1,7 +1,7 @@ ############################################################################# # Pandora FMS Server Parameters # Pandora FMS, the Flexible Monitoring System. -# Version 7.0NG.727 +# Version 7.0NG.728 # Licensed under GPL license v2, # (c) 2003-2017 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 10ec0edd0b..1e17b4addf 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -44,7 +44,7 @@ our @EXPORT = qw( ); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.727"; +my $pandora_version = "7.0NG.728"; my $pandora_build = "181022"; our $VERSION = $pandora_version." ".$pandora_build; diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 154667a074..4f337c5b54 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -31,7 +31,7 @@ use base 'Exporter'; our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only -my $pandora_version = "7.0NG.727"; +my $pandora_version = "7.0NG.728"; my $pandora_build = "181022"; our $VERSION = $pandora_version." ".$pandora_build; diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7106197766..ef87be4523 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6f9b86f920..d1f8c79c34 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -2,8 +2,8 @@ # Pandora FMS Server # %define name pandorafms_server -%define version 7.0NG.727 -%define release 181022 +%define version 7.0NG.728 +%define release 1 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 186b24925d..3f8bd8160b 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -8,7 +8,7 @@ # This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.727" +PI_VERSION="7.0NG.728" PI_BUILD="181022" MODE=$1 diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 783c9511fc..219bf3a618 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS181022"; +my $version = "7.0NG.728 PS181022"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index affef12e51..540a13532f 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS181022"; +my $version = "7.0NG.728 PS181022"; # save program name for logging my $progname = basename($0); From aaa2c6aa10dd3377284ed5e2d21b30adfb8d9bc4 Mon Sep 17 00:00:00 2001 From: alejandro-campos <alejandro.campos@artica.es> Date: Mon, 22 Oct 2018 10:31:10 +0200 Subject: [PATCH 54/66] fixed bug: calling api method create event not inserting agent name --- pandora_console/include/functions_api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index b71306456e..b44c038ae4 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9523,8 +9523,11 @@ function api_set_create_event($id, $trash1, $other, $returnType) { return; } $id_agent = $agent_cache['id_tagente']; + } + $values['id_agente'] = $id_agent; + if (!util_api_check_agent_and_print_error($id_agent, 'string', 'AR')) { if (is_metaconsole()) metaconsole_restore_db(); return; From 9a77256198434137f8a3810ac4945efb007852dc Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Tue, 23 Oct 2018 00:01:29 +0200 Subject: [PATCH 55/66] 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 | 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 | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 067701ee68..55a22a44fa 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.728 +Version: 7.0NG.728-181023 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 9308d53abd..5a2813e0e3 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.728" +pandora_version="7.0NG.728-181023" 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 31b4e98917..a678058f3c 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.728'; -use constant AGENT_BUILD => '181022'; +use constant AGENT_BUILD => '181023'; # 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 c6910f7035..4a40015f3f 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.728 -%define release 1 +%define release 181023 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 46a0503c4a..3faff7098a 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.728 -%define release 1 +%define release 181023 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 adc8565c50..81f2c20d2c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181022" +PI_BUILD="181023" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 44b5fec507..7a9c32c038 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181022} +{181023} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-Setup<%Ext%>} +{<%AppName%>-<%Version%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f78d8b18de..92ed21929d 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.728(Build 181022)") +#define PANDORA_VERSION ("7.0NG.728(Build 181023)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 27b49dfeb4..04def502c0 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.728(Build 181022))" + VALUE "ProductVersion", "(7.0NG.728(Build 181023))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 08701d134d..97b5721572 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.728 +Version: 7.0NG.728-181023 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 f4954e7371..5c70c21920 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.728" +pandora_version="7.0NG.728-181023" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index c46b31a2fe..a1e79940f0 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC181022'; +$build_version = 'PC181023'; $pandora_version = 'v7.0NG.728'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d5e3fcb10b..932dad5d1f 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.728'; -$build = '181022'; +$build = '181023'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 26d982c469..1c54c0e15d 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 1 +%define release 181023 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 6ac2b82f27..8d9d4d44e5 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 1 +%define release 181023 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 14f1972ee0..c3d2fc9db2 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.728 +Version: 7.0NG.728-181023 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index ddad6b5b20..6b78fc8e1a 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.728" +pandora_version="7.0NG.728-181023" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 1e17b4addf..7f7346465c 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181022"; +my $pandora_build = "181023"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 4f337c5b54..e5eb08afa7 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,7 +32,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181022"; +my $pandora_build = "181023"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index ef87be4523..57699f99dd 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.728 -%define release 1 +%define release 181023 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index d1f8c79c34..3a748acddd 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.728 -%define release 1 +%define release 181023 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3f8bd8160b..49d861a34f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181022" +PI_BUILD="181023" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 219bf3a618..d830fa2fff 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.728 PS181022"; +my $version = "7.0NG.728 PS181023"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 540a13532f..1a3c9ed955 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.728 PS181022"; +my $version = "7.0NG.728 PS181023"; # save program name for logging my $progname = basename($0); From 2af6108b66e19fc293f4813499336a1b7665099a Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Tue, 23 Oct 2018 12:29:23 +0200 Subject: [PATCH 56/66] Removed dashboard menu if it is displayed from main page --- pandora_console/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/index.php b/pandora_console/index.php index c1f55dd120..f83ebc175a 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1058,6 +1058,7 @@ else { $_GET['sec2'] = 'general/logon_ok'; break; case 'Dashboard': + $dashboard_from_main_page = 1; $id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url); $str = 'sec=reporting&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; parse_str($str, $res); From f10a661cd66c1a9ad76cde44bdf9d519e3651fe7 Mon Sep 17 00:00:00 2001 From: danielmaya <daniel.maya@artica.es> Date: Tue, 23 Oct 2018 12:36:20 +0200 Subject: [PATCH 57/66] Fixed group and set_center --- .../include/javascript/functions_pandora_networkmap.js | 9 +++++---- .../operation/agentes/pandora_networkmap.editor.php | 5 ++--- .../operation/agentes/pandora_networkmap.view.php | 9 ++++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 83418f97c1..3a8f29d6c0 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -87,15 +87,16 @@ function inner_minimap_box(param_x, param_y) { return false; } -function set_center(id) { - pos_x = (width_svg / 2) - translation[0]; - pos_y = (height_svg / 2) - translation[1]; +function set_center(id, event) { + pos_x = (width_svg / 2) - (translation[0] / scale); + pos_y = (height_svg / 2) - (translation[1] / scale); var params = []; params.push("set_center=1"); params.push("id=" + id); params.push("x=" + pos_x); params.push("y=" + pos_y); + params.push("scale=" + scale); params.push("page=operation/agentes/pandora_networkmap.view"); jQuery.ajax({ data: params.join("&"), @@ -2720,7 +2721,7 @@ function init_graph(parameter_object) { } window.scale_minimap = 4.2; window.translation = [0, 0]; - window.scale = 0.5; + window.scale = (typeof (z_dash) != "undefined") ? z_dash : 0.5; window.node_radius = 40; if (typeof (parameter_object.node_radius) != "undefined") { window.node_radius = parameter_object.node_radius; diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index a5c5acc1ec..6163c47f8f 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -221,11 +221,10 @@ else { $table->data[0][0] = __('Name'); $table->data[0][1] = html_print_input_text ('name', $name, '', 30, 100,true); - $table->data[1][0] = __('Group'); - + $table->data[1][0] = __('Group'); $table->data[1][1] = html_print_select_groups($config['id_user'], "AR", - true, 'id_group', $idGroup, '', '', '', true); + true, 'id_group', $id_group, '', '', '', true); $table->data[2][0] = __('Node radius'); $table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2, diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 738f9ed5df..d1916ea741 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -511,9 +511,16 @@ if (is_ajax ()) { $id = (int)get_parameter('id', 0); $x = (int)get_parameter('x', 0); $y = (int)get_parameter('y', 0); + $scale = (float)get_parameter('scale', 0); $networkmap = db_get_row('tmap', 'id', $id); + $array_filter = json_decode($networkmap['filter']); + if (isset($array_filter->z_dash)) { + $array_filter->z_dash = number_format($scale,2); + } + $filter = json_encode($array_filter); + // ACL for the network map // $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR"); $networkmap_write = check_acl ($config['id_user'], $networkmap['id_group'], "MW"); @@ -529,7 +536,7 @@ if (is_ajax ()) { $networkmap['center_x'] = $x; $networkmap['center_y'] = $y; db_process_sql_update('tmap', - array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']), + array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y'], 'filter' => $filter), array('id' => $id)); $return = array(); From a1f28480aedc75d94bb5bf7385a4e6351396f356 Mon Sep 17 00:00:00 2001 From: danielmaya <daniel.maya@artica.es> Date: Tue, 23 Oct 2018 15:46:48 +0200 Subject: [PATCH 58/66] Fixed force_type check in delete/edit modules in bulk --- pandora_console/godmode/massive/massive_delete_modules.php | 2 +- pandora_console/godmode/massive/massive_edit_modules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 8725c713aa..047eb08b75 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -274,7 +274,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types, 'module_type', '' 'width:100%'); $table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' . html_print_checkbox_extended("force_type", 'type', '', '', false, - '', 'style="margin-right: 40px;"', true); + 'style="margin-right: 40px;"', true, ''); $modules = array (); if ($module_type != '') { diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index a7056636b0..949d13269a 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -271,7 +271,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types, $table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' . html_print_checkbox_extended ("force_type", 'type', '', '', false, - '', 'style="margin-right: 40px;"', true); + 'style="margin-right: 40px;"', true, ''); $modules = array (); if ($module_type != '') { From 8cb2ff1d1b34534bce63492c6882142257d84776 Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Tue, 23 Oct 2018 17:41:14 +0200 Subject: [PATCH 59/66] Fixed tactical view graph on mobile metaconsole --- pandora_console/include/functions_graph.php | 9 ++++++++- pandora_console/mobile/operation/tactical.php | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 4bb4a26b47..863dc4b15f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2194,19 +2194,26 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re if ($data_agents == false) { $groups = implode(',', array_keys(users_get_groups(false, 'AR', false))); + $p_table = "tagente"; + $s_table = "tagent_secondary_group"; + if (is_metaconsole()) { + $p_table = "tmetaconsole_agent"; + $s_table = "tmetaconsole_agent_secondary_group"; + } $data = db_get_row_sql(sprintf('SELECT SUM(critical_count) AS Critical, SUM(warning_count) AS Warning, SUM(normal_count) AS Normal, SUM(unknown_count) AS Unknown %s - FROM tagente ta LEFT JOIN tagent_secondary_group tasg + FROM %s ta LEFT JOIN %s tasg ON ta.id_agente = tasg.id_agent WHERE ta.disabled = 0 AND %s (ta.id_grupo IN (%s) OR tasg.id_group IN (%s))', $show_not_init ? ', SUM(notinit_count) "Not init"' : '', + $p_table, $s_table, empty($id_agent) ? '' : "ta.id_agente = $id_agent AND", $groups, $groups diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index e3a9cf2665..c62de4d035 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -28,6 +28,7 @@ class Tactical { else { $this->correct_acl = false; } + include_javascript_dependencies_flot_graph(); } public function show() { From 4cb66c31f13e1cb2a5b3d410746e3527218bfba8 Mon Sep 17 00:00:00 2001 From: fermin831 <fermin.hernandez@artica.es> Date: Tue, 23 Oct 2018 17:43:00 +0200 Subject: [PATCH 60/66] Fixed logo image on metaconsole login --- pandora_console/mobile/include/user.class.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pandora_console/mobile/include/user.class.php b/pandora_console/mobile/include/user.class.php index 735e20c1c4..41278f2ad5 100644 --- a/pandora_console/mobile/include/user.class.php +++ b/pandora_console/mobile/include/user.class.php @@ -228,12 +228,8 @@ class User { $ui->showFooter(false); $ui->beginContent(); - if ($system->getConfig('metaconsole')) - $logo_image = html_print_image (ui_get_mobile_login_icon(), - true, array ("alt" => "logo", "border" => 0)); - else - $logo_image = html_print_image (ui_get_mobile_login_icon(), - true, array ("alt" => "logo", "border" => 0),false, false, false, true); + $logo_image = html_print_image (ui_get_mobile_login_icon(), + true, array ("alt" => "logo", "border" => 0), false, false, false, true); $ui->contentAddHtml('<div style="text-align: center;" class="login_logo">' . $logo_image . '</div>'); @@ -292,7 +288,7 @@ class User { $ui->beginContent(); $ui->contentAddHtml('<div style="text-align: center;" class="login_logo">' . html_print_image (ui_get_mobile_login_icon(), - true, array ("alt" => "logo", "border" => 0)) . + true, array ("alt" => "logo", "border" => 0), false, false, false, true) . '</div>'); $ui->contentAddHtml('<div id="login_container">'); $ui->beginForm(); From 7a64bb48557e5ef5ba5cef46f58c70b62f2fa73b Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Wed, 24 Oct 2018 00:01:28 +0200 Subject: [PATCH 61/66] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 55a22a44fa..67ad3d58e1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.728-181023 +Version: 7.0NG.728-181024 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 5a2813e0e3..7defae7622 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.728-181023" +pandora_version="7.0NG.728-181024" 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 a678058f3c..ac36ea0884 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.728'; -use constant AGENT_BUILD => '181023'; +use constant AGENT_BUILD => '181024'; # 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 4a40015f3f..69ec3bd242 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.728 -%define release 181023 +%define release 181024 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 3faff7098a..daeda44a30 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.728 -%define release 181023 +%define release 181024 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 81f2c20d2c..e4f2ad4c67 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181023" +PI_BUILD="181024" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7a9c32c038..67f834889a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181023} +{181024} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 92ed21929d..2e1b21d093 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.728(Build 181023)") +#define PANDORA_VERSION ("7.0NG.728(Build 181024)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 04def502c0..36422c8d4c 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.728(Build 181023))" + VALUE "ProductVersion", "(7.0NG.728(Build 181024))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 97b5721572..8c56084f66 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.728-181023 +Version: 7.0NG.728-181024 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 5c70c21920..093d039143 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.728-181023" +pandora_version="7.0NG.728-181024" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a1e79940f0..ce1ee5f99a 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC181023'; +$build_version = 'PC181024'; $pandora_version = 'v7.0NG.728'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 932dad5d1f..d7c4bc7137 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.728'; -$build = '181023'; +$build = '181024'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 1c54c0e15d..b0805973a8 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 181023 +%define release 181024 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index 8d9d4d44e5..c62c9f721f 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 181023 +%define release 181024 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index c3d2fc9db2..2bc1dfc2e2 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.728-181023 +Version: 7.0NG.728-181024 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 6b78fc8e1a..87a592aa0c 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.728-181023" +pandora_version="7.0NG.728-181024" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 7f7346465c..09d6c9797a 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181023"; +my $pandora_build = "181024"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index e5eb08afa7..5ae9ff63eb 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,7 +32,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181023"; +my $pandora_build = "181024"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 57699f99dd..3b3be9dfca 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.728 -%define release 181023 +%define release 181024 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3a748acddd..e0ea65606f 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.728 -%define release 181023 +%define release 181024 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 49d861a34f..76aa979961 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181023" +PI_BUILD="181024" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d830fa2fff..1bb18941b1 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.728 PS181023"; +my $version = "7.0NG.728 PS181024"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1a3c9ed955..c4882e8807 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.728 PS181023"; +my $version = "7.0NG.728 PS181024"; # save program name for logging my $progname = basename($0); From f4add9a7f89c2c87ca85cb724422913f1f7ed5be Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Wed, 24 Oct 2018 11:49:18 +0200 Subject: [PATCH 62/66] Changed tlayout_template name table to varchar 600 --- pandora_console/extras/mr/21.sql | 2 ++ pandora_console/pandoradb.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/mr/21.sql b/pandora_console/extras/mr/21.sql index f832a0ed8a..55ee2b889c 100644 --- a/pandora_console/extras/mr/21.sql +++ b/pandora_console/extras/mr/21.sql @@ -13,4 +13,6 @@ ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbhost` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbport` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbname` text; +ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; + COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 8d2b64cfee..945f79a1c6 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3294,7 +3294,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, + `name` varchar(600) NOT NULL, `id_group` INTEGER UNSIGNED NOT NULL, `background` varchar(200) NOT NULL, `height` INTEGER UNSIGNED NOT NULL default 0, From 9d7f063ef22d6a3bca09326f9bdda35aa4d2d0de Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Wed, 24 Oct 2018 12:39:58 +0200 Subject: [PATCH 63/66] Changed tlayout_template name table to varchar 600 --- pandora_console/extras/mr/21.sql | 2 -- pandora_console/extras/mr/22.sql | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 pandora_console/extras/mr/22.sql diff --git a/pandora_console/extras/mr/21.sql b/pandora_console/extras/mr/21.sql index 55ee2b889c..f832a0ed8a 100644 --- a/pandora_console/extras/mr/21.sql +++ b/pandora_console/extras/mr/21.sql @@ -13,6 +13,4 @@ ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbhost` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbport` text; ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbname` text; -ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; - COMMIT; diff --git a/pandora_console/extras/mr/22.sql b/pandora_console/extras/mr/22.sql new file mode 100644 index 0000000000..cee9b45ede --- /dev/null +++ b/pandora_console/extras/mr/22.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; + +COMMIT; From 87abf1dc02f8e8644054190fe99112c67046695c Mon Sep 17 00:00:00 2001 From: danielmaya <daniel.maya@artica.es> Date: Wed, 24 Oct 2018 16:36:44 +0200 Subject: [PATCH 64/66] added event time filter in tactical view --- pandora_console/include/ajax/events.php | 36 +++++++++++++++++ pandora_console/include/functions_graph.php | 10 +++-- .../include/functions_reporting.php | 30 +++++++++----- .../operation/agentes/tactical.php | 40 ++++++++++++++++--- 4 files changed, 95 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 070ce03a2a..f50b5b9d87 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -38,6 +38,9 @@ $get_event_name = (bool) get_parameter ('get_event_name'); $meta = get_parameter ('meta', 0); $history = get_parameter ('history', 0); $table_events = get_parameter('table_events', 0); +$total_events = (bool)get_parameter('total_events'); +$total_event_graph = (bool)get_parameter('total_event_graph'); +$graphic_event_group = (bool)get_parameter('graphic_event_group'); if ($get_event_name) { $event_id = get_parameter ('event_id'); @@ -605,4 +608,37 @@ if ($get_list_events_agents) { echo $returned_list; return; } + +if ($total_events) { + global $config; + + $sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento '; + if ($config['event_view_hr']) { + $sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - ' . $config['event_view_hr'] * SECONDS_1HOUR . ')'; + } + + $system_events = db_get_value_sql($sql_count_event); + echo $system_events; + return; +} + +if ($total_event_graph) { + global $config; + + require_once($config["homedir"] . '/include/functions_graph.php'); + + $prueba = grafico_eventos_total("", 280, 150, false, true); + echo $prueba; + return; +} + +if ($graphic_event_group) { + global $config; + + require_once($config["homedir"] . '/include/functions_graph.php'); + + $prueba = grafico_eventos_grupo(280, 150, "", false, true); + echo $prueba; + return; +} ?> diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 0de011beb8..d19ec0719f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2756,8 +2756,10 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $noWater // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); - if ($time_limit) { - $tags_condition .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; + + if ($time_limit && $config['event_view_hr']) { + $tags_condition .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . + $config['event_view_hr'] * SECONDS_1HOUR . ")"; } //This will give the distinct id_agente, give the id_grupo that goes @@ -2835,8 +2837,8 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWat // Add tags condition to filter $tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND'); $filter .= $tags_condition; - if ($time_limit) { - $filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; + if ($time_limit && $config['event_view_hr']) { + $filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")"; } $data = array (); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 015bf1c8bd..b84fef62ef 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -10182,23 +10182,17 @@ function reporting_get_stats_servers() { $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; - $system_events = db_get_value_sql( - 'SELECT SQL_NO_CACHE COUNT(id_evento) - FROM tevento - WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - ' . SECONDS_1DAY . ')' - ); - $tdata = array(); $tdata[0] = html_print_image('images/lightning_go.png', true, array('title' => __('Total events'), 'width' => '25px')); - $tdata[1] = '<span class="big_data">' . - format_numeric($system_events) . '</span>'; + $tdata[1] = '<span class="big_data" id="total_events">' . + html_print_image('images/spinner.gif',true) . '</span>'; /* Hello there! :) We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. */ - + if($system_events > 50000 && !enterprise_installed()){ $tdata[2] = "<div id='monitoreventsmodal' class='publienterprise' title='Community version' style='text-align:left'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>"; } else { @@ -10207,13 +10201,27 @@ You can of course remove the warnings, that's why we include the source and do n $table_srv->colspan[count($table_srv->data)][1] = 2; $table_srv->rowclass[] = ''; $table_srv->data[] = $tdata; - + $output = '<fieldset class="databox tactical_set"> <legend>' . __('Server performance') . '</legend>' . html_print_table($table_srv, true) . '</fieldset>'; - + + $output .= '<script type="text/javascript">'; + $output .= '$(document).ready(function () {'; + $output .= 'var parameters = {};'; + $output .= 'parameters["page"] = "include/ajax/events";'; + $output .= 'parameters["total_events"] = 1;'; + + $output .= '$.ajax({type: "GET",url: "ajax.php",data: parameters,'; + $output .= 'success: function(data) {'; + $output .= '$("#total_events").text(data);'; + $output .= '}'; + $output .= '});'; + $output .= '});'; + $output .= '</script>'; + return $output; } diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 657988661f..635d61c0d2 100755 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -183,7 +183,11 @@ if (check_acl($config['id_user'],0,'ER')) { if (!empty($tags_condition)) { $event_filter .= " AND ($tags_condition)"; } - $event_filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . SECONDS_1DAY . ")"; + + if ($config['event_view_hr']) { + $event_filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")"; + } + $events = events_print_event_table ($event_filter, 10, "100%",true,false,true); ui_toggle($events, __('Latest events'),false,false); } @@ -197,20 +201,44 @@ if ($is_admin) { } $out = '<table cellpadding=0 cellspacing=0 class="databox pies" style="margin-top:15px;" width=100%><tr><td>'; - $out .= '<fieldset class="databox tactical_set"> + $out .= '<fieldset class="databox tactical_set" id="total_event_graph"> <legend>' . __('Event graph') . '</legend>' . - grafico_eventos_total("", 280, 150, false, true) . '</fieldset>'; + html_print_image('images/spinner.gif',true,array('id' => 'spinner_total_event_graph')) . '</fieldset>'; $out .="</td><td>"; - $out .= '<fieldset class="databox tactical_set"> + $out .= '<fieldset class="databox tactical_set" id="graphic_event_group"> <legend>' . __('Event graph by agent') . '</legend>' . - grafico_eventos_grupo(280, 150, "", false, true) . '</fieldset>'; + html_print_image('images/spinner.gif', true, array('id' => 'spinner_graphic_event_group')) . '</fieldset>'; $out .= '</td></tr></table>'; echo $out; echo '</td>'; echo '</tr></table>'; -?> \ No newline at end of file +?> +<script type="text/javascript"> + $(document).ready(function () { + var parameters = {}; + parameters["page"] = "include/ajax/events"; + parameters["total_event_graph"] = 1; + + $.ajax({type: "GET",url: "ajax.php",data: parameters, + success: function(data) { + $("#spinner_total_event_graph").hide(); + $("#total_event_graph").append(data); + } + }); + + delete parameters["total_event_graph"]; + parameters["graphic_event_group"] = 1; + + $.ajax({type: "GET",url: "ajax.php",data: parameters, + success: function(data) { + $("#spinner_graphic_event_group").hide(); + $("#graphic_event_group").append(data); + } + }); + }); +</script> \ No newline at end of file From 2e74cd53f1a8118ab130faab7c05fd04d4181999 Mon Sep 17 00:00:00 2001 From: "manuel.montes" <manuel.montes@artica.es> Date: Wed, 24 Oct 2018 16:50:40 +0200 Subject: [PATCH 65/66] Changed tlayout_template name table to varchar 600 --- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 079c9b5d23..10a93a2e83 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1740,6 +1740,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; + -- --------------------------------------------------------------------- -- Table `tlayout_template_data` -- --------------------------------------------------------------------- From db802c5a2e3cb2ea419d1f046d57d8a3f77c1d9e Mon Sep 17 00:00:00 2001 From: artica <artica.devel@gmail.com> Date: Thu, 25 Oct 2018 00:01:22 +0200 Subject: [PATCH 66/66] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 67ad3d58e1..93d8cf3cbf 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.728-181024 +Version: 7.0NG.728-181025 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 7defae7622..0e6d0fb01e 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.728-181024" +pandora_version="7.0NG.728-181025" 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 ac36ea0884..cc1eb4ee08 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.728'; -use constant AGENT_BUILD => '181024'; +use constant AGENT_BUILD => '181025'; # 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 69ec3bd242..9602ec3f43 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.728 -%define release 181024 +%define release 181025 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 daeda44a30..ff3a6e82b1 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.728 -%define release 181024 +%define release 181025 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 e4f2ad4c67..0317fd779c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181024" +PI_BUILD="181025" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 67f834889a..7019fcf229 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{181024} +{181025} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2e1b21d093..54c6b626f9 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.728(Build 181024)") +#define PANDORA_VERSION ("7.0NG.728(Build 181025)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 36422c8d4c..640dedbb35 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.728(Build 181024))" + VALUE "ProductVersion", "(7.0NG.728(Build 181025))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8c56084f66..86769b7615 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.728-181024 +Version: 7.0NG.728-181025 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 093d039143..f940e5bbb5 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.728-181024" +pandora_version="7.0NG.728-181025" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ce1ee5f99a..add78868c6 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC181024'; +$build_version = 'PC181025'; $pandora_version = 'v7.0NG.728'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d7c4bc7137..de58f942b6 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@ <div style='height: 10px'> <?php $version = '7.0NG.728'; -$build = '181024'; +$build = '181025'; $banner = "v$version Build $build"; error_reporting(0); diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index b0805973a8..5e5dfe9d25 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 181024 +%define release 181025 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index c62c9f721f..92859b880d 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.728 -%define release 181024 +%define release 181025 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 2bc1dfc2e2..aa3510ad96 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.728-181024 +Version: 7.0NG.728-181025 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 87a592aa0c..c740d61ed4 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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.728-181024" +pandora_version="7.0NG.728-181025" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 09d6c9797a..4fd398717e 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181024"; +my $pandora_build = "181025"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 5ae9ff63eb..eae26e2c26 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -32,7 +32,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.728"; -my $pandora_build = "181024"; +my $pandora_build = "181025"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 3b3be9dfca..c85e1340a1 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.728 -%define release 181024 +%define release 181025 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e0ea65606f..8bc7cac0dd 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.728 -%define release 181024 +%define release 181025 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 76aa979961..971809ae7a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.728" -PI_BUILD="181024" +PI_BUILD="181025" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1bb18941b1..6f888c6e1e 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.728 PS181024"; +my $version = "7.0NG.728 PS181025"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c4882e8807..da9776ecf0 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.728 PS181024"; +my $version = "7.0NG.728 PS181025"; # save program name for logging my $progname = basename($0);