From e71bb2a791470ea7bd3940da2593c1741409b4f3 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 27 Aug 2019 16:01:18 +0200 Subject: [PATCH 01/56] Long custom fields urls and text truncated --- pandora_console/include/functions_ui.php | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 008c05b8d7..b9af85318c 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -39,7 +39,7 @@ if (isset($config['homedir'])) { /** - * Transform bbcode to HTML. + * Transform bbcode to HTML and truncate log. * * @param string $text Text. * @param array $allowed_tags Allowed_tags. @@ -48,16 +48,22 @@ if (isset($config['homedir'])) { */ function ui_bbcode_to_html($text, $allowed_tags=['[url]']) { - if (array_search('[url]', $allowed_tags) !== false) { - // If link hasn't http, add it. - if (preg_match('/https?:\/\//', $text)) { - $html_bbcode = '$2'; - } else { - $html_bbcode = '$2'; - } - + if (array_search('[url]', $allowed_tags) !== false || a) { // Replace bbcode format [url=www.example.org] String [/url] with or without http and slashes - $return = preg_replace('/\[url(?|](((?:https?:\/\/)?[^[]+))|(?:=[\'"]?((?:https?:\/\/)?[^]]+?)[\'"]?)](.+?))\[\/url]/', $html_bbcode, $text); + preg_match('/\[url(?|](((?:https?:\/\/)?[^[]+))|(?:=[\'"]?((?:https?:\/\/)?[^]]+?)[\'"]?)](.+?))\[\/url]/', $text, $matches); + if ($matches) { + $url = $matches[1]; + // Truncate text + $t_text = ui_print_truncate_text($matches[2]); + // If link hasn't http, add it. + if (preg_match('/https?:\/\//', $text)) { + $return = ''.$t_text.''; + } else { + $return = ''.$t_text.''; + } + } else { + $return = ui_print_truncate_text($text); + } } return $return; From 3f49988a190149a19f5938a65a94ee86eaeaac65 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 11 Sep 2019 17:57:16 +0200 Subject: [PATCH 02/56] Fixed bug in max, min and avg value in table of reports - #4545 --- .../include/functions_reporting.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 4abf5152c1..82d1f38635 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4876,15 +4876,15 @@ function reporting_value($report, $content, $type, $pdf=false) $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true); $date_reference = getdate(); - for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) { - $value .= ''.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).''; + for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) { + $value .= ''.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).''; if ($i > $time_begin['utimestamp']) { $value .= format_for_graph( reporting_get_agentmodule_data_max( $content['id_agent_module'], $content['lapse'], - $i + ($i + $content['lapse']) ), $config['graph_precision'] ).' '.$unit.''; @@ -4983,15 +4983,15 @@ function reporting_value($report, $content, $type, $pdf=false) $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); $date_reference = getdate(); - for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) { - $value .= ''.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).''; + for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) { + $value .= ''.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).''; if ($i > $time_begin['utimestamp']) { $value .= format_for_graph( reporting_get_agentmodule_data_min( $content['id_agent_module'], $content['lapse'], - $i + ($i + $content['lapse']) ), $config['graph_precision'] ).' '.$unit.''; @@ -5090,15 +5090,15 @@ function reporting_value($report, $content, $type, $pdf=false) $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); $date_reference = getdate(); - for ($i = $date_reference[0]; $i > ($date_reference[0] - $content['period']); $i -= $content['lapse']) { - $value .= ''.date('Y-m-d H:i:s', ($i - $content['lapse'] + 1)).' to '.date('Y-m-d H:i:s', $i).''; + for ($i = ($report['datetime'] - $content['period']); $i < $report['datetime']; $i += $content['lapse']) { + $value .= ''.date('Y-m-d H:i:s', ($i + 1)).' to '.date('Y-m-d H:i:s', (($i + $content['lapse']) )).''; if ($i > $time_begin['utimestamp']) { $value .= format_for_graph( reporting_get_agentmodule_data_average( $content['id_agent_module'], $content['lapse'], - $i + ($i + $content['lapse']) ), $config['graph_precision'] ).' '.$unit.''; From 53850a8c1f04a1165136ece7fbebb84db6b438c3 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 16 Sep 2019 15:51:04 +0200 Subject: [PATCH 03/56] add gis maps to autorefresh list --- pandora_console/operation/users/user_edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index b8b42ad945..1d016fb880 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -462,6 +462,8 @@ $autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail'; $autorefresh_list_out['enterprise/operation/services/services'] = 'Services'; $autorefresh_list_out['enterprise/dashboard/main_dashboard'] = 'Dashboard'; $autorefresh_list_out['operation/reporting/graph_viewer'] = 'Graph Viewer'; +$autorefresh_list_out['operation/gis_maps/render_view'] = 'Gis Map'; + $autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console'; $autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map'; $autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console'; @@ -1150,7 +1152,7 @@ function ehorus_connection_test(host, port) { var user = $('input#text-ehorus_user_level_user').val(); var pass = $('input#password-ehorus_user_level_pass').val(); - debugger; + var badRequestMessage = ''; var notFoundMessage = ''; var invalidPassMessage = ''; From 43eb928aa82420c0d65a2e9f17bc0b19fcd6790a Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 19 Sep 2019 12:59:51 +0200 Subject: [PATCH 04/56] Fixed csv reports download --- .../include/functions_reporting.php | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 3494eed389..b4c4ff2ebb 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4181,6 +4181,7 @@ function reporting_sql_graph( switch ($type) { case 'dinamic': case 'static': + case 'data': $return['chart'] = graph_custom_sql_graph( $content['id_rc'], $width, @@ -4192,9 +4193,6 @@ function reporting_sql_graph( $content['top_n_value'] ); break; - - case 'data': - break; } return reporting_check_structure_content($return); @@ -4394,6 +4392,7 @@ function reporting_netflow( switch ($type) { case 'dinamic': case 'static': + case 'data': $return['chart'] = netflow_draw_item( ($report['datetime'] - $content['period']), $report['datetime'], @@ -7542,8 +7541,26 @@ function reporting_custom_graph( $content['name'] = __('Simple graph'); } + $id_agent = agents_get_module_id( + $content['id_agent_module'] + ); + $id_agent_module = $content['id_agent_module']; + $agent_description = agents_get_description($id_agent); + $agent_group = agents_get_agent_group($id_agent); + $agent_address = agents_get_address($id_agent); + $agent_alias = agents_get_alias($id_agent); + $module_name = modules_get_agentmodule_name( + $id_agent_module + ); + + $module_description = modules_get_agentmodule_descripcion( + $id_agent_module + ); + $return['title'] = $content['name']; $return['subtitle'] = io_safe_output($graph['name']); + $return['agent_name'] = $agent_alias; + $return['module_name'] = $module_name; $return['description'] = $content['description']; $return['date'] = reporting_get_date_text( $report, @@ -7557,6 +7574,7 @@ function reporting_custom_graph( switch ($type) { case 'dinamic': case 'static': + case 'data': $params = [ 'period' => $content['period'], 'width' => $width, From 279b36023656ac484c8530fd6f5c61bffe255d44 Mon Sep 17 00:00:00 2001 From: Kike Date: Fri, 20 Sep 2019 10:13:09 +0200 Subject: [PATCH 05/56] Fixed open and enterprise network map migration --- .../include/functions_networkmap.php | 14 ++++++----- .../agentes/pandora_networkmap.view.php | 24 ------------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index e4fb19e814..dda25538ee 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -2327,7 +2327,13 @@ function migrate_older_open_maps($id) $new_map_filter = []; $new_map_filter['dont_show_subgroups'] = $old_networkmap['dont_show_subgroups']; $new_map_filter['node_radius'] = 40; - $new_map_filter['id_migrate_map'] = $id; + $new_map_filter['x_offs'] = 0; + $new_map_filter['y_offs'] = 0; + $new_map_filter['z_dash'] = '0.5'; + $new_map_filter['node_sep'] = '0.1'; + $new_map_filter['rank_sep'] = 1; + $new_map_filter['mindist'] = 1; + $new_map_filter['kval'] = '0.1'; $map_values['filter'] = json_encode($new_map_filter); $map_values['description'] = 'Mapa open migrado'; @@ -2340,11 +2346,7 @@ function migrate_older_open_maps($id) $map_values['source_period'] = 60; $map_values['source'] = 0; $map_values['source_data'] = $old_networkmap['id_group']; - if ($old_networkmap['type'] == 'radial_dinamic') { - $map_values['generation_method'] = 6; - } else { - $map_values['generation_method'] = 4; - } + $map_values['generation_method'] = 3; $map_values['generated'] = 0; diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 77f3d2c8a5..4a03bc369e 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -702,22 +702,6 @@ if (is_ajax()) { if (!$return) { $return_data['ent'] = false; break; - } else { - $old_networkmap_ent = db_get_row_filter( - 'tnetworkmap_enterprise', - ['id' => $id_ent_map] - ); - - $options = json_decode($old_networkmap_ent, true); - $options['migrated'] = 'migrated'; - - $values['options'] = json_encode($options); - - $return_update = db_process_sql_update('tnetworkmap_enterprise', $values, ['id' => $id_ent_map]); - if (!$return_update) { - $return_data['ent'] = false; - break; - } } } } @@ -732,14 +716,6 @@ if (is_ajax()) { if (!$return) { $return_data['open'] = false; break; - } else { - $values['text_filter'] = 'migrated'; - - $return_update = db_process_sql_update('tnetwork_map', $values, ['id_networkmap' => $id_open_map]); - if (!$return_update) { - $return_data['open'] = false; - break; - } } } } From 63f4f894eb26c2308f0732238cd193c3e247ff6f Mon Sep 17 00:00:00 2001 From: Kike Date: Thu, 26 Sep 2019 09:41:08 +0200 Subject: [PATCH 06/56] Deleted unnecessary "if" statement --- pandora_console/godmode/menu.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 000a105257..9a566a3139 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -381,9 +381,6 @@ if (is_array($config['extensions'])) { if (strlen($extmenu['fatherId']) > 0) { if (array_key_exists('subfatherId', $extmenu)) { if (strlen($extmenu['subfatherId']) > 0) { - if ($extmenu['name'] = 'DB schema check') { - } - $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']); $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = $extmenu['name']; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0; From 8284dfc44fe761a3d695358fd8a696b5f46c505e Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 26 Sep 2019 10:32:36 +0200 Subject: [PATCH 07/56] Removed item agent/modules from templates --- pandora_console/include/functions_reports.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index 0bf1f8fe70..47fd34b885 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -777,13 +777,15 @@ function reports_get_report_types($template=false, $not_editor=false) 'name' => __('Exception'), ]; if ($config['metaconsole'] != 1) { - $types['agent_module'] = [ - 'optgroup' => __('Grouped'), - 'name' => __('Agents/Modules'), - ]; + if (!$template) { + $types['agent_module'] = [ + 'optgroup' => __('Grouped'), + 'name' => __('Agents/Modules'), + ]; + } } - // Only pandora managers have access to the whole database + // Only pandora managers have access to the whole database. if (check_acl($config['id_user'], 0, 'PM')) { $types['sql'] = [ 'optgroup' => __('Grouped'), From a15350b7cb7b5de5839551ea45188c489b0661a1 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 26 Sep 2019 12:36:08 +0200 Subject: [PATCH 08/56] deleted calls to a function that does not exist logoff_db() - #4639 --- pandora_console/index.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index 74621dded1..f62a3da4cf 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -872,12 +872,6 @@ if (! isset($config['id_user'])) { $loginhash_data = get_parameter('loginhash_data', ''); $loginhash_user = str_rot13(get_parameter('loginhash_user', '')); $iduser = $_SESSION['id_usuario']; - - /* - * Check why is not available. - * logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]); - */ - unset($_SESSION['id_usuario']); unset($iduser); @@ -913,7 +907,6 @@ if (! isset($config['id_user'])) { $_POST = []; $config['auth_error'] = __("User doesn\'t exist."); $iduser = $_SESSION['id_usuario']; - logoff_db($iduser, $_SERVER['REMOTE_ADDR']); unset($_SESSION['id_usuario']); unset($iduser); include_once 'general/login_page.php'; @@ -933,7 +926,6 @@ if (! isset($config['id_user'])) { $_POST = []; $config['auth_error'] = __('User only can use the API.'); $iduser = $_SESSION['id_usuario']; - logoff_db($iduser, $_SERVER['REMOTE_ADDR']); unset($_SESSION['id_usuario']); unset($iduser); include_once 'general/login_page.php'; @@ -956,7 +948,6 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (isset($_GET['bye'])) { include 'general/logoff.php'; $iduser = $_SESSION['id_usuario']; - db_logoff($iduser, $_SERVER['REMOTE_ADDR']); $_SESSION = []; session_destroy(); From 5fdf65c440210b409a2738296db7cf85018b8a9f Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 26 Sep 2019 17:33:51 +0200 Subject: [PATCH 09/56] Modified the mode of creation of agents with API --- pandora_console/include/functions_api.php | 218 +++++++++++----------- 1 file changed, 114 insertions(+), 104 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 899add9ec0..7aa5278a7e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1492,7 +1492,7 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) global $config; if (!check_acl($config['id_user'], 0, 'AW')) { - returnError('forbidden', 'string'); + returnError('forbidden', 'you havent got permissions to do this'); return; } @@ -1500,127 +1500,101 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) return; } - $alias = $other['data'][0]; - $ip = $other['data'][1]; - $idParent = $other['data'][2]; - $idGroup = $other['data'][3]; - $cascadeProtection = $other['data'][4]; - $cascadeProtectionModule = $other['data'][5]; - $intervalSeconds = $other['data'][6]; - $idOS = $other['data'][7]; - // $idServer = $other['data'][7]; - $nameServer = $other['data'][8]; - $customId = $other['data'][9]; - $learningMode = $other['data'][10]; - $disabled = $other['data'][11]; - $description = $other['data'][12]; - $alias_as_name = $other['data'][13]; + $alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $other['data'][0]))); + $direccion_agente = io_safe_input($other['data'][1]); + $nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000))); + $id_parent = (int) $other['data'][2]; + $grupo = (int) $other['data'][3]; + $cascade_protection = (int) $other['data'][4]; + $cascade_protection_module = (int) $other['data'][5]; + $intervalo = (string) $other['data'][6]; + $id_os = (int) $other['data'][7]; + $server_name = (string) $other['data'][8]; + $custom_id = (string) $other['data'][9]; + $modo = (int) $other['data'][10]; + $disabled = (int) $other['data'][11]; + $comentarios = (string) $other['data'][12]; + $alias_as_name = (int) $other['data'][13]; + $update_module_count = (int) $config['metaconsole_agent_cache'] == 1; - if ($alias_as_name && !empty($alias)) { - $name = $alias; - } else { - $name = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000))); - if (empty($alias)) { - $alias = $name; - } - } - - if ($cascadeProtection == 1) { - if (($idParent != 0) && (db_get_value_sql( + if ($cascade_protection == 1) { + if (($id_parent != 0) && (db_get_value_sql( 'SELECT id_agente_modulo - FROM tagente_modulo - WHERE id_agente = '.$idParent.' AND id_agente_modulo = '.$cascadeProtectionModule + FROM tagente_modulo + WHERE id_agente = '.$id_parent.' AND id_agente_modulo = '.$cascade_protection_module ) === false) ) { returnError('parent_agent_not_exist', 'Is not a parent module to do cascade protection.'); + return; } } else { $cascadeProtectionModule = 0; } - switch ($config['dbtype']) { - case 'mysql': - $sql1 = 'SELECT name - FROM tserver WHERE BINARY name LIKE "'.$nameServer.'"'; - break; + $server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$server_name.'"'); - case 'postgresql': - case 'oracle': - $sql1 = 'SELECT name - FROM tserver WHERE name LIKE \''.$nameServer.'\''; - break; - } - - $nameServer = db_get_value_sql($sql1); - - // Check ACL group - if (!check_acl($config['id_user'], $idGroup, 'AW')) { - returnError('forbidden', 'string'); - return; - } - - // Check selected parent - if ($idParent != 0) { - $parentCheck = agents_check_access_agent($idParent); - if ($parentCheck === null) { - returnError('parent_agent_not_exist', __('The agent parent don`t exist.')); - return; - } - - if ($parentCheck === false) { - returnError('parent_agent_forbidden', __('The user cannot access to parent agent.')); - return; - } - } - - if (agents_get_agent_id($name)) { + // Check if agent exists (BUG WC-50518-2). + if ($alias == '' && $alias_as_name === 0) { + returnError('alias_not_specified', 'No agent alias specified'); + } else if (agents_get_agent_id($name)) { returnError('agent_name_exist', 'The name of agent yet exist in DB.'); - } else if (db_get_value_sql( - 'SELECT id_grupo - FROM tgrupo - WHERE id_grupo = '.$idGroup - ) === false - ) { + } else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) { returnError('id_grupo_not_exist', 'The group don`t exist.'); - } else if (db_get_value_sql( - 'SELECT id_os - FROM tconfig_os - WHERE id_os = '.$idOS - ) === false - ) { + } else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) { returnError('id_os_not_exist', 'The OS don`t exist.'); - } else if (db_get_value_sql($sql1) === false) { + } else if ($server_name === false) { returnError('server_not_exist', 'The '.get_product_name().' Server don`t exist.'); } else { - $idAgente = db_process_sql_insert( - 'tagente', - [ - 'nombre' => $name, - 'alias' => $alias, - 'direccion' => $ip, - 'id_grupo' => $idGroup, - 'intervalo' => $intervalSeconds, - 'comentarios' => $description, - 'modo' => $learningMode, - 'id_os' => $idOS, - 'disabled' => $disabled, - 'cascade_protection' => $cascadeProtection, - 'cascade_protection_module' => $cascadeProtectionModule, - 'server_name' => $nameServer, - 'id_parent' => $idParent, - 'custom_id' => $customId, - ] - ); - - if (!empty($idAgente) && !empty($ip)) { - // register ip for this agent in 'taddress' - agents_add_address($idAgente, $ip); + if ($alias_as_name === 1) { + $exists_alias = db_get_row_sql('SELECT nombre FROM tagente WHERE nombre = "'.$alias.'"'); + $nombre_agente = $alias; } - if ($idGroup && !empty($idAgente)) { + if ($direccion_agente != '') { + $exists_ip = db_get_row_sql('SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"'); + } + + if (!$exists_alias && !$exists_ip) { + $id_agente = db_process_sql_insert( + 'tagente', + [ + 'nombre' => $nombre_agente, + 'alias' => $alias, + 'alias_as_name' => $alias_as_name, + 'direccion' => $direccion_agente, + 'id_grupo' => $grupo, + 'intervalo' => $intervalo, + 'comentarios' => $comentarios, + 'modo' => $modo, + 'id_os' => $id_os, + 'disabled' => $disabled, + 'cascade_protection' => $cascade_protection, + 'cascade_protection_module' => $cascade_protection_module, + 'server_name' => $server_name, + 'id_parent' => $id_parent, + 'custom_id' => $custom_id, + 'os_version' => '', + 'agent_version' => '', + 'timezone_offset' => 0, + 'icon_path' => '', + 'url_address' => '', + 'update_module_count' => $update_module_count, + ] + ); + enterprise_hook('update_agent', [$id_agente]); + } else { + $id_agente = false; + } + + if ($id_agente !== false) { + // Create address for this agent in taddress. + if ($direccion_agente != '') { + agents_add_address($id_agente, $direccion_agente); + } + $tpolicy_group_old = db_get_all_rows_sql( 'SELECT id_policy FROM tpolicy_groups - WHERE id_group = '.$idGroup + WHERE id_group = '.$grupo ); if ($tpolicy_group_old) { @@ -1629,18 +1603,54 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) 'tpolicy_agents', [ 'id_policy' => $old_group['id_policy'], - 'id_agent' => $idAgente, + 'id_agent' => $id_agente, ] ); } } + + $info = '{"Name":"'.$nombre_agente.'", + "IP":"'.$direccion_agente.'", + "Group":"'.$grupo.'", + "Interval":"'.$intervalo.'", + "Comments":"'.$comentarios.'", + "Mode":"'.$modo.'", + "ID_parent:":"'.$id_parent.'", + "Server":"'.$server_name.'", + "ID os":"'.$id_os.'", + "Disabled":"'.$disabled.'", + "Custom ID":"'.$custom_id.'", + "Cascade protection":"'.$cascade_protection.'", + "Cascade protection module":"'.$cascade_protection_module.'"}'; + + $unsafe_alias = io_safe_output($alias); + db_pandora_audit( + 'Agent management', + 'Created agent '.$unsafe_alias, + false, + true, + $info + ); + } else { + $id_agente = 0; + + if ($exists_alias) { + $agent_creation_error = __('Could not be created, because name already exists'); + } else if ($exists_ip) { + $agent_creation_error = __('Could not be created, because IP already exists'); + } else { + $agent_creation_error = __('Could not be created for unknown reason'); + } + + returnError('generic error', $agent_creation_error); + return; } returnData( 'string', [ 'type' => 'string', - 'data' => $idAgente, + 'data' => $id_agente, ] ); } From 1eb0b27da3c07806ed6664367e1f1c0d2294a9ab Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 27 Sep 2019 16:09:11 +0200 Subject: [PATCH 10/56] Fixed module update bug --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index e97fa7cf39..7bd0bb6885 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1383,7 +1383,7 @@ if ($update_module || $create_module) { $ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_critical = (int) get_parameter('ff_event_critical'); $ff_type = (int) get_parameter('ff_type'); - $each_ff = (int) get_parameter('each_ff'); + $each_ff = (int) get_parameter('each_ff', $module['each_ff']); $ff_timeout = (int) get_parameter('ff_timeout'); $unit = (string) get_parameter('unit'); $id_tag = (array) get_parameter('id_tag_selected'); From 0aa73b1a60598280b734a527dbcd5bf82a565156 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Mon, 30 Sep 2019 14:58:44 +0200 Subject: [PATCH 11/56] Added current gis location to agent gis view list --- .../operation/agentes/gis_view.php | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/pandora_console/operation/agentes/gis_view.php b/pandora_console/operation/agentes/gis_view.php index 139f8f8ae9..352b66f7af 100644 --- a/pandora_console/operation/agentes/gis_view.php +++ b/pandora_console/operation/agentes/gis_view.php @@ -97,17 +97,6 @@ echo ''; html_print_submit_button(__('Refresh path'), 'refresh', false, 'class = "sub upd" style="margin-top:0px"'); echo ''; -// Get the total number of Elements for the pagination -$sqlCount = sprintf( - 'SELECT COUNT(*) - FROM tgis_data_history - WHERE tagente_id_agente = %d AND end_timestamp > FROM_UNIXTIME(%d) - ORDER BY end_timestamp DESC', - $agentId, - (get_system_time() - $period) -); -$countData = (int) db_get_value_sql($sqlCount); - // Get the elements to present in this page switch ($config['dbtype']) { case 'mysql': @@ -147,33 +136,39 @@ switch ($config['dbtype']) { $result = db_get_all_rows_sql($sql, true); -if ($result === false) { - $sql2 = sprintf( - ' - SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude, - start_timestamp, description, number_of_packages, manual_placement - FROM tgis_data_status - WHERE tagente_id_agente = %d - ORDER BY start_timestamp DESC - LIMIT %d OFFSET %d', - $agentId, - $config['block_size'], - (int) get_parameter('offset') - ); +$sql2 = sprintf( + ' + SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude, + start_timestamp, description, number_of_packages, manual_placement + FROM tgis_data_status + WHERE tagente_id_agente = %d + ORDER BY start_timestamp DESC + LIMIT %d OFFSET %d', + $agentId, + $config['block_size'], + (int) get_parameter('offset') +); $result2 = db_get_all_rows_sql($sql2, true); - if ($result2 === false) { +if ($result === false && $result2 === false) { ui_print_empty_data(__('This agent doesn\'t have any GIS data.')); +} else { + if ($result === false) { + $result = $result2; } else { $result2[0]['end_timestamp'] = date('Y-m-d H:i:s'); - $result = $result2; + array_unshift($result, $result2[0]); } } + if ($result !== false) { echo '

'.__('Positional data from the last').' '.human_time_description_raw($period).'

'; + // Get the total elements for UI pagination + $countData = count($result); + if ($countData > 0) { ui_pagination($countData, false); } From a44e1feeb482622812f63154f1463589946b8c88 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 1 Oct 2019 16:24:02 +0200 Subject: [PATCH 12/56] fixed error comments events --- pandora_console/include/functions_events.php | 2 +- pandora_console/include/functions_ui.php | 57 ++++++++++++++++++- .../include/javascript/pandora_events.js | 14 +++++ pandora_console/include/styles/pandora.css | 2 +- pandora_console/operation/events/events.php | 15 +++++ 5 files changed, 87 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index b10b38702f..ff0b359c72 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4615,7 +4615,7 @@ function events_page_comments($event, $ajax=false) foreach ($comm as $c) { $data[0] = ''.$c['action'].' by '.$c['id_user'].''; $data[0] .= '

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

'.$c['comment'].'

'; $table_comments->data[] = $data; } } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 06c4b579ea..02aae58ebf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5622,7 +5622,7 @@ function ui_get_sorting_arrows($url_up, $url_down, $selectUp, $selectDown) return ' '.html_print_image($arrow_up, true, ['alt' => 'up']).' - '.html_print_image($arrow_down, true, ['alt' => 'down']).' + '.html_print_image($arrow_.down, true, ['alt' => 'down']).' '; } @@ -5646,3 +5646,58 @@ function ui_print_breadcrums($tab_name) return $section; } + + +/** + * Show last comment + * + * @param array $comments array with comments + * + * @return string HTML string with the last comment of the events. + */ +function ui_print_comments($comments) +{ + global $config; + + $comments = explode('
', $comments); + $comments = str_replace(["\n", ' '], '
', $comments); + if (is_array($comments)) { + foreach ($comments as $comm) { + if (empty($comm)) { + continue; + } + + $comments_array[] = json_decode(io_safe_output($comm), true); + } + } + + foreach ($comments_array as $comm) { + // Show the comments more recent first. + if (is_array($comm)) { + $last_comment[] = array_reverse($comm); + } + } + + // Only show the last comment. If commment its too long,the comment will short with ... + // If $config['prominent_time'] is timestamp the date show Month, day, hour and minutes. + // Else show comments hours ago + $short_comment = substr($last_comment[0][0]['comment'], 0, '80px'); + if ($config['prominent_time'] == 'timestamp') { + $comentario = ''.date($config['date_format'], $last_comment[0][0]['utimestamp']).' ('.$last_comment[0][0]['id_user'].'): '.$last_comment[0][0]['comment'].''; + + if (strlen($comentario) > '200px') { + $comentario = ''.date($config['date_format'], $last_comment[0][0]['utimestamp']).' ('.$last_comment[0][0]['id_user'].'): '.$short_comment.'...'; + } + } else { + $rest_time = (time() - $last_comment[0][0]['utimestamp']); + $time_last = (($rest_time / 60) / 60); + $comentario = ''.number_format($time_last, 0).'  Hours  ('.$last_comment[0][0]['id_user'].'): '.$last_comment[0][0]['comment'].''; + + if (strlen($comentario) > '200px') { + $comentario = ''.number_format($time_last, 0).'  Hours  ('.$last_comment[0][0]['id_user'].'): '.$short_comment.'...'; + } + } + + return io_safe_output($comentario); + +} diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 0fb6c1a6ef..79668406e1 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -63,6 +63,20 @@ function show_event_dialog(event, dialog_page, result) { height: 600 }) .show(); + $.post({ + url: "ajax.php", + data: { + page: "include/ajax/events", + get_comments: 1, + event: event, + filter: values + }, + dataType: "html", + success: function(data) { + $("#extended_event_comments_page").empty(); + $("#extended_event_comments_page").html(data); + } + }); $("#refrcounter").countdown("pause"); $("div.vc-countdown").countdown("pause"); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 27b3094027..48f541dbaf 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -450,7 +450,7 @@ select:-internal-list-box { max-width: 120px; } .mw120px { - min-width: 120px; + min-width: 10%; } .mw180px { min-width: 180px; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 851bce345a..e0d1534618 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -297,6 +297,10 @@ if (is_ajax()) { $tmp->module_name = io_safe_output($tmp->module_name); } + if ($tmp->comments) { + $tmp->comments = ui_print_comments($tmp->comments); + } + $tmp->agent_name = io_safe_output($tmp->agent_name); $tmp->ack_utimestamp = ui_print_timestamp( $tmp->ack_utimestamp, @@ -1600,6 +1604,17 @@ function process_datatables_callback(table, settings) { function process_datatables_item(item) { + // Show comments events. + item.user_comment = item.comments + + if(item.comments.length > 80){ + + item.user_comment += '  '; + item.user_comment += ' __('Show more')]); ?>'; + + } + // Grouped events. if(item.max_id_evento) { item.id_evento = item.max_id_evento From f1d20d56e76b1ac69abc7d2be77e7ed138941508 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Tue, 1 Oct 2019 16:26:22 +0200 Subject: [PATCH 13/56] Update functions_ui.php --- pandora_console/include/functions_ui.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 02aae58ebf..4540a2f923 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5622,7 +5622,7 @@ function ui_get_sorting_arrows($url_up, $url_down, $selectUp, $selectDown) return ' '.html_print_image($arrow_up, true, ['alt' => 'up']).' - '.html_print_image($arrow_.down, true, ['alt' => 'down']).' + '.html_print_image($arrow_down, true, ['alt' => 'down']).' '; } From 8bb1e4ed2df304ebe18f29e6d8964e90e7e8c85f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 2 Oct 2019 11:33:43 +0200 Subject: [PATCH 14/56] is_numeric review, with fallback to looks_like_number --- pandora_server/lib/PandoraFMS/Tools.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index e07a4e9ae6..df9d5b3901 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -569,7 +569,8 @@ sub is_numeric { my $SIGN = qr{ [+-] }xms; my $NUMBER = qr{ ($SIGN?) ($DIGITS) }xms; if ( $val !~ /^${NUMBER}$/ ) { - return 0; #Non-numeric + #Non-numeric, or maybe... leave looks_like_number try + return looks_like_number($val); } else { return 1; #Numeric From f34d30dd3952574ec2783cd80b879c5e85633583 Mon Sep 17 00:00:00 2001 From: Kike Date: Wed, 2 Oct 2019 12:38:13 +0200 Subject: [PATCH 15/56] Fixed loop on network map migration process --- .../agentes/pandora_networkmap.view.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 4a03bc369e..2ee34806d9 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -702,6 +702,18 @@ if (is_ajax()) { if (!$return) { $return_data['ent'] = false; break; + } else { + $old_networkmap_ent = db_get_row_filter( + 'tnetworkmap_enterprise', + ['id' => $id_ent_map] + ); + + $options = json_decode($old_networkmap_ent, true); + $options['migrated'] = 'migrated'; + + $values['options'] = json_encode($options); + + db_process_sql_update('tnetworkmap_enterprise', $values, ['id' => $id_ent_map]); } } } @@ -716,6 +728,10 @@ if (is_ajax()) { if (!$return) { $return_data['open'] = false; break; + } else { + $values['text_filter'] = 'migrated'; + + db_process_sql_update('tnetwork_map', $values, ['id_networkmap' => $id_open_map]); } } } From a4cff9770f8c9e33c9a34dbbbe5612086619a6d6 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 4 Oct 2019 14:17:14 +0200 Subject: [PATCH 16/56] Collaborative session @manuel.montes pagination fix in datatables (hide when only 1 page) --- pandora_console/include/functions_ui.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 06c4b579ea..a0c7b18eaf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3187,14 +3187,18 @@ function ui_print_datatable(array $parameters) $.fn.dataTable.ext.errMode = "none"; $.fn.dataTable.ext.classes.sPageButton = "'.$pagination_class.'"; dt_'.$table_id.' = $("#'.$table_id.'").DataTable({ - '; + drawCallback: function(settings) {'; if (isset($parameters['drawCallback'])) { - $js .= 'drawCallback: function(settings) { - '.$parameters['drawCallback'].' - },'; + $js .= $parameters['drawCallback']; } $js .= ' + if (dt_'.$table_id.'.page.info().pages > 1) { + $("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").show() + } else { + $("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").hide() + } + }, processing: true, serverSide: true, paging: true, @@ -3299,6 +3303,7 @@ function ui_print_datatable(array $parameters) dt_'.$table_id.'.draw().page(0) }); }); + '; // Order. From 647ce5706eb2c1bb260bff80391cbd884c8a726a Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 4 Oct 2019 14:53:07 +0200 Subject: [PATCH 17/56] encryption key prepared before being used --- pandora_server/bin/pandora_server | 7 +++---- pandora_server/lib/PandoraFMS/Config.pm | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 1209922537..a367eb7bca 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -97,9 +97,6 @@ sub pandora_startup () { # Grab config tokens shared with the console and not in the .conf pandora_get_sharedconfig (\%Config, $DBH); - - # Generate the encryption key after reading the passphrase. - $Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]); # Kill any running server threads. stop_server_threads(); @@ -211,7 +208,9 @@ sub pandora_crash () { } $full_error .= $error_line; } - + + # Could crash before parse configuration. + $Config{'rb_product_name'} = 'PandoraFMS' unless defined($Config{'rb_product_name'}) && $Config{'rb_product_name'} ne ''; logger (\%Config, $Config{'rb_product_name'} . ' Server \'' . $Config{'servername'} . '\' unhandled error.', 1); # It's interesting show by console problems, not only in logs. This helps diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 5ddf95d22d..7d496e6642 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -1206,6 +1206,9 @@ sub pandora_load_config { } # end of loop for parameter # + # Generate the encryption key after reading the passphrase. + $pa_config->{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [$pa_config, $pa_config->{"encryption_passphrase"}]); + # Set to RDBMS' standard port if (!defined($pa_config->{'dbport'})) { if ($pa_config->{'dbengine'} eq "mysql") { From 7bdd2a02e56f253543a4f18f6306a454d70dfe1c Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Oct 2019 10:02:21 +0200 Subject: [PATCH 18/56] Added a string with information of the caller of pandora_server. Modified too an issue with security level messages --- pandora_server/lib/PandoraFMS/Tools.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index e07a4e9ae6..4cb203d129 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -640,19 +640,24 @@ sub logger ($$;$) { # Set the security level my $security_level = 'info'; if ($level < 2) { - $security = 'crit'; + $security_level = 'crit'; } elsif ($level < 5) { - $security = 'warn'; + $security_level = 'warn'; } openlog('pandora_server', 'ndelay', 'daemon'); syslog($security_level, $message); closelog(); } else { + # Obtain the script that invoke this log + my $parent_caller = ""; + if (($parent_caller = ( caller(2) )[1]) ne "") { + $parent_caller = " ** " . (split '/', $parent_caller)[-1] . " **:"; + } open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'"; # Get an exclusive lock on the file (LOCK_EX) flock (FILE, 2); - print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . " " . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n"; + print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . $parent_caller . " " . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n"; close (FILE); } } From 662e86c1c2c2b728724d75fb4c0b3ca0109d2f70 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Oct 2019 10:31:59 +0200 Subject: [PATCH 19/56] Improved solution --- pandora_server/lib/PandoraFMS/Tools.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 4cb203d129..85248ed99b 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -652,7 +652,9 @@ sub logger ($$;$) { # Obtain the script that invoke this log my $parent_caller = ""; if (($parent_caller = ( caller(2) )[1]) ne "") { - $parent_caller = " ** " . (split '/', $parent_caller)[-1] . " **:"; + $parent_caller = (split '/', $parent_caller)[-1]; + $parent_caller =~ s/\.[^.]+$//; + $parent_caller = " ** " . $parent_caller . " **:"; } open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'"; # Get an exclusive lock on the file (LOCK_EX) From a9e8b1113ea337e81e790b39dc72ab0587265975 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 11:15:25 +0200 Subject: [PATCH 20/56] add default comments when change owner or status on events --- pandora_console/include/functions_api.php | 2 +- pandora_console/include/functions_events.php | 4 ++-- pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 899add9ec0..da3da6cdb7 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11771,7 +11771,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy } else { $ack_utimestamp = time(); - events_comment($id, '', 'Change status to validated'); + events_comment($id, 'Event validated', 'Change status to validated'); $values = [ 'ack_utimestamp' => $ack_utimestamp, diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ff0b359c72..c522f81fce 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1765,7 +1765,7 @@ function events_change_status( events_comment( $id_event, - '', + 'Event validated', 'Change status to '.$status_string, $meta, $history @@ -1857,7 +1857,7 @@ function events_change_owner( if ($force) { events_comment( $id_event, - '', + 'Change owner to '.$new_owner.'', 'Change owner to '.$new_owner, $meta, $history diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 644b983a5c..d20556ba8d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,9 +1222,8 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_(\\d+)h_"; - my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; - + my $macro_regexp = "_modulegraph_24h_"; + my $macro_regexp2 = "_modulegraphth_24h_"; # API connection my $ua = new LWP::UserAgent; eval { @@ -1260,11 +1259,12 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { + # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content(); From 4c04b8f628270c9a94d7e36d7c0679b8ff3ac756 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 11:21:16 +0200 Subject: [PATCH 21/56] fixed error --- pandora_server/lib/PandoraFMS/Core.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index d20556ba8d..f9636a12d3 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,8 +1222,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_24h_"; - my $macro_regexp2 = "_modulegraphth_24h_"; + my $macro_regexp = "_modulegraph_(\\d+)h_"; + my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; + # API connection my $ua = new LWP::UserAgent; eval { @@ -1259,12 +1260,11 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { - # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content(); @@ -6075,5 +6075,4 @@ L, L, L, L, L, L Date: Mon, 7 Oct 2019 11:22:16 +0200 Subject: [PATCH 22/56] fixed error --- pandora_server/lib/PandoraFMS/Core.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f9636a12d3..d20556ba8d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,9 +1222,8 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_(\\d+)h_"; - my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; - + my $macro_regexp = "_modulegraph_24h_"; + my $macro_regexp2 = "_modulegraphth_24h_"; # API connection my $ua = new LWP::UserAgent; eval { @@ -1260,11 +1259,12 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { + # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content(); @@ -6075,4 +6075,5 @@ L, L, L, L, L, L Date: Mon, 7 Oct 2019 11:23:30 +0200 Subject: [PATCH 23/56] fixed error --- pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index d20556ba8d..644b983a5c 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,8 +1222,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_24h_"; - my $macro_regexp2 = "_modulegraphth_24h_"; + my $macro_regexp = "_modulegraph_(\\d+)h_"; + my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; + # API connection my $ua = new LWP::UserAgent; eval { @@ -1259,12 +1260,11 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { - # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content(); From 80e6d70b315d4f6339b7ef7f5b21cb0975c5cf1c Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 11:29:42 +0200 Subject: [PATCH 24/56] revert style --- pandora_console/include/styles/pandora.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 48f541dbaf..27b3094027 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -450,7 +450,7 @@ select:-internal-list-box { max-width: 120px; } .mw120px { - min-width: 10%; + min-width: 120px; } .mw180px { min-width: 180px; From 8c0c3921971b2a8b96315fad5c1794affe6bb48e Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 11:39:06 +0200 Subject: [PATCH 25/56] revert chanegd --- pandora_console/include/functions_api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index da3da6cdb7..899add9ec0 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11771,7 +11771,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy } else { $ack_utimestamp = time(); - events_comment($id, 'Event validated', 'Change status to validated'); + events_comment($id, '', 'Change status to validated'); $values = [ 'ack_utimestamp' => $ack_utimestamp, From a7b66e6365ba081039e08b7d79d2a69e29f5105f Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 12:07:31 +0200 Subject: [PATCH 26/56] revert changes --- pandora_console/include/functions_events.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index c522f81fce..ff0b359c72 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1765,7 +1765,7 @@ function events_change_status( events_comment( $id_event, - 'Event validated', + '', 'Change status to '.$status_string, $meta, $history @@ -1857,7 +1857,7 @@ function events_change_owner( if ($force) { events_comment( $id_event, - 'Change owner to '.$new_owner.'', + '', 'Change owner to '.$new_owner, $meta, $history From 2b2f8417a7b24419054ac2a33585ca31b743ca1a Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Oct 2019 12:40:59 +0200 Subject: [PATCH 27/56] Added control for same-day and different hours planned downtimes --- pandora_console/include/functions_planned_downtimes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index 7f1a587b65..1147ad97a8 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -748,7 +748,9 @@ function planned_downtimes_created($values) 'return' => false, 'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time'), ]; - } else if ($values['type_execution'] == 'once' && $values['date_from'] >= $values['date_to']) { + } else if ($values['type_execution'] == 'once' && ($values['date_from'] > $values['date_to']) + || (($values['date_from'] == $values['date_to']) && ($values['periodically_time_from'] >= $values['periodically_time_to'])) + ) { return [ 'return' => false, 'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'), From 37c0f340dcc78a31745e215cbc9cfdcaebf993da Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Mon, 7 Oct 2019 15:09:46 +0200 Subject: [PATCH 28/56] Fixed macro _policy_ in alerts --- pandora_server/lib/PandoraFMS/Core.pm | 61 +++++++++++++-------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 644b983a5c..6a1a3c36b7 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1141,21 +1141,21 @@ sub pandora_execute_action ($$$$$$$$$;$) { #logger($pa_config, "Clean name ".$clean_name, 10); # User defined alert if ($action->{'internal'} == 0) { - $macros{_field1_} = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field2_} = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field3_} = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field4_} = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field5_} = subst_alert_macros ($field5, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field6_} = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field7_} = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field8_} = subst_alert_macros ($field8, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field9_} = subst_alert_macros ($field9, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field10_} = subst_alert_macros ($field10, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field11_} = subst_alert_macros ($field11, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field12_} = subst_alert_macros ($field12, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field13_} = subst_alert_macros ($field13, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field14_} = subst_alert_macros ($field14, \%macros, $pa_config, $dbh, $agent, $module); - $macros{_field15_} = subst_alert_macros ($field15, \%macros, $pa_config, $dbh, $agent, $module); + $macros{_field1_} = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field2_} = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field3_} = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field4_} = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field5_} = subst_alert_macros ($field5, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field6_} = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field7_} = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field8_} = subst_alert_macros ($field8, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field9_} = subst_alert_macros ($field9, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field10_} = subst_alert_macros ($field10, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field11_} = subst_alert_macros ($field11, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field12_} = subst_alert_macros ($field12, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field13_} = subst_alert_macros ($field13, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field14_} = subst_alert_macros ($field14, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $macros{_field15_} = subst_alert_macros ($field15, \%macros, $pa_config, $dbh, $agent, $module, $alert); my @command_args = (); # divide command into words based on quotes and whitespaces @@ -1186,7 +1186,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Internal Audit } elsif ($clean_name eq "Internal Audit") { - $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module); + $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module, $alert); pandora_audit ($pa_config, $field1, defined ($agent) ? safe_output($agent->{'alias'}) : 'N/A', 'Alert (' . safe_output($alert->{'description'}) . ')', $dbh); # Email @@ -1363,12 +1363,12 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Pandora FMS Event } elsif ($clean_name eq "Monitoring Event") { - $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module); - $field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module); - $field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module); - $field6 = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module); - $field7 = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module); - $field8 = subst_alert_macros ($field8, \%macros, $pa_config, $dbh, $agent, $module); + $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field6 = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field7 = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field8 = subst_alert_macros ($field8, \%macros, $pa_config, $dbh, $agent, $module, $alert); # Field 1 (event text) my $event_text = $field1; @@ -1448,13 +1448,13 @@ sub pandora_execute_action ($$$$$$$$$;$) { my $config_api_pass = pandora_get_tconfig_token ($dbh, 'integria_api_pass', ''); my $config_integria_user = pandora_get_tconfig_token ($dbh, 'integria_user', ''); my $config_integria_user_pass = pandora_get_tconfig_token ($dbh, 'integria_pass', ''); - $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module); - $field2 = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module); - $field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module); - $field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module); - $field5 = subst_alert_macros ($field5, \%macros, $pa_config, $dbh, $agent, $module); - $field6 = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module); - $field7 = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module); + $field1 = subst_alert_macros ($field1, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field2 = subst_alert_macros ($field2, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field3 = subst_alert_macros ($field3, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field4 = subst_alert_macros ($field4, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field5 = subst_alert_macros ($field5, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field6 = subst_alert_macros ($field6, \%macros, $pa_config, $dbh, $agent, $module, $alert); + $field7 = subst_alert_macros ($field7, \%macros, $pa_config, $dbh, $agent, $module, $alert); # Field 1 (Integria IMS API path) my $api_path = $config_api_path . "/integria/include/api.php"; @@ -1513,8 +1513,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { } elsif ($clean_name eq "Generate Notification") { # Translate macros - $field3 = subst_alert_macros($field3, \%macros, $pa_config, $dbh, $agent, $module); - $field4 = subst_alert_macros($field4, \%macros, $pa_config, $dbh, $agent, $module); + $field3 = subst_alert_macros($field3, \%macros, $pa_config, $dbh, $agent, $module, $alert); # If no targets ignore notification if (defined($field1) && defined($field2) && ($field1 ne "" || $field2 ne "")) { From 7ecaf11d07a1d9aa79b32484d370d188b82939f5 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 7 Oct 2019 16:38:58 +0200 Subject: [PATCH 29/56] Locate instead search before create new Discovered agent --- .../lib/PandoraFMS/DiscoveryServer.pm | 46 +++---------------- 1 file changed, 7 insertions(+), 39 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index b2d8e71619..121cfe5d49 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -431,14 +431,14 @@ sub PandoraFMS::Recon::Base::connect_agents($$$$$) { my ($self, $dev_1, $if_1, $dev_2, $if_2) = @_; # Get the agent for the first device. - my $agent_1 = get_agent_from_addr($self->{'dbh'}, $dev_1); + my $agent_1 = get_agent_name_from_addr($self->{'dbh'}, $dev_1); if (!defined($agent_1)) { $agent_1 = get_agent_from_name($self->{'dbh'}, $dev_1); } return unless defined($agent_1); # Get the agent for the second device. - my $agent_2 = get_agent_from_addr($self->{'dbh'}, $dev_2); + my $agent_2 = get_agent_name_from_addr($self->{'dbh'}, $dev_2); if (!defined($agent_2)) { $agent_2 = get_agent_from_name($self->{'dbh'}, $dev_2); } @@ -582,44 +582,12 @@ sub PandoraFMS::Recon::Base::create_agent($$) { # Clean name. $device = clean_blank($device); - my @agents = get_db_rows($self->{'dbh'}, - 'SELECT * FROM taddress, taddress_agent, tagente - WHERE tagente.id_agente = taddress_agent.id_agent - AND taddress_agent.id_a = taddress.id_a - AND ip = ?', $device - ); - - # Does the host already exist? - my $agent; - foreach my $candidate (@agents) { - $agent = {map {$_} %$candidate}; # copy contents, do not use shallow copy - # exclude $device itself, because it handle corner case when target includes NAT - my @registered = map {$_->{ip}} get_db_rows($self->{'dbh'}, - 'SELECT ip FROM taddress, taddress_agent, tagente - WHERE tagente.id_agente = taddress_agent.id_agent - AND taddress_agent.id_a = taddress.id_a - AND tagente.id_agente = ? - AND taddress.ip != ?', $agent->{id_agente}, $device - ); - foreach my $ip_addr (@registered) { - my @matched = grep { $_ =~ /^$ip_addr$/ } $self->get_addresses($device); - if (scalar(@matched) == 0) { - $agent = undef; - last; - } - } - last if(defined($agent)); # exit loop if match all ip_addr - } - - if (!defined($agent)) { - $agent = get_agent_from_name($self->{'dbh'}, $device); - } + # Resolve hostnames. + my $host_name = (($self->{'resolve_names'} == 1) ? gethostbyaddr(inet_aton($device), AF_INET) : $device); + my $agent = locate_agent($self->{'dbh'}, $host_name); my ($agent_id, $agent_learning); if (!defined($agent)) { - - # Resolve hostnames. - my $host_name = $self->{'resolve_names'} == 1 ? gethostbyaddr (inet_aton($device), AF_INET) : $device; $host_name = $device unless defined ($host_name); # Guess the OS. @@ -942,14 +910,14 @@ sub PandoraFMS::Recon::Base::set_parent($$$) { return unless ($self->{'parent_detection'} == 1); # Get the agent for the host. - my $agent = get_agent_from_addr($self->{'dbh'}, $host); + my $agent = get_agent_name_from_addr($self->{'dbh'}, $host); if (!defined($agent)) { $agent = get_agent_from_name($self->{'dbh'}, $host); } return unless defined($agent); # Check if the parent agent exists. - my $agent_parent = get_agent_from_addr($self->{'dbh'}, $parent); + my $agent_parent = get_agent_name_from_addr($self->{'dbh'}, $parent); if (!defined($agent_parent)) { $agent_parent = get_agent_from_name($self->{'dbh'}, $parent); } From 2ac4ae3a18697f4ac28c0523084019b3cd674f55 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 7 Oct 2019 17:08:09 +0200 Subject: [PATCH 30/56] Minor fix --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 121cfe5d49..a98cd2cd69 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -584,7 +584,7 @@ sub PandoraFMS::Recon::Base::create_agent($$) { # Resolve hostnames. my $host_name = (($self->{'resolve_names'} == 1) ? gethostbyaddr(inet_aton($device), AF_INET) : $device); - my $agent = locate_agent($self->{'dbh'}, $host_name); + my $agent = locate_agent($self->{'pa_config'}, $self->{'dbh'}, $host_name); my ($agent_id, $agent_learning); if (!defined($agent)) { From 8b771f6a35b5c808968456e9ba0ae7198d2f87ed Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 7 Oct 2019 17:35:20 +0200 Subject: [PATCH 31/56] Minor fix --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index a98cd2cd69..6762e79b4f 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -584,6 +584,8 @@ sub PandoraFMS::Recon::Base::create_agent($$) { # Resolve hostnames. my $host_name = (($self->{'resolve_names'} == 1) ? gethostbyaddr(inet_aton($device), AF_INET) : $device); + # Fallback to device IP if host name could not be resolved. + $host_name = $device if (!defined($host_name) || $host_name == ''); my $agent = locate_agent($self->{'pa_config'}, $self->{'dbh'}, $host_name); my ($agent_id, $agent_learning); From 646f2607ab67075cf40e4daa4e8834f0f05d1045 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 7 Oct 2019 19:02:19 +0200 Subject: [PATCH 32/56] added condition in agent massive edition --- pandora_console/godmode/massive/massive_edit_agents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 9a43c661ce..0126aa93f9 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -199,7 +199,7 @@ if ($update_agents) { } // Update the configuration files. - if ($result && ($old_interval_value != $values['intervalo'])) { + if ($result && ($old_interval_value != $values['intervalo']) && !empty($values['intervalo'])) { enterprise_hook( 'config_agents_update_config_token', [ From 941362776eec825e5e8b22e1e0a1f0a9255a4ccb Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 8 Oct 2019 14:06:30 +0200 Subject: [PATCH 33/56] Fixed keepcounters ckbox bug --- pandora_console/godmode/agentes/configurar_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7bd0bb6885..55116f940a 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1382,7 +1382,7 @@ if ($update_module || $create_module) { $ff_event_normal = (int) get_parameter('ff_event_normal'); $ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_critical = (int) get_parameter('ff_event_critical'); - $ff_type = (int) get_parameter('ff_type'); + $ff_type = (int) get_parameter('ff_type', $module['ff_type']); $each_ff = (int) get_parameter('each_ff', $module['each_ff']); $ff_timeout = (int) get_parameter('ff_timeout'); $unit = (string) get_parameter('unit'); From 6ad9386cf6773b5181daf0865bc04ec560d465bc Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 8 Oct 2019 15:42:55 +0200 Subject: [PATCH 34/56] Added date control --- pandora_console/include/functions_planned_downtimes.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index 1147ad97a8..a9b701241b 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -796,6 +796,11 @@ function planned_downtimes_created($values) 'return' => false, 'message' => __('Not created. Error inserting data').'. '.__('There is no group with such id'), ]; + } else if (!$values['date_from'] || !$values['date_to']) { + return [ + 'return' => false, + 'message' => __('Not created. Error inserting data').'. '.__('Date is wrong formatted'), + ]; } else { if (trim(io_safe_output($values['name'])) != '') { if (!$check) { From be2148ff2651c8506ee8c028b7b7675aa638872c Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 9 Oct 2019 00:01:09 +0200 Subject: [PATCH 35/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 530d72c92a..2d7403bb23 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191008 +Version: 7.0NG.739-191009 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 7a0b937277..1b58195105 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.739-191008" +pandora_version="7.0NG.739-191009" 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 3c1555127b..fc707cb991 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.739'; -use constant AGENT_BUILD => '191008'; +use constant AGENT_BUILD => '191009'; # 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 cfb80e4a20..7a2a572fd7 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.739 -%define release 191008 +%define release 191009 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 75849e3332..41796d7ce2 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.739 -%define release 191008 +%define release 191009 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 c9c15b524d..9edfa4dcf8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191008" +PI_BUILD="191009" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c4cb54ef67..e04742ed10 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191008} +{191009} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4c2e13743e..70d7a193c1 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.739(Build 191008)") +#define PANDORA_VERSION ("7.0NG.739(Build 191009)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 421dfa8cb0..114c76e046 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.739(Build 191008))" + VALUE "ProductVersion", "(7.0NG.739(Build 191009))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index dbc8eb0477..9be8c7bf0b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191008 +Version: 7.0NG.739-191009 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 6b176913da..4ac26886d9 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.739-191008" +pandora_version="7.0NG.739-191009" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4f3ff4ba1b..ee12eaa36d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191008'; +$build_version = 'PC191009'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b6537ed570..61c9e376fa 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 7b24e60431..425636aa97 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.739 -%define release 191008 +%define release 191009 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 38219c6a3d..a532f5d33e 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.739 -%define release 191008 +%define release 191009 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2770800a24..d72dae943a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191008" +PI_BUILD="191009" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5a7dc23016..80e9193355 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.739 PS191008"; +my $version = "7.0NG.739 PS191009"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 11e0e3c324..5faea24aa2 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191008"; +my $version = "7.0NG.739 PS191009"; # save program name for logging my $progname = basename($0); From d09c071684c89281cfe4de456c5579ffd66bef70 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 9 Oct 2019 15:45:02 +0200 Subject: [PATCH 36/56] discovery ACL --- pandora_console/godmode/menu.php | 45 ++++++--- pandora_console/godmode/servers/discovery.php | 20 +++- .../wizards/DiscoveryTaskList.class.php | 72 +++++++------- .../godmode/wizards/HostDevices.class.php | 94 +++++++++++++------ .../godmode/wizards/Wizard.main.php | 51 ++++++++++ .../include/class/CustomNetScan.class.php | 24 +++-- .../class/ManageNetScanScripts.class.php | 4 +- 7 files changed, 215 insertions(+), 95 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index b969edd3df..7175081912 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -21,27 +21,42 @@ require_once 'include/functions_menu.php'; $menu_godmode = []; $menu_godmode['class'] = 'godmode'; - -if (check_acl($config['id_user'], 0, 'PM')) { +if (check_acl($config['id_user'], 0, 'AR') + || check_acl($config['id_user'], 0, 'AW') + || check_acl($config['id_user'], 0, 'RR') + || check_acl($config['id_user'], 0, 'RW') + || check_acl($config['id_user'], 0, 'PM') +) { $sub = []; $sub['godmode/servers/discovery&wiz=main']['text'] = __('Main'); $sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery'; - $sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list'); $sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist'; - $sub2 = []; - $sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan'); - enterprise_hook('hostdevices_submenu'); - $sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan'); - $sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts'); - $sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices'); - $sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd'; - $sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2; + if (check_acl($config['id_user'], 0, 'AW') + || check_acl($config['id_user'], 0, 'PM') + ) { + if (check_acl($config['id_user'], 0, 'AW')) { + $sub2 = []; + $sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan'); + enterprise_hook('hostdevices_submenu'); + $sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan'); + } - enterprise_hook('applications_menu'); - enterprise_hook('cloud_menu'); - enterprise_hook('console_task_menu'); + if (check_acl($config['id_user'], 0, 'PM')) { + $sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts'); + } + + $sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices'); + $sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd'; + $sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2; + } + + if (check_acl($config['id_user'], 0, 'AW')) { + enterprise_hook('applications_menu'); + enterprise_hook('cloud_menu'); + enterprise_hook('console_task_menu'); + } // Add to menu. $menu_godmode['discovery']['text'] = __('Discovery'); @@ -92,7 +107,7 @@ if (!empty($sub)) { } $sub = []; -if (check_acl($config['id_user'], 0, 'AW')) { +if (check_acl($config['id_user'], 0, 'PM')) { $sub['godmode/groups/group_list']['text'] = __('Manage agents groups'); $sub['godmode/groups/group_list']['id'] = 'Manage agents groups'; } diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 3f2166bb39..2d0fcec8a1 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -4,7 +4,14 @@ global $config; check_login(); -if (! check_acl($config['id_user'], 0, 'AW')) { +if (! check_acl($config['id_user'], 0, 'AR') + && ! check_acl($config['id_user'], 0, 'AW') + && ! check_acl($config['id_user'], 0, 'AM') + && ! check_acl($config['id_user'], 0, 'RR') + && ! check_acl($config['id_user'], 0, 'RW') + && ! check_acl($config['id_user'], 0, 'RM') + && ! check_acl($config['id_user'], 0, 'PM') +) { db_pandora_audit( 'ACL Violation', 'Trying to access Server Management' @@ -134,11 +141,18 @@ if ($classname_selected === null) { $classname = basename($classpath, '.class.php'); $obj = new $classname(); + $button = $obj->load(); + + if ($button === false) { + // No acess, skip. + continue; + } + // DiscoveryTaskList must be first button. if ($classname == 'DiscoveryTaskList') { - array_unshift($wiz_data, $obj->load()); + array_unshift($wiz_data, $button); } else { - $wiz_data[] = $obj->load(); + $wiz_data[] = $button; } } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index ed7e1f3b10..ed523d0b82 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -200,7 +200,7 @@ class DiscoveryTaskList extends Wizard { global $config; - if (! check_acl($config['id_user'], 0, 'PM')) { + if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( 'ACL Violation', 'Trying to access recon task viewer' @@ -241,7 +241,7 @@ class DiscoveryTaskList extends Wizard { global $config; - if (! check_acl($config['id_user'], 0, 'PM')) { + if (!$this->aclMulticheck('RR|RW|RM|PM')) { db_pandora_audit( 'ACL Violation', 'Trying to access recon task viewer' @@ -270,7 +270,7 @@ class DiscoveryTaskList extends Wizard { global $config; - if (! check_acl($config['id_user'], 0, 'PM')) { + if (! check_acl($config['id_user'], 0, 'RM')) { db_pandora_audit( 'ACL Violation', 'Trying to access recon task viewer' @@ -313,13 +313,9 @@ class DiscoveryTaskList extends Wizard check_login(); - if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit( - 'ACL Violation', - 'Trying to access recon task viewer' - ); - include 'general/noaccess.php'; - return false; + if (!$this->aclMulticheck('AR|AW|AM')) { + // Tasklist are allowed only of agent managers. + return ''; } // Get all discovery servers. @@ -341,7 +337,7 @@ class DiscoveryTaskList extends Wizard // -------------------------------- // FORCE A RECON TASK // -------------------------------- - if (check_acl($config['id_user'], 0, 'PM')) { + if (check_acl($config['id_user'], 0, 'AW')) { if (isset($_GET['force'])) { $id = (int) get_parameter_get('force', 0); servers_force_recon_task($id); @@ -387,8 +383,10 @@ class DiscoveryTaskList extends Wizard // Operations. $table->headstyle[9] .= 'min-width: 150px; width: 150px;'; - $table->head[0] = __('Force'); - $table->align[0] = 'left'; + if (check_acl($config['id_user'], 0, 'AW')) { + $table->head[0] = __('Force'); + $table->align[0] = 'left'; + } $table->head[1] = __('Task name'); $table->align[1] = 'left'; @@ -455,11 +453,13 @@ class DiscoveryTaskList extends Wizard } if ($task['disabled'] == 0 && $server_name !== '') { - $data[0] = ''; - $data[0] .= html_print_image('images/target.png', true, ['title' => __('Force')]); - $data[0] .= ''; + if (check_acl($config['id_user'], 0, 'AW')) { + $data[0] = ''; + $data[0] .= html_print_image('images/target.png', true, ['title' => __('Force')]); + $data[0] .= ''; + } } else if ($task['disabled'] == 2) { $data[0] = ui_print_help_tip( __('This task has not been completely defined, please edit it'), @@ -622,18 +622,20 @@ class DiscoveryTaskList extends Wizard && $task['type'] != DISCOVERY_APP_ORACLE && $task['type'] != DISCOVERY_CLOUD_AWS_RDS ) { - $data[9] .= ''; - $data[9] .= html_print_image( - 'images/dynamic_network_icon.png', - true - ); - $data[9] .= ''; + if (check_acl($config['id_user'], 0, 'MR')) { + $data[9] .= ''; + $data[9] .= html_print_image( + 'images/dynamic_network_icon.png', + true + ); + $data[9] .= ''; + } } if (check_acl( $config['id_user'], $task['id_group'], - 'PM' + 'AW' ) ) { if ($ipam === true) { @@ -733,6 +735,16 @@ class DiscoveryTaskList extends Wizard { if ($script !== false) { switch ($script['type']) { + case DISCOVERY_SCRIPT_APP_VMWARE: + return 'wiz=app&mode=vmware&page=0'; + + case DISCOVERY_SCRIPT_IPAM_RECON: + return ''; + + case DISCOVERY_SCRIPT_IPMI_RECON: + default: + return 'wiz=hd&mode=customnetscan'; + case DISCOVERY_SCRIPT_CLOUD_AWS: switch ($task['type']) { case DISCOVERY_CLOUD_AWS_EC2: @@ -744,16 +756,6 @@ class DiscoveryTaskList extends Wizard default: return 'wiz=cloud'; } - - case DISCOVERY_SCRIPT_APP_VMWARE: - return 'wiz=app&mode=vmware&page=0'; - - case DISCOVERY_SCRIPT_IPAM_RECON: - return ''; - - case DISCOVERY_SCRIPT_IPMI_RECON: - default: - return 'wiz=hd&mode=customnetscan'; } } diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index fb9fba2cdd..fd7811f2e9 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -87,6 +87,7 @@ class HostDevices extends Wizard ) { $this->setBreadcrum([]); + $this->access = 'AW'; $this->task = []; $this->msg = $msg; $this->icon = $icon; @@ -100,6 +101,32 @@ class HostDevices extends Wizard } + /** + * Checks if environment is ready, + * returns array + * icon: icon to be displayed + * label: label to be displayed + * + * @return array With data. + **/ + public function load() + { + global $config; + // Check access. + check_login(); + + if (! $this->aclMulticheck('AW|PM')) { + return false; + } + + return [ + 'icon' => $this->icon, + 'label' => $this->label, + 'url' => $this->url, + ]; + } + + /** * Run wizard manager. * @@ -116,37 +143,42 @@ class HostDevices extends Wizard if ($mode === null) { $buttons = []; - $buttons[] = [ - 'url' => $this->url.'&mode=netscan', - 'icon' => 'images/wizard/netscan.png', - 'label' => __('Net Scan'), - ]; - if (enterprise_installed()) { + if (check_acl($config['id_user'], 0, $this->access)) { $buttons[] = [ - 'url' => $this->url.'&mode=importcsv', - 'icon' => ENTERPRISE_DIR.'/images/wizard/csv.png', - 'label' => __('Import CSV'), + 'url' => $this->url.'&mode=netscan', + 'icon' => 'images/wizard/netscan.png', + 'label' => __('Net Scan'), ]; + if (enterprise_installed()) { + $buttons[] = [ + 'url' => $this->url.'&mode=importcsv', + 'icon' => ENTERPRISE_DIR.'/images/wizard/csv.png', + 'label' => __('Import CSV'), + ]; + + $buttons[] = [ + 'url' => $this->url.'&mode=deploy', + 'icon' => ENTERPRISE_DIR.'/images/wizard/deployment.png', + 'label' => __('Agent deployment'), + ]; + } + $buttons[] = [ - 'url' => $this->url.'&mode=deploy', - 'icon' => ENTERPRISE_DIR.'/images/wizard/deployment.png', - 'label' => __('Agent deployment'), + 'url' => $this->url.'&mode=customnetscan', + 'icon' => '/images/wizard/customnetscan.png', + 'label' => __('Custom NetScan'), ]; } - $buttons[] = [ - 'url' => $this->url.'&mode=customnetscan', - 'icon' => '/images/wizard/customnetscan.png', - 'label' => __('Custom NetScan'), - ]; - - $buttons[] = [ - 'url' => $this->url.'&mode=managenetscanscripts', - 'icon' => '/images/wizard/managenetscanscripts.png', - 'label' => __('Manage NetScan scripts'), - ]; + if (check_acl($config['id_user'], 0, 'PM')) { + $buttons[] = [ + 'url' => $this->url.'&mode=managenetscanscripts', + 'icon' => '/images/wizard/managenetscanscripts.png', + 'label' => __('Manage NetScan scripts'), + ]; + } $this->prepareBreadcrum( [ @@ -311,11 +343,11 @@ class HostDevices extends Wizard ) { // Default values, no data received. // User is accesing directly to this page. - if (users_is_admin() !== true && check_acl( + if (check_acl( $config['id_usuario'], $this->task['id_group'], - 'PM' - ) !== true + $this->access + ) != true ) { $this->msg = __('You have no access to edit this task.'); return false; @@ -487,7 +519,7 @@ class HostDevices extends Wizard check_login(); - if (! check_acl($config['id_user'], 0, 'PM')) { + if (! check_acl($config['id_user'], 0, $this->access)) { db_pandora_audit( 'ACL Violation', 'Trying to access Agent Management' @@ -529,11 +561,11 @@ class HostDevices extends Wizard // Check ACL. If user is not able to manage target task, // redirect him to main page. - if (users_is_admin() !== true && check_acl( + if (check_acl( $config['id_usuario'], $this->task['id_group'], - 'PM' - ) !== true + $this->access + ) != true ) { $form['form']['action'] = $this->url.'&mode=netscan&page='.($this->page - 1); } @@ -750,7 +782,7 @@ class HostDevices extends Wizard [ 'name' => 'id_group', 'returnAllGroup' => false, - 'privilege' => 'PM', + 'privilege' => $this->access, 'type' => 'select_groups', 'selected' => $this->task['id_group'], 'return' => true, diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 3a65560285..cb29d78c06 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -87,6 +87,13 @@ class Wizard */ public $msg; + /** + * Defines access level to use this util. + * + * @var string + */ + public $access = 'AR'; + /** * Setter for breadcrum @@ -234,6 +241,42 @@ class Wizard public function run() { ui_require_css_file('wizard'); + // Check access. + check_login(); + + if (! $this->aclMulticheck()) { + return; + } + } + + + /** + * Check multiple acl perms. + * + * @param string $access Access in PM|AR|RR format. Optional. + * + * @return boolean Alowed or not. + */ + public function aclMulticheck($access=null) + { + global $config; + + if (isset($access)) { + $perms = explode('|', $access); + } else { + $perms = explode('|', $this->access); + } + + $allowed = false; + foreach ($perms as $perm) { + $allowed = $allowed || (bool) check_acl( + $config['id_user'], + 0, + $perm + ); + } + + return $allowed; } @@ -247,6 +290,14 @@ class Wizard **/ public function load() { + global $config; + // Check access. + check_login(); + + if (! $this->aclMulticheck()) { + return false; + } + return [ 'icon' => $this->icon, 'label' => $this->label, diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index dff9d227e1..77cf514158 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -65,6 +65,8 @@ class CustomNetScan extends Wizard $this->url = ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd' ); + + $this->access = 'AW'; $this->page = $page; $this->breadcrum = $breadcrum; } @@ -77,6 +79,8 @@ class CustomNetScan extends Wizard */ public function parseNetScan() { + global $config; + if (isset($this->page) === true && $this->page === 0) { // Check if we're updating a task. $task_id = get_parameter('task', null); @@ -145,11 +149,11 @@ class CustomNetScan extends Wizard ) { // Default values, no data received. // User is accesing directly to this page. - if (users_is_admin() !== true && check_acl( - $config['id_usuario'], + if (check_acl( + $config['id_user'], $this->task['id_group'], - 'PM' - ) !== true + $this->access + ) != true ) { $this->msg = __('You have no access to edit this task.'); return false; @@ -275,7 +279,7 @@ class CustomNetScan extends Wizard { global $config; - if (!check_acl($config['id_user'], 0, 'PM')) { + if (!check_acl($config['id_user'], 0, $this->access)) { db_pandora_audit( 'ACL Violation', 'Trying to access Custom Net Scan.' @@ -317,11 +321,11 @@ class CustomNetScan extends Wizard // Check ACL. If user is not able to manage target task, // redirect him to main page. - if (users_is_admin() !== true && check_acl( - $config['id_usuario'], + if (check_acl( + $config['id_user'], $this->task['id_group'], - 'PM' - ) !== true + $this->access + ) != true ) { $form['form']['action'] = $this->url.'&mode=customnetscan&page='.($this->page - 1); } @@ -496,7 +500,7 @@ class CustomNetScan extends Wizard 'arguments' => [ 'name' => 'id_group', 'returnAllGroup' => false, - 'privilege' => 'PM', + 'privilege' => $this->access, 'type' => 'select_groups', 'selected' => $this->task['id_group'], 'return' => true, diff --git a/pandora_console/include/class/ManageNetScanScripts.class.php b/pandora_console/include/class/ManageNetScanScripts.class.php index efc94cc8b6..c4a61bae37 100644 --- a/pandora_console/include/class/ManageNetScanScripts.class.php +++ b/pandora_console/include/class/ManageNetScanScripts.class.php @@ -65,6 +65,8 @@ class ManageNetScanScripts extends Wizard $this->url = ui_get_full_url( 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd' ); + + $this->access = 'PM'; $this->page = $page; $this->breadcrum = $breadcrum; } @@ -81,7 +83,7 @@ class ManageNetScanScripts extends Wizard { global $config; - if (check_acl($config['id_user'], 0, 'AW') === 0) { + if (check_acl($config['id_user'], 0, $this->access) === 0) { db_pandora_audit( 'ACL Violation', 'Trying to access Net Scan Script.' From 43261bd3f85c5725c16743e6bfabcc5e440220ba Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 9 Oct 2019 15:46:44 +0200 Subject: [PATCH 37/56] Changed parameter of use_xml_timestamp --- pandora_server/lib/PandoraFMS/DataServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index b7beb919a3..df1cbbecfb 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -230,7 +230,7 @@ sub data_consumer ($$) { } # Ignore the timestamp in the XML and use the file timestamp instead - $xml_data->{'timestamp'} = strftime ("%Y-%m-%d %H:%M:%S", localtime((stat($file_name))[9])) if ($pa_config->{'use_xml_timestamp'} eq '1' || ! defined ($xml_data->{'timestamp'})); + $xml_data->{'timestamp'} = strftime ("%Y-%m-%d %H:%M:%S", localtime((stat($file_name))[9])) if ($pa_config->{'use_xml_timestamp'} eq '0' || ! defined ($xml_data->{'timestamp'})); # Double check that the file exists if (! -f $file_name) { From cc58cd6515d8fce9f7ca690317aded8771dd890e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 9 Oct 2019 18:09:09 +0200 Subject: [PATCH 38/56] get_agent_name_from_addr => get_agent_from_addr --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 6762e79b4f..d1228e9ae0 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -431,14 +431,14 @@ sub PandoraFMS::Recon::Base::connect_agents($$$$$) { my ($self, $dev_1, $if_1, $dev_2, $if_2) = @_; # Get the agent for the first device. - my $agent_1 = get_agent_name_from_addr($self->{'dbh'}, $dev_1); + my $agent_1 = get_agent_from_addr($self->{'dbh'}, $dev_1); if (!defined($agent_1)) { $agent_1 = get_agent_from_name($self->{'dbh'}, $dev_1); } return unless defined($agent_1); # Get the agent for the second device. - my $agent_2 = get_agent_name_from_addr($self->{'dbh'}, $dev_2); + my $agent_2 = get_agent_from_addr($self->{'dbh'}, $dev_2); if (!defined($agent_2)) { $agent_2 = get_agent_from_name($self->{'dbh'}, $dev_2); } @@ -912,14 +912,14 @@ sub PandoraFMS::Recon::Base::set_parent($$$) { return unless ($self->{'parent_detection'} == 1); # Get the agent for the host. - my $agent = get_agent_name_from_addr($self->{'dbh'}, $host); + my $agent = get_agent_from_addr($self->{'dbh'}, $host); if (!defined($agent)) { $agent = get_agent_from_name($self->{'dbh'}, $host); } return unless defined($agent); # Check if the parent agent exists. - my $agent_parent = get_agent_name_from_addr($self->{'dbh'}, $parent); + my $agent_parent = get_agent_from_addr($self->{'dbh'}, $parent); if (!defined($agent_parent)) { $agent_parent = get_agent_from_name($self->{'dbh'}, $parent); } From edb3c806ce593303c680f7f60f9b7db7703d6a71 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 10 Oct 2019 00:01:08 +0200 Subject: [PATCH 39/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2d7403bb23..dce71a69e6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191009 +Version: 7.0NG.739-191010 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 1b58195105..2bb60b6dc0 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.739-191009" +pandora_version="7.0NG.739-191010" 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 fc707cb991..938c2a118b 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.739'; -use constant AGENT_BUILD => '191009'; +use constant AGENT_BUILD => '191010'; # 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 7a2a572fd7..84b91f0312 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.739 -%define release 191009 +%define release 191010 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 41796d7ce2..d2d7d171b6 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.739 -%define release 191009 +%define release 191010 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 9edfa4dcf8..2af109b6ef 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191009" +PI_BUILD="191010" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e04742ed10..90fd039fcb 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191009} +{191010} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 70d7a193c1..dfaad586fc 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.739(Build 191009)") +#define PANDORA_VERSION ("7.0NG.739(Build 191010)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 114c76e046..cbcc247ca4 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.739(Build 191009))" + VALUE "ProductVersion", "(7.0NG.739(Build 191010))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9be8c7bf0b..498016fd27 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191009 +Version: 7.0NG.739-191010 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 4ac26886d9..bb0f6fe253 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.739-191009" +pandora_version="7.0NG.739-191010" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ee12eaa36d..25b2b0b7ae 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191009'; +$build_version = 'PC191010'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 61c9e376fa..f16ef72c72 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 425636aa97..e4370a41b7 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.739 -%define release 191009 +%define release 191010 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a532f5d33e..39180c91ca 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.739 -%define release 191009 +%define release 191010 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d72dae943a..302c4355a7 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191009" +PI_BUILD="191010" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 80e9193355..b1e06cb14d 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.739 PS191009"; +my $version = "7.0NG.739 PS191010"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5faea24aa2..0365db0acf 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191009"; +my $version = "7.0NG.739 PS191010"; # save program name for logging my $progname = basename($0); From fc0e4827eac7fcf0a121ba994b39a9b24365aeff Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 10 Oct 2019 13:37:01 +0200 Subject: [PATCH 40/56] No change interval if is empty in massive edit - #4784 --- pandora_console/godmode/massive/massive_edit_agents.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 0126aa93f9..83001be810 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -59,8 +59,10 @@ if ($update_agents) { $values['id_grupo'] = get_parameter('group'); } - if (get_parameter('interval', 0) != 0) { - $values['intervalo'] = get_parameter('interval'); + if (!(get_parameter('interval_select') == -1 && empty(get_parameter('interval_text')))) { + if (get_parameter('interval', 0) != 0) { + $values['intervalo'] = get_parameter('interval'); + } } if (get_parameter('id_os', '') != -1) { @@ -523,7 +525,7 @@ $table->data[1][1] = html_print_select_groups(false, 'AR', false, 'group', $grou $table->data[2][0] = __('Interval'); -$table->data[2][1] = html_print_extended_select_for_time('interval', 0, '', __('No change'), '0', 10, true, 'width: 150px'); +$table->data[2][1] = html_print_extended_select_for_time('interval', 0, '', __('No change'), '0', 10, true, 'width: 150px', false); $table->data[3][0] = __('OS'); $table->data[3][1] = html_print_select_from_sql( From 0433718612c7fd8c3cbb567660a506b138b1d48e Mon Sep 17 00:00:00 2001 From: Kike Date: Thu, 10 Oct 2019 14:07:22 +0200 Subject: [PATCH 41/56] Allowed several destination numbers in a single script call --- pandora_server/util/pandora_smpp.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/util/pandora_smpp.pl b/pandora_server/util/pandora_smpp.pl index af85d496f5..720d0e9589 100755 --- a/pandora_server/util/pandora_smpp.pl +++ b/pandora_server/util/pandora_smpp.pl @@ -19,7 +19,7 @@ Usage: $0 -server -user -password -source -destination -message [OPTIONS] -- Comma separated list of destination numbers (+123456789,+234567891,...) +- Comma separated list of destination numbers (123456789,234567891,...) OPTIONS: @@ -45,7 +45,7 @@ OPTIONS: Example: -$0 -server 192.168.1.50:2775 -user myuser -password mypassword -source +123456789 -destination +234567891 -message "Content of SMS message" +$0 -server 192.168.1.50:2775 -user myuser -password mypassword -source 123456789 -destination 234567891 -message "Content of SMS message" EO_H @@ -85,7 +85,7 @@ if (!$config->{'message'}){ my ($smsc_server, $smsc_port) = split /:/, $config->{'server'}; -my @destination_numbers = $config->{'destination'}; +my @destination_numbers = split /,/, $config->{'destination'}; if (!$smsc_port){ $smsc_port = 2775; From f1ec7d23397a367fe3eefc56ed118d31a59d86e6 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 10 Oct 2019 17:23:19 +0200 Subject: [PATCH 42/56] minor fix in str comparison --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index d1228e9ae0..51abd3c022 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -585,7 +585,7 @@ sub PandoraFMS::Recon::Base::create_agent($$) { # Resolve hostnames. my $host_name = (($self->{'resolve_names'} == 1) ? gethostbyaddr(inet_aton($device), AF_INET) : $device); # Fallback to device IP if host name could not be resolved. - $host_name = $device if (!defined($host_name) || $host_name == ''); + $host_name = $device if (!defined($host_name) || $host_name eq ''); my $agent = locate_agent($self->{'pa_config'}, $self->{'dbh'}, $host_name); my ($agent_id, $agent_learning); From 97f246ae60cb2fed95a7b840f31cbf95d67b6939 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 10 Oct 2019 17:28:02 +0200 Subject: [PATCH 43/56] discovery os detection --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 51abd3c022..1ab91839e7 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -360,8 +360,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) { if (-x $self->{'pa_config'}->{'xprobe2'}) { my $return = `"$self->{pa_config}->{xprobe2}" $device 2>$DEVNULL`; if ($? == 0) { - my ($output) = $a =~ /Running OS:(.*)/; - return pandora_get_os($self->{'dbh'}, $output); + if($return =~ /Running OS:(.*)/) { + return pandora_get_os($self->{'dbh'}, $1); + } } } @@ -370,8 +371,9 @@ sub PandoraFMS::Recon::Base::guess_os($$) { my $return = `"$self->{pa_config}->{nmap}" -F -O $device 2>$DEVNULL`; return OS_OTHER if ($? != 0); - my ($output) = $return =~ /Aggressive OS guesses:\s*(.*)/; - return pandora_get_os($self->{'dbh'}, $output); + if ($return =~ /Aggressive OS guesses:\s*(.*)/) { + return pandora_get_os($self->{'dbh'}, $1); + } } return OS_OTHER; From fb4f4b40463b1a5bea1159e03d0f4c3e117264a4 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 10 Oct 2019 17:31:57 +0200 Subject: [PATCH 44/56] minor error cleanup --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 1ab91839e7..7d90ff411a 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -538,7 +538,7 @@ sub PandoraFMS::Recon::Base::create_agents($$) { return undef; } - if ($agent->{'address'} ne '') { + if (defined($agent->{'address'}) && $agent->{'address'} ne '') { pandora_add_agent_address( $pa_config, $agent_id, $agent->{'agent_name'}, $agent->{'address'}, $dbh From 9a165dc9d8d920a1f0f6a657647e690e6d8fc3fb Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 11 Oct 2019 00:01:08 +0200 Subject: [PATCH 45/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index dce71a69e6..20c3b4b06b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191010 +Version: 7.0NG.739-191011 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 2bb60b6dc0..c9ae4c3432 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.739-191010" +pandora_version="7.0NG.739-191011" 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 938c2a118b..da90764344 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.739'; -use constant AGENT_BUILD => '191010'; +use constant AGENT_BUILD => '191011'; # 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 84b91f0312..5eef934b38 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.739 -%define release 191010 +%define release 191011 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 d2d7d171b6..cdcdc8dada 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.739 -%define release 191010 +%define release 191011 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 2af109b6ef..fce0f526b8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191010" +PI_BUILD="191011" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 90fd039fcb..53f8fed466 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191010} +{191011} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index dfaad586fc..66f2e17ce5 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.739(Build 191010)") +#define PANDORA_VERSION ("7.0NG.739(Build 191011)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index cbcc247ca4..741fd096c8 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.739(Build 191010))" + VALUE "ProductVersion", "(7.0NG.739(Build 191011))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 498016fd27..c9f68147ae 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191010 +Version: 7.0NG.739-191011 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 bb0f6fe253..a8ef06811d 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.739-191010" +pandora_version="7.0NG.739-191011" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 25b2b0b7ae..b659ff82e1 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191010'; +$build_version = 'PC191011'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f16ef72c72..f1e4aa5eb7 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index e4370a41b7..d7629ec337 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.739 -%define release 191010 +%define release 191011 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 39180c91ca..af6ddfb37b 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.739 -%define release 191010 +%define release 191011 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 302c4355a7..71f5bcee08 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191010" +PI_BUILD="191011" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b1e06cb14d..32f76783cb 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.739 PS191010"; +my $version = "7.0NG.739 PS191011"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0365db0acf..f6d73cd4b0 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191010"; +my $version = "7.0NG.739 PS191011"; # save program name for logging my $progname = basename($0); From a69cfb63f1f594a8fb16e2a5b8baab3cad78b3f3 Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 11 Oct 2019 09:04:13 +0200 Subject: [PATCH 46/56] Fixed bug in histogram graph report --- .../include/graphs/flot/pandora.flot.js | 56 +++++++++++-------- .../include/graphs/functions_flot.php | 39 +++---------- pandora_console/include/styles/pandora.css | 15 +++++ 3 files changed, 58 insertions(+), 52 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index c62614ccd3..6387bf5442 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -172,7 +172,6 @@ function pandoraFlotPieCustom( show: true, radius: 5 / 8, formatter: function(label, series) { - console.log(series); return ( '
" + + (d.getHours() < 10 ? "0" : "") + + d.getHours() + ":" + - (v.getMinutes() < 10 ? "0" : "") + - v.getMinutes(); + (d.getMinutes() < 10 ? "0" : "") + + d.getMinutes(); return date_format; } } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 309ddf364b..eb5596cec4 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -786,6 +786,8 @@ function flot_slicesbar_graph( // Get a unique identifier to graph $graph_id = uniqid('graph_'); + $height = ((int) $height + 15); + // Set some containers to legend, graph, timestamp tooltip, etc. if ($stat_win) { $return = "
"; @@ -804,8 +806,6 @@ function flot_slicesbar_graph( $separator2 = ':,:,,,:,:'; // Transform data from our format to library format - $labels = []; - $a = []; $vars = []; $datacolor = []; @@ -819,12 +819,12 @@ function flot_slicesbar_graph( $fontsize = $config['font_size']; $fontpath = $config['fontpath']; - $extra_height = 15; + $extra_height = 40; if (defined('METACONSOLE')) { - $extra_height = 20; + $extra_height = 50; } - $return .= "
"; + $return .= ''; $maxticks = (int) 20; @@ -842,11 +842,7 @@ function flot_slicesbar_graph( $intervaltick = (int) $intervaltick; - $acumulate = 0; - $c = 0; - $acumulate_data = []; foreach ($graph_data as $label => $values) { - $labels[] = $label; $i--; foreach ($values as $key => $value) { @@ -857,19 +853,10 @@ function flot_slicesbar_graph( } $data[$jsvar][] = $value; - - $acumulate_data[$c] = $acumulate; - $acumulate += $value; - $c++; - - if ($value > $max) { - $max = $value; - } } } - // Store serialized data to use it from javascript - $labels = implode($separator, $labels); + // Store serialized data to use it from javascript. $datacolor = implode($separator, $datacolor); if (is_array($legend)) { $legend = io_safe_output(implode($separator, $legend)); @@ -881,19 +868,11 @@ function flot_slicesbar_graph( $full_legend_date = false; } - $acumulate_data = io_safe_output(implode($separator, $acumulate_data)); - - // Store data series in javascript format - $jsvars = ''; - $jsseries = []; - $date = get_system_time(); - $datelimit = (($date - $period) * 1000); + $datelimit = (($date - $period)); $i = 0; - $values2 = []; - foreach ($data as $jsvar => $values) { $values2[] = implode($separator, $values); $i ++; @@ -901,10 +880,10 @@ function flot_slicesbar_graph( $values = implode($separator2, $values2); - // Javascript code + // Javascript code. $return .= "'; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 27b3094027..459cc5c54d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5888,3 +5888,18 @@ table.table_modal_alternate tr td:first-child { .fullwidth { width: 100%; } + +.slicebar-box-hover-styles { + position: absolute; + background-color: #fff; + width: 80px; + height: 20px; + text-align: center; + font-family: arial, sans-serif, verdana; + padding: 3px; + border: 1px solid black; +} + +.flot-text { + width: 101%; +} From 5ffa93bb2530e01452cb95d26611fc7873c935c1 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Fri, 11 Oct 2019 13:49:19 +0200 Subject: [PATCH 47/56] Modified character for string fusion --- pandora_console/godmode/servers/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index 3eb385332c..79fcfc61a2 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -928,10 +928,10 @@ if (($create != '') || ($view != '')) { $other['plugin_type'] = $plugin_meta['plugin_type']; $other['macros'] = urlencode($plugin_meta['macros']); $other['parameters'] = urlencode($plugin_meta['parameters']); - $other = implode('%7C', $other); + $other = implode('%7E', $other); $auth_token = json_decode($value['auth_token']); - $url = $value['server_url'].'include/api.php?op=set&op2=push_plugin'.'&id='.$pluginid.'&other_mode=url_encode_separator_%7C&other='.$other."&apipass=$auth_token->api_password"."&user=$auth_token->console_user&pass=$auth_token->console_password"; + $url = $value['server_url'].'include/api.php?op=set&op2=push_plugin'.'&id='.$pluginid.'&other_mode=url_encode_separator_%7E&other='.$other."&apipass=$auth_token->api_password"."&user=$auth_token->console_user&pass=$auth_token->console_password"; $file_path = realpath($plugin_meta['execute']); $post = ''; if (file_exists($file_path)) { From df2acbce9601c3488c6922ef68b889f5fb108e1c Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 12 Oct 2019 00:01:10 +0200 Subject: [PATCH 48/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 20c3b4b06b..29f8c6a101 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191011 +Version: 7.0NG.739-191012 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 c9ae4c3432..110ef9afad 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.739-191011" +pandora_version="7.0NG.739-191012" 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 da90764344..cc3e9352a3 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.739'; -use constant AGENT_BUILD => '191011'; +use constant AGENT_BUILD => '191012'; # 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 5eef934b38..5092319a98 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.739 -%define release 191011 +%define release 191012 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 cdcdc8dada..1277c7b930 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.739 -%define release 191011 +%define release 191012 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 fce0f526b8..dc8f0b8bbc 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191011" +PI_BUILD="191012" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 53f8fed466..88a56842c6 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191011} +{191012} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 66f2e17ce5..ce08a5bd7f 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.739(Build 191011)") +#define PANDORA_VERSION ("7.0NG.739(Build 191012)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 741fd096c8..b46cfe63da 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.739(Build 191011))" + VALUE "ProductVersion", "(7.0NG.739(Build 191012))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c9f68147ae..6d29a993f5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191011 +Version: 7.0NG.739-191012 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 a8ef06811d..bd821d4bc0 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.739-191011" +pandora_version="7.0NG.739-191012" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b659ff82e1..ca6919b55b 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191011'; +$build_version = 'PC191012'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f1e4aa5eb7..846955b6c2 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d7629ec337..6e64b4f1a2 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.739 -%define release 191011 +%define release 191012 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index af6ddfb37b..92a3524a2d 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.739 -%define release 191011 +%define release 191012 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 71f5bcee08..ab92030bcc 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191011" +PI_BUILD="191012" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 32f76783cb..6b8f4902b2 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.739 PS191011"; +my $version = "7.0NG.739 PS191012"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f6d73cd4b0..c2f3366369 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191011"; +my $version = "7.0NG.739 PS191012"; # save program name for logging my $progname = basename($0); From 838fcfa3a1745fbb69e34ab080c2a8e65d4ccde0 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 13 Oct 2019 00:01:06 +0200 Subject: [PATCH 49/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 29f8c6a101..da163c2e95 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191012 +Version: 7.0NG.739-191013 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 110ef9afad..a582ee38b4 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.739-191012" +pandora_version="7.0NG.739-191013" 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 cc3e9352a3..721ee2d418 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.739'; -use constant AGENT_BUILD => '191012'; +use constant AGENT_BUILD => '191013'; # 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 5092319a98..f292a00501 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.739 -%define release 191012 +%define release 191013 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 1277c7b930..10b17f72bb 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.739 -%define release 191012 +%define release 191013 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 dc8f0b8bbc..ea2235e6a0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191012" +PI_BUILD="191013" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 88a56842c6..c67e45d487 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191012} +{191013} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ce08a5bd7f..7cedfd86cc 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.739(Build 191012)") +#define PANDORA_VERSION ("7.0NG.739(Build 191013)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b46cfe63da..b39f0637cb 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.739(Build 191012))" + VALUE "ProductVersion", "(7.0NG.739(Build 191013))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6d29a993f5..85afaaa30f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191012 +Version: 7.0NG.739-191013 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 bd821d4bc0..6ef0e0de82 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.739-191012" +pandora_version="7.0NG.739-191013" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ca6919b55b..9f1ec276a0 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191012'; +$build_version = 'PC191013'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 846955b6c2..e66b9c0e13 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6e64b4f1a2..71ff687806 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.739 -%define release 191012 +%define release 191013 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 92a3524a2d..7262389918 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.739 -%define release 191012 +%define release 191013 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index ab92030bcc..b7a41c21a4 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191012" +PI_BUILD="191013" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6b8f4902b2..cbec20e34e 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.739 PS191012"; +my $version = "7.0NG.739 PS191013"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c2f3366369..b5567817e0 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191012"; +my $version = "7.0NG.739 PS191013"; # save program name for logging my $progname = basename($0); From 83b16d9d84599cbd871b4893c554ae193d6fdc03 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 14 Oct 2019 00:01:07 +0200 Subject: [PATCH 50/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index da163c2e95..f81e0e0fde 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191013 +Version: 7.0NG.739-191014 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 a582ee38b4..ba4fe7ddb4 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.739-191013" +pandora_version="7.0NG.739-191014" 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 721ee2d418..278d7b3dda 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.739'; -use constant AGENT_BUILD => '191013'; +use constant AGENT_BUILD => '191014'; # 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 f292a00501..477e830a4f 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.739 -%define release 191013 +%define release 191014 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 10b17f72bb..6845ec500a 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.739 -%define release 191013 +%define release 191014 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 ea2235e6a0..c7c23c14b8 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191013" +PI_BUILD="191014" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c67e45d487..45f4c15eb3 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191013} +{191014} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7cedfd86cc..d21805caae 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.739(Build 191013)") +#define PANDORA_VERSION ("7.0NG.739(Build 191014)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b39f0637cb..97d18913a8 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.739(Build 191013))" + VALUE "ProductVersion", "(7.0NG.739(Build 191014))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 85afaaa30f..7f8484cad1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191013 +Version: 7.0NG.739-191014 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 6ef0e0de82..9d7613ec99 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.739-191013" +pandora_version="7.0NG.739-191014" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 9f1ec276a0..e3f5446c77 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191013'; +$build_version = 'PC191014'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e66b9c0e13..796abccfce 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 71ff687806..34b90d8332 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.739 -%define release 191013 +%define release 191014 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7262389918..16582f4b98 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.739 -%define release 191013 +%define release 191014 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b7a41c21a4..9681fabf94 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191013" +PI_BUILD="191014" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index cbec20e34e..8ca3b5de17 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.739 PS191013"; +my $version = "7.0NG.739 PS191014"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index b5567817e0..cef887f2ce 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191013"; +my $version = "7.0NG.739 PS191014"; # save program name for logging my $progname = basename($0); From a1c4b3eaebd14fb069ffb6e6e8035a05225ec846 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Mon, 14 Oct 2019 13:38:10 +0200 Subject: [PATCH 51/56] Fixed minor bug --- pandora_console/godmode/agentes/agent_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 6ee2343fc0..d6b9448576 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -765,7 +765,7 @@ $table_adv_agent_icon .= html_print_select( ).'
'; if ($config['activate_gis']) { - $table_adv_gis = '

'.__('Ignore new GIS data:').'

'; + $table_adv_gis = '

'.__('Update new GIS data:').'

'; if ($new_agent) { $update_gis_data = true; } From 6c21d57677f21b9e3dbf5b604246ddfdc79acf82 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 15 Oct 2019 00:01:09 +0200 Subject: [PATCH 52/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f81e0e0fde..08554ce1e5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191014 +Version: 7.0NG.739-191015 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 ba4fe7ddb4..a997ed713c 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.739-191014" +pandora_version="7.0NG.739-191015" 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 278d7b3dda..0e994aa74a 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.739'; -use constant AGENT_BUILD => '191014'; +use constant AGENT_BUILD => '191015'; # 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 477e830a4f..d10d761b86 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.739 -%define release 191014 +%define release 191015 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 6845ec500a..d03efdb951 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.739 -%define release 191014 +%define release 191015 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 c7c23c14b8..e47e29a119 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191014" +PI_BUILD="191015" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 45f4c15eb3..cdc7111f61 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191014} +{191015} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d21805caae..569e05a5eb 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.739(Build 191014)") +#define PANDORA_VERSION ("7.0NG.739(Build 191015)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 97d18913a8..6031dda5bf 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.739(Build 191014))" + VALUE "ProductVersion", "(7.0NG.739(Build 191015))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7f8484cad1..664f92f369 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191014 +Version: 7.0NG.739-191015 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 9d7613ec99..ead133d112 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.739-191014" +pandora_version="7.0NG.739-191015" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e3f5446c77..1c8db17f6d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191014'; +$build_version = 'PC191015'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 796abccfce..b4c22d1c6f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 34b90d8332..fbbe2003ad 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.739 -%define release 191014 +%define release 191015 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 16582f4b98..6706bafb3f 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.739 -%define release 191014 +%define release 191015 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9681fabf94..7600147894 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191014" +PI_BUILD="191015" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8ca3b5de17..f707c134c0 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.739 PS191014"; +my $version = "7.0NG.739 PS191015"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index cef887f2ce..0c312baf48 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191014"; +my $version = "7.0NG.739 PS191015"; # save program name for logging my $progname = basename($0); From 89843fcc3b6c9d335f6373a4d1796cb672964635 Mon Sep 17 00:00:00 2001 From: Marcos Alconada Date: Tue, 15 Oct 2019 11:13:40 +0200 Subject: [PATCH 53/56] Update functions_ui --- pandora_console/include/functions_ui.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 4540a2f923..5f1e562170 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5681,6 +5681,11 @@ function ui_print_comments($comments) // Only show the last comment. If commment its too long,the comment will short with ... // If $config['prominent_time'] is timestamp the date show Month, day, hour and minutes. // Else show comments hours ago + + if ($last_comment[0][0]['action'] != 'Added comment'){ + $last_comment[0][0]['comment'] = $last_comment[0][0]['action']; + } + $short_comment = substr($last_comment[0][0]['comment'], 0, '80px'); if ($config['prominent_time'] == 'timestamp') { $comentario = ''.date($config['date_format'], $last_comment[0][0]['utimestamp']).' ('.$last_comment[0][0]['id_user'].'): '.$last_comment[0][0]['comment'].''; From 7d4b75c4b3eb0436a28f7a86805826ffdc035638 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 15 Oct 2019 17:04:08 +0200 Subject: [PATCH 54/56] Solved an issue with uninizialized variable --- pandora_server/lib/PandoraFMS/Tools.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 85248ed99b..f6a68372fc 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -651,15 +651,18 @@ sub logger ($$;$) { } else { # Obtain the script that invoke this log my $parent_caller = ""; - if (($parent_caller = ( caller(2) )[1]) ne "") { + $parent_caller = ( caller(2) )[1]; + if (defined $parent_caller) { $parent_caller = (split '/', $parent_caller)[-1]; $parent_caller =~ s/\.[^.]+$//; - $parent_caller = " ** " . $parent_caller . " **:"; + $parent_caller = " ** " . $parent_caller . " **: "; + } else { + $parent_caller = " "; } open (FILE, ">> $file") or die "[FATAL] Could not open logfile '$file'"; # Get an exclusive lock on the file (LOCK_EX) flock (FILE, 2); - print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . $parent_caller . " " . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n"; + print FILE strftime ("%Y-%m-%d %H:%M:%S", localtime()) . $parent_caller . (defined($pa_config->{'servername'}) ? $pa_config->{'servername'} : '') . " [V". $level ."] " . $message . "\n"; close (FILE); } } From a3a456da92936e77a516bd71d37de4b627e12887 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 16 Oct 2019 00:01:08 +0200 Subject: [PATCH 55/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 08554ce1e5..952fce2bf6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191015 +Version: 7.0NG.739-191016 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 a997ed713c..ce28530dc2 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.739-191015" +pandora_version="7.0NG.739-191016" 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 0e994aa74a..7ed5724401 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.739'; -use constant AGENT_BUILD => '191015'; +use constant AGENT_BUILD => '191016'; # 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 d10d761b86..1411ce0c15 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.739 -%define release 191015 +%define release 191016 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 d03efdb951..6beee75f2f 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.739 -%define release 191015 +%define release 191016 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 e47e29a119..8235889a28 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191015" +PI_BUILD="191016" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cdc7111f61..c434d1464b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191015} +{191016} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 569e05a5eb..d50d906503 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.739(Build 191015)") +#define PANDORA_VERSION ("7.0NG.739(Build 191016)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 6031dda5bf..3fb40a9350 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.739(Build 191015))" + VALUE "ProductVersion", "(7.0NG.739(Build 191016))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 664f92f369..cbcc04eb69 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191015 +Version: 7.0NG.739-191016 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 ead133d112..458fb4fd69 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.739-191015" +pandora_version="7.0NG.739-191016" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1c8db17f6d..fa5a10804e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191015'; +$build_version = 'PC191016'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b4c22d1c6f..114a296a60 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index fbbe2003ad..763be1b39c 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.739 -%define release 191015 +%define release 191016 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6706bafb3f..dd79f8c5a9 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.739 -%define release 191015 +%define release 191016 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7600147894..c566df931e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191015" +PI_BUILD="191016" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index f707c134c0..5e286fdea1 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.739 PS191015"; +my $version = "7.0NG.739 PS191016"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0c312baf48..194fa2d9f3 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191015"; +my $version = "7.0NG.739 PS191016"; # save program name for logging my $progname = basename($0); From 361f2022f4f4c0080a88aab465e4b5c8fa71a096 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 17 Oct 2019 00:01:10 +0200 Subject: [PATCH 56/56] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 952fce2bf6..e3451f29f0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.739-191016 +Version: 7.0NG.739-191017 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 ce28530dc2..f1dca77dff 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.739-191016" +pandora_version="7.0NG.739-191017" 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 7ed5724401..4628861d02 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.739'; -use constant AGENT_BUILD => '191016'; +use constant AGENT_BUILD => '191017'; # 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 1411ce0c15..5c3ff6fbab 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.739 -%define release 191016 +%define release 191017 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 6beee75f2f..25d7adc36a 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.739 -%define release 191016 +%define release 191017 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 8235889a28..e84b3e8ba4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191016" +PI_BUILD="191017" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c434d1464b..13dc69e5ee 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{191016} +{191017} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d50d906503..73132d3124 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.739(Build 191016)") +#define PANDORA_VERSION ("7.0NG.739(Build 191017)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3fb40a9350..0592f5a8e2 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.739(Build 191016))" + VALUE "ProductVersion", "(7.0NG.739(Build 191017))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index cbcc04eb69..dbd51ba15b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.739-191016 +Version: 7.0NG.739-191017 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 458fb4fd69..c88aec37cb 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.739-191016" +pandora_version="7.0NG.739-191017" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index fa5a10804e..8331ff97e6 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC191016'; +$build_version = 'PC191017'; $pandora_version = 'v7.0NG.739'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 114a296a60..0849f949b1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 763be1b39c..c2c68c7709 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.739 -%define release 191016 +%define release 191017 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index dd79f8c5a9..f30b64f520 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.739 -%define release 191016 +%define release 191017 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index c566df931e..8bb17cdccc 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.739" -PI_BUILD="191016" +PI_BUILD="191017" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5e286fdea1..67405161a0 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.739 PS191016"; +my $version = "7.0NG.739 PS191017"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 194fa2d9f3..4612a20358 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.739 PS191016"; +my $version = "7.0NG.739 PS191017"; # save program name for logging my $progname = basename($0);