From b8282a5cb1b8c38c7b409074254035aba92da3f7 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 23 Mar 2015 14:19:46 +0100 Subject: [PATCH 01/19] Added support to show the interface traffic graphs through the metaconsole and improved the ACL (cherry picked from commit fa9db9010cac637088e2d8cfa4ef4904f4dd115c) --- .../include/functions_treeview.php | 21 ++---- .../agentes/interface_traffic_graph_win.php | 66 +++++++++++-------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index e6ed843d2b..bc4575321b 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -545,30 +545,23 @@ function treeview_printTable($id_agente, $server_data = array()) { $table->data = array(); foreach ($network_interfaces as $interface_name => $interface) { - if (!empty($interface['traffic'])) { + if (!empty($interface['traffic']) && check_acl($config['id_user'], $agent["id_grupo"], "RR")) { $params = array( 'interface_name' => $interface_name, 'agent_id' => $id_agente, 'traffic_module_in' => $interface['traffic']['in'], 'traffic_module_out' => $interface['traffic']['out'] ); + + if (defined('METACONSOLE') && !empty($server_id)) + $params["server"] = $server_id; + $params_json = json_encode($params); $params_encoded = base64_encode($params_json); + $url = ui_get_full_url("operation/agentes/interface_traffic_graph_win.php", false, false, false); + $graph_url = "$url?params=$params_encoded"; $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); - $graph_url = ''; - if (!defined('METACONSOLE')) { - $graph_url = $config['homeurl'] . - "operation/agentes/interface_traffic_graph_win.php?" . - "params=$params_encoded"; - } - else if (!empty($server_data)) { - $graph_url = ui_meta_get_url_console_child( - $server_data, null, null, null, null, - "operation/agentes/interface_traffic_graph_win.php?" . - "params=$params_encoded"); - } - $graph_link = "" . html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . ""; } diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index ad95fbd6d8..bbf94e46d1 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -29,23 +29,27 @@ require_once ($config['homedir'] . '/include/functions_graph.php'); require_once ($config['homedir'] . '/include/functions_custom_graphs.php'); require_once ($config['homedir'] . '/include/functions_modules.php'); -// Hash login process -if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) { - $loginhash_data = get_parameter("loginhash_data", ""); - $loginhash_user = str_rot13(get_parameter("loginhash_user", "")); - - if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { - db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION['id_usuario'] = $loginhash_user; - $config["id_user"] = $loginhash_user; - - $hash_connection_data = true; - } - -} - check_login(); +$params_json = base64_decode((string) get_parameter('params')); +$params = json_decode($params_json, true); + +// Metaconsole connection to the node +$server_id = (int) (isset($params['server']) ? $params['server'] : 0); +if (!empty($server_id) && function_exists("metaconsole_get_connection_by_id")) { + $server = metaconsole_get_connection_by_id($server_id); + + // Error connecting + if (metaconsole_connect($server) !== NOERR) { + echo ""; + echo ""; + ui_print_error_message(__('There was a problem connecting with the node')); + echo ""; + echo ""; + exit; + } +} + $user_language = get_user_language($config['id_user']); if (file_exists ('../../include/languages/'.$user_language.'.mo')) { $l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo')); @@ -54,9 +58,6 @@ if (file_exists ('../../include/languages/'.$user_language.'.mo')) { echo ''; -$params_json = base64_decode((string) get_parameter('params')); -$params = json_decode($params_json, true); - $interface_name = (string) $params['interface_name']; $agent_id = (int) $params['agent_id']; $interface_traffic_modules = array( @@ -106,6 +107,25 @@ $interface_traffic_modules = array( '; $side_layer_params['body_text'] .= html_print_input_hidden("params", base64_encode($params_json), true); - if (isset($hash_connection_data)) { - $side_layer_params['body_text'] .= - html_print_input_hidden("loginhash", "auto", true); - $side_layer_params['body_text'] .= - html_print_input_hidden("loginhash_data", $loginhash_data, true); - $side_layer_params['body_text'] .= - html_print_input_hidden("loginhash_user", - str_rot13($loginhash_user), true); - } - // FORM TABLE $table = html_get_predefined_table('transparent', 2); From 97bfae819cf21171bff5c91b33080d943941273d Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 25 Mar 2015 10:31:32 +0100 Subject: [PATCH 02/19] Change message when search and no find data. Tiquet: #2039 --- pandora_console/include/javascript/tree/TreeController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 6656a2b418..e3749cc043 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -22,7 +22,7 @@ TreeController = { index: -1, recipient: '', tree: [], - emptyMessage: "Empty", + emptyMessage: "No data found.", errorMessage: "Error", baseURL: "", ajaxURL: "ajax.php", @@ -709,7 +709,7 @@ TreeNodeDetailController = { type: 'none', id: -1, serverID: -1, - emptyMessage: "Empty", + emptyMessage: "No data found.", errorMessage: "Error", baseURL: "", ajaxURL: "ajax.php", From b945ee889243341ba6381983e187d81a6e2ebd9d Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 12:26:16 +0100 Subject: [PATCH 03/19] ACL improvements for the module graphs --- .../include/functions_treeview.php | 52 +++++++++++++------ .../agentes/estado_generalagente.php | 39 ++++++++++---- .../agentes/interface_traffic_graph_win.php | 21 ++++++-- 3 files changed, 79 insertions(+), 33 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index bc4575321b..44fc84b903 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -314,6 +314,8 @@ function treeview_printTable($id_agente, $server_data = array()) { enterprise_include_once ('meta/include/functions_ui_meta.php'); include_graphs_dependencies(); + $strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); + $is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente)); if ($is_extra === ENTERPRISE_NOT_HOOK) { @@ -545,25 +547,41 @@ function treeview_printTable($id_agente, $server_data = array()) { $table->data = array(); foreach ($network_interfaces as $interface_name => $interface) { - if (!empty($interface['traffic']) && check_acl($config['id_user'], $agent["id_grupo"], "RR")) { - $params = array( - 'interface_name' => $interface_name, - 'agent_id' => $id_agente, - 'traffic_module_in' => $interface['traffic']['in'], - 'traffic_module_out' => $interface['traffic']['out'] - ); + if (!empty($interface['traffic'])) { + $permission = false; - if (defined('METACONSOLE') && !empty($server_id)) - $params["server"] = $server_id; + if ($strict_user) { + if (tags_check_acl_by_module($interface['traffic']['in'], $config['id_user'], 'RR') === true + && tags_check_acl_by_module($interface['traffic']['out'], $config['id_user'], 'RR') === true) + $permission = true; + } + else { + $permission = check_acl($config['id_user'], $agent["id_grupo"], "RR"); + } - $params_json = json_encode($params); - $params_encoded = base64_encode($params_json); - $url = ui_get_full_url("operation/agentes/interface_traffic_graph_win.php", false, false, false); - $graph_url = "$url?params=$params_encoded"; - $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); - - $graph_link = "" . - html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . ""; + if ($permission) { + $params = array( + 'interface_name' => $interface_name, + 'agent_id' => $id_agente, + 'traffic_module_in' => $interface['traffic']['in'], + 'traffic_module_out' => $interface['traffic']['out'] + ); + + if (defined('METACONSOLE') && !empty($server_id)) + $params["server"] = $server_id; + + $params_json = json_encode($params); + $params_encoded = base64_encode($params_json); + $url = ui_get_full_url("operation/agentes/interface_traffic_graph_win.php", false, false, false); + $graph_url = "$url?params=$params_encoded"; + $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); + + $graph_link = "" . + html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . ""; + } + else { + $graph_link = ""; + } } else { $graph_link = ""; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 73104755ff..7ccc431211 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -29,6 +29,7 @@ include_once($config['homedir'] . "/include/functions_clippy.php"); check_login (); +$strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); $id_agente = get_parameter_get ("id_agente", -1); @@ -415,17 +416,33 @@ if (!empty($network_interfaces)) { foreach ($network_interfaces as $interface_name => $interface) { if (!empty($interface['traffic'])) { - $params = array( - 'interface_name' => $interface_name, - 'agent_id' => $id_agente, - 'traffic_module_in' => $interface['traffic']['in'], - 'traffic_module_out' => $interface['traffic']['out'] - ); - $params_json = json_encode($params); - $params_encoded = base64_encode($params_json); - $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); - $graph_link = "" . - html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . ""; + $permission = false; + + if ($strict_user) { + if (tags_check_acl_by_module($interface['traffic']['in'], $config['id_user'], 'RR') === true + && tags_check_acl_by_module($interface['traffic']['out'], $config['id_user'], 'RR') === true) + $permission = true; + } + else { + $permission = check_acl($config['id_user'], $agent["id_grupo"], "RR"); + } + + if ($permission) { + $params = array( + 'interface_name' => $interface_name, + 'agent_id' => $id_agente, + 'traffic_module_in' => $interface['traffic']['in'], + 'traffic_module_out' => $interface['traffic']['out'] + ); + $params_json = json_encode($params); + $params_encoded = base64_encode($params_json); + $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); + $graph_link = "" . + html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . ""; + } + else { + $graph_link = ""; + } } else { $graph_link = ""; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index bbf94e46d1..70ac95311d 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -21,13 +21,15 @@ if (! isset($_SESSION['id_usuario'])) { // Global & session management require_once ('../../include/config.php'); -require_once ('../../include/auth/mysql.php'); +require_once ($config['homedir'] . '/include/auth/mysql.php'); require_once ($config['homedir'] . '/include/functions.php'); require_once ($config['homedir'] . '/include/functions_db.php'); require_once ($config['homedir'] . '/include/functions_reporting.php'); require_once ($config['homedir'] . '/include/functions_graph.php'); require_once ($config['homedir'] . '/include/functions_custom_graphs.php'); require_once ($config['homedir'] . '/include/functions_modules.php'); +require_once ($config['homedir'] . '/include/functions_agents.php'); +require_once ($config['homedir'] . '/include/functions_tags.php'); check_login(); @@ -36,7 +38,7 @@ $params = json_decode($params_json, true); // Metaconsole connection to the node $server_id = (int) (isset($params['server']) ? $params['server'] : 0); -if (!empty($server_id) && function_exists("metaconsole_get_connection_by_id")) { +if ($config["metaconsole"] && !empty($server_id)) { $server = metaconsole_get_connection_by_id($server_id); // Error connecting @@ -110,15 +112,24 @@ $interface_traffic_modules = array( // ACL $permission = false; $agent_group = (int) agents_get_agent_group($agent_id); + $strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); // The traffic modules should belong to the agent id $in_agent_id = (int) db_get_value("id_agente", "tagente_modulo", "id_agente_modulo", $params['traffic_module_in']); $out_agent_id = (int) db_get_value("id_agente", "tagente_modulo", "id_agente_modulo", $params['traffic_module_out']); $traffic_modules_belong_to_agent = $agent_id == $in_agent_id && $agent_id == $out_agent_id; - if (!empty($agent_group) && !empty($params['traffic_module_in']) && !empty($params['traffic_module_out']) - && $traffic_modules_belong_to_agent && check_acl($config['id_user'], $agent_group, "RR")) { - $permission = true; + if (!empty($agent_group) && !empty($params['traffic_module_in']) + && !empty($params['traffic_module_out']) && $traffic_modules_belong_to_agent) { + + if ($strict_user) { + if (tags_check_acl_by_module($params['traffic_module_in'], $config['id_user'], 'RR') === true + && tags_check_acl_by_module($params['traffic_module_out'], $config['id_user'], 'RR') === true) + $permission = true; + } + else { + $permission = check_acl($config['id_user'], $agent_group, "RR"); + } } if (!$permission) { From 786c6efa4bc55adbc206e91bdffe5a6b97648306 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 25 Mar 2015 11:22:22 +0100 Subject: [PATCH 04/19] Fixed the style of status message when edit a filter and added more information in the messages. (cherry picked from commit 085c4521d0a2c892676413a7cc81a23ca882177e) --- .../operation/events/events_list.php | 102 +++++++++++++----- 1 file changed, 78 insertions(+), 24 deletions(-) diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 071bc3c1ce..103ca95919 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -86,7 +86,7 @@ if (is_ajax()) { 'id_filter', 'tevent_filter', $values); if ($exists) { - echo 'error'; + echo 'duplicate'; } else { $result = db_process_sql_insert('tevent_filter', $values); @@ -664,8 +664,25 @@ else ui_toggle($events_filter, __('Event control filter'), '', !$open_filter); // Error div for ajax messages -echo "
"; +echo ""; +?> + +", - {"page" : "operation/events/events_list", - "save_event_filter" : 1, - "id_name" : $("#text-id_name").val(), - "id_group" : $("#id_group").val(), - "event_type" : $("#event_type").val(), - "severity" : $("#severity").val(), - "status" : $("#status").val(), - "search" : $("#text-search").val(), - "text_agent" : $("#text_id_agent").val(), - "pagination" : $("#pagination").val(), - "event_view_hr" : $("#text-event_view_hr").val(), - "id_user_ack" : $("#id_user_ack").val(), - "group_rep" : $("#group_rep").val(), - "tag_with": Base64.decode($("#hidden-tag_with").val()), - "tag_without": Base64.decode($("#hidden-tag_without").val()), - "filter_only_alert" : $("#filter_only_alert").val(), - "id_group_filter": $("#id_group").val() + { + "page" : "operation/events/events_list", + "save_event_filter" : 1, + "id_name" : $("#text-id_name").val(), + "id_group" : $("#id_group").val(), + "event_type" : $("#event_type").val(), + "severity" : $("#severity").val(), + "status" : $("#status").val(), + "search" : $("#text-search").val(), + "text_agent" : $("#text_id_agent").val(), + "pagination" : $("#pagination").val(), + "event_view_hr" : $("#text-event_view_hr").val(), + "id_user_ack" : $("#id_user_ack").val(), + "group_rep" : $("#group_rep").val(), + "tag_with": Base64.decode($("#hidden-tag_with").val()), + "tag_without": Base64.decode($("#hidden-tag_without").val()), + "filter_only_alert" : $("#filter_only_alert").val(), + "id_group_filter": $("#id_group").val() }, function (data) { + $(".info_box").hide(); if (data == 'error') { - $('#show_filter_error').html('

'); + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); + } + else if (data == 'duplicate') { + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "duplicate_create_filter") { + return true; + } + else + return false; + }).show(); } else { id_filter_save = data; - $('#show_filter_error').html('

'); + + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_create_filter") { + return true; + } + else + return false; + }).show(); } }); @@ -978,7 +1019,7 @@ $(document).ready( function() { // Update the info with the loaded filter $("#hidden-id_name").val($('#text-id_name').val()); $('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + $('#text-id_name').val()); - + return false; }); @@ -1007,11 +1048,24 @@ $(document).ready( function() { "id_group_filter": $("#id_group").val() }, function (data) { + $(".info_box").hide(); if (data == 'ok') { - $('#show_filter_error').html('

'); + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "success_update_filter") { + return true; + } + else + return false; + }).show(); } else { - $('#show_filter_error').html('

'); + $(".info_box").filter(function(i, item) { + if ($(item).data('type_info_box') == "error_create_filter") { + return true; + } + else + return false; + }).show(); } }); From c7fa8710ec64fb90f77736bfc25d432bb7777dc2 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 25 Mar 2015 16:14:47 +0100 Subject: [PATCH 05/19] Changed histogram of events in tactical view to metaconsole, tiquet: #2029 --- .../include/functions_reporting.php | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 17988d7e61..55c818c4e4 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -8405,7 +8405,9 @@ function reporting_get_event_histogram ($events) { global $config; include_once ('../../include/graphs/functions_gd.php'); $max_value = count($events); - + if (defined("METACONSOLE")) + $max_value = SECONDS_1HOUR; + $ttl = 1; $urlImage = ui_get_full_url(false, true, false, false); @@ -8418,7 +8420,11 @@ function reporting_get_event_histogram ($events) { EVENT_CRIT_MAJOR => COL_MAJOR, EVENT_CRIT_CRITICAL => COL_CRITICAL ); - + if(defined("METACONSOLE")){ + $full_legend = array(); + $cont = 0; + } + foreach ($events as $data) { switch ($data['criticity']) { @@ -8450,10 +8456,21 @@ function reporting_get_event_histogram ($events) { $color = EVENT_CRIT_WARNING_OR_CRITICAL; break; } - $graph_data[] = array( - 'data' => $color, - 'utimestamp' => 1 - ); + + if(defined("METACONSOLE")){ + $full_legend[$cont] = $data['timestamp']; + $graph_data[] = array( + 'data' => $color, + 'utimestamp' => $data['utimestamp'] - get_system_time () + ); + $cont++; + } + else{ + $graph_data[] = array( + 'data' => $color, + 'utimestamp' => 1 + ); + } } $table->width = '100%'; @@ -8464,7 +8481,11 @@ function reporting_get_event_histogram ($events) { $table->data[0][0] = "" ; if (!empty($graph_data)) { - $slicebar = slicesbar_graph($graph_data, $max_value, 700, 25, $colors, $config['fontpath'], $config['round_corner'], $urlImage, $ttl); + if (defined("METACONSOLE")) + $slicebar = flot_slicesbar_graph($graph_data, $max_value, "100%", 35, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $urlImage); + else + $slicebar = slicesbar_graph($graph_data, $max_value, 700, 25, $colors, $config['fontpath'], $config['round_corner'], $urlImage, $ttl); + $table->data[0][0] = $slicebar; } else { $table->data[0][0] = __('No events'); From 3b06988082e42a279d2acf14fc60ed93ec03a509 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 19:19:20 +0100 Subject: [PATCH 06/19] Fixed an ACL error on the 'tags_check_acl' and 'tags_check_acl_events' functions --- pandora_console/include/functions_tags.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 450f616cfe..a2a6b87171 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -1030,8 +1030,14 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array(), $flag_id_ } // If there are not tags restrictions or tags passed, check the group access - if ((empty($acls) || empty($tags)) && check_acl($id_user, $id_group, $access)) { - return true; + if (empty($acls) || empty($tags)) { + if (!is_array($id_group)) + $group_id_array = array($id_group); + + foreach ($id_group as $group) { + if (check_acl($id_user, $group, $access)) + return true; + } } # Fix: If user profile has more than one group, due to ACL propagation then id_group can be an array @@ -1128,8 +1134,14 @@ function tags_check_acl_event($id_user, $id_group, $access, $tags = array(),$p = } // If there are not tags restrictions or tags passed, check the group access - if ((empty($acls) || empty($tags)) && check_acl($id_user, $id_group, $access)) { - return true; + if (empty($acls) || empty($tags)) { + if (!is_array($id_group)) + $group_id_array = array($id_group); + + foreach ($id_group as $group) { + if (check_acl($id_user, $group, $access)) + return true; + } } # Fix: If user profile has more than one group, due to ACL propagation then id_group can be an array From 08d93c8b288df83972e6dc8b598bc80bcef359a2 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 19:20:48 +0100 Subject: [PATCH 07/19] Now the 'avg_only' option is enabled by default for the metaconsole users --- pandora_console/include/class/Tree.class.php | 1 + pandora_console/include/functions_events.php | 1 + pandora_console/operation/agentes/status_monitor.php | 1 + 3 files changed, 3 insertions(+) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 36d6dcac8b..fa566c0ee6 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1344,6 +1344,7 @@ class Tree { ); if (defined('METACONSOLE') && !empty($server)) { + $graph_params["avg_only"] = 1; // Set the server id $graph_params["server"] = $module['serverID']; } diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 0529e5f9a8..98453ab29e 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2081,6 +2081,7 @@ function events_page_details ($event, $server = "") { ); if (defined('METACONSOLE')) { + $graph_params["avg_only"] = 1; // Set the server id $graph_params["server"] = $server["id"]; } diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index ce18fdb97c..b14acede5e 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1229,6 +1229,7 @@ foreach ($result as $row) { ); if (defined('METACONSOLE') && isset($row["server_id"])) { + $graph_params["avg_only"] = 1; // Set the server id $graph_params["server"] = $row["server_id"]; } From f462e38a7f830c683cdbf814446ee13ad31f0b7e Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 19:57:34 +0100 Subject: [PATCH 08/19] Now the data handling of the function 'events_page_details' id done connected to the node when necessary --- pandora_console/include/functions_events.php | 25 ++++++++------------ 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 98453ab29e..3c195207ba 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1914,13 +1914,17 @@ function events_page_details ($event, $server = "") { global $config; // If server is provided, get the hash parameters - if (!empty($server)) { + if (!empty($server) && defined("METACONSOLE")) { $hashdata = metaconsole_get_server_hashdata($server); $hashstring = "&" . "loginhash=auto&" . "loginhash_data=" . $hashdata . "&" . "loginhash_user=" . str_rot13($config["id_user"]); $serverstring = $server['server_url'] . "/"; + + if (metaconsole_connect($server) !== NOERR) { + return ui_print_error_message(__('There was an error connecting to the node'), '', true); + } } else { $hashstring = ""; @@ -1951,14 +1955,7 @@ function events_page_details ($event, $server = "") { } if ($event["id_agente"] != 0) { - if (!empty($server)) { - $agent = agents_meta_get_agent(array('id_agent' => $event["id_agente"], - 'id_server' => $server['id'], - 'server_name' => $server['server_name'])); - } - else { - $agent = db_get_row('tagente','id_agente',$event["id_agente"]); - } + $agent = db_get_row('tagente','id_agente',$event["id_agente"]); } else { $agent = array(); @@ -2007,12 +2004,7 @@ function events_page_details ($event, $server = "") { } if ($event["id_agentmodule"] != 0) { - if (!empty($server)) { - $module = meta_modules_get_agentmodule ($event["id_agentmodule"], $server['id']); - } - else { - $module = db_get_row_filter('tagente_modulo',array('id_agente_modulo' => $event["id_agentmodule"], 'delete_pending' => 0)); - } + $module = db_get_row_filter('tagente_modulo',array('id_agente_modulo' => $event["id_agentmodule"], 'delete_pending' => 0)); } else { $module = array(); @@ -2205,6 +2197,9 @@ function events_page_details ($event, $server = "") { $details = '
'.html_print_table($table_details, true).'
'; + if (!empty($server) && defined("METACONSOLE")) + metaconsole_restore_db(); + return $details; } From fa58fb25ed392cc053cdc148ee71f2b304372b32 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 25 Mar 2015 20:55:02 +0100 Subject: [PATCH 09/19] Added new columns to the table 'tnetwork_map' --- .../extras/pandoradb_migrate_5.1_to_6.0.mysql.sql | 9 ++++++++- .../extras/pandoradb_migrate_5.1_to_6.0.oracle.sql | 9 ++++++++- .../extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 2ab5f97d29..4ab94fad5a 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -62,4 +62,11 @@ UPDATE `talert_commands` SET `fields_descriptions` = '[\"Destination addres -- --------------------------------------------------------------------- -- Table `tconfig` -- --------------------------------------------------------------------- -INSERT INTO `tconfig` (`token`, `value`) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); \ No newline at end of file +INSERT INTO `tconfig` (`token`, `value`) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); + +-- --------------------------------------------------------------------- +-- Table `tnetwork_map` +-- --------------------------------------------------------------------- +ALTER TABLE `tnetwork_map` ADD COLUMN `id_tag` int(11) DEFAULT 0; +ALTER TABLE `tnetwork_map` ADD COLUMN `store_group` int(11) DEFAULT 0; +UPDATE `tnetwork_map` SET `store_group` = `id_group`; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index c302b4aae4..a1e52b9bff 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -62,4 +62,11 @@ UPDATE talert_commands SET fields_descriptions = '[\"Destination address\", -- --------------------------------------------------------------------- -- Table `tconfig` -- --------------------------------------------------------------------- -INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); \ No newline at end of file +INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); + +-- --------------------------------------------------------------------- +-- Table `tnetwork_map` +-- --------------------------------------------------------------------- +ALTER TABLE tnetwork_map ADD COLUMN id_tag NUMBER(11, 0) DEFAULT 0; +ALTER TABLE tnetwork_map ADD COLUMN store_group NUMBER(11, 0) DEFAULT 0; +UPDATE tnetwork_map SET store_group = id_group; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 03b27c534d..6882914fd2 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -60,4 +60,11 @@ UPDATE "talert_commands" SET "fields_descriptions" = '[\"Destination addres -- --------------------------------------------------------------------- -- Table `tconfig` -- --------------------------------------------------------------------- -INSERT INTO "tconfig" ("token", "value") VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); \ No newline at end of file +INSERT INTO "tconfig" ("token", "value") VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'); + +-- --------------------------------------------------------------------- +-- Table `tnetwork_map` +-- --------------------------------------------------------------------- +ALTER TABLE "tnetwork_map" ADD COLUMN "id_tag" INTEGER DEFAULT 0; +ALTER TABLE "tnetwork_map" ADD COLUMN "store_group" INTEGER DEFAULT 0; +UPDATE "tnetwork_map" SET "store_group" = "id_group"; From 7acba2577827cb146db6563b6bbd549f2090718e Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 26 Mar 2015 00:01:14 +0100 Subject: [PATCH 10/19] 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/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 544869043a..70f4ff0e37 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150325 +Version: 6.0dev-150326 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 1523962f36..39de2618a8 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="6.0dev-150325" +pandora_version="6.0dev-150326" 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 5a3de7a4b3..ff68099392 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150325'; +use constant AGENT_BUILD => '150326'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 31d850b7c0..10f82ccf06 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 6.0dev -%define release 150325 +%define release 150326 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 fd95ea68fa..ecad8ad241 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 6.0dev -%define release 150325 +%define release 150326 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 85b0a3b84e..39113092d4 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150325} +{150326} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 509d3cb395..9b080ea0c1 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 ("6.0dev(Build 150325)") +#define PANDORA_VERSION ("6.0dev(Build 150326)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index baa96e823a..943dba4e92 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", "(6.0dev(Build 150325))" + VALUE "ProductVersion", "(6.0dev(Build 150326))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2bd423617a..9809a5325b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150325 +Version: 6.0dev-150326 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 442a06c4c4..843d98f89e 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="6.0dev-150325" +pandora_version="6.0dev-150326" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d2c9733135..8125592125 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150325'; +$build_version = 'PC150326'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index bd1f853ac1..5b1f853c59 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 26 Mar 2015 08:48:14 +0100 Subject: [PATCH 11/19] Fixed user list visual in metaconsole tiquet: #2042 --- pandora_console/godmode/users/user_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 262b0ae008..089e9ea0f6 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -236,11 +236,11 @@ $table->data[0][4] = html_print_submit_button(__('Search'), 'search', if(defined('METACONSOLE')){ - $table->width = '50%'; + $table->width = '96%'; $form_filter = "
"; $form_filter .= html_print_table($table, true); $form_filter .= "
"; - echo $form_filter; + ui_toggle($form_filter, __('Show Options')); }else{ $form_filter = "
"; $form_filter .= html_print_table($table, true); From cb29e3564d91f852c394babb827814389290c906 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 26 Mar 2015 13:41:07 +0100 Subject: [PATCH 12/19] Added tag related functions to the CLI. --- pandora_server/lib/PandoraFMS/DB.pm | 31 +++++++ pandora_server/util/pandora_manage.pl | 127 +++++++++++++++++++++++++- 2 files changed, 157 insertions(+), 1 deletion(-) mode change 100644 => 100755 pandora_server/util/pandora_manage.pl diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index e4c34bb5a9..faa81a8833 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -73,10 +73,13 @@ our @EXPORT = qw( get_profile_id get_priority_name get_server_id + get_tag_id + get_group_name get_template_id get_template_module_id get_user_disabled get_user_exists + get_user_profile_id is_agent_address is_group_disabled get_agent_status @@ -191,6 +194,18 @@ sub get_server_id ($$$) { return defined ($rc) ? $rc : -1; } +######################################################################## +## Return the ID of a tag given the tag name. +######################################################################## +sub get_tag_id ($$) { + my ($dbh, $tag_name) = @_; + + my $rc = get_db_value ($dbh, "SELECT id_tag FROM ttag + WHERE name = ?", + safe_input($tag_name)); + return defined ($rc) ? $rc : -1; +} + ######################################################################## ## Return the first enabled server name found. ######################################################################## @@ -549,6 +564,22 @@ sub get_nc_profile_name ($$) { return get_db_value ($dbh, "SELECT * FROM tnetwork_profile WHERE id_np = ?", $nc_id); } +########################################################################## +## Return user profile ID given the user id, group id and profile id. +########################################################################## +sub get_user_profile_id ($$$$) { + my ($dbh, $user_id, $profile_id, $group_id) = @_; + + my $rc = get_db_value ($dbh, "SELECT id_up FROM tusuario_perfil + WHERE id_usuario = ? + AND id_perfil = ? + AND id_grupo = ?", + safe_input($user_id), + $profile_id, + $group_id); + return defined ($rc) ? $rc : -1; +} + ########################################################################## ## Return profile ID given the profile name. ########################################################################## diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl old mode 100644 new mode 100755 index 8dba3125fb..c998dde4bd --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -20,6 +20,7 @@ use File::Basename; use JSON qw(decode_json encode_json); use MIME::Base64; use Encode qw(decode encode_utf8); +use LWP::Simple; # Default lib dir for RPM and DEB packages use lib '/usr/lib/perl5'; @@ -186,10 +187,50 @@ sub help_screen{ print "\nSETUP:\n\n" unless $param ne ''; help_screen_line('--set_event_storm_protection', '', "Enable (1) or disable (0) event \n\t storm protection"); + print "\nTAGS\n\n" unless $param ne ''; + help_screen_line('--create_tag', ' [] []', 'Create a new tag'); + help_screen_line('--add_tag_to_user_profile', ' ', 'Add a tag to the given user profile.'); + help_screen_line('--add_tag_to_module', ' ', 'Add a tag to the given module.'); + print "\n"; exit; } +############################################################################### +# +############################################################################### +sub api_call($$$;$$$) { + my ($pa_config, $op, $op2, $id, $id2, $other) = @_; + my $content = undef; + + eval { + # Set the parameters for the POST request. + my $params = {}; + $params->{"apipass"} = $pa_config->{"console_api_pass"}; + $params->{"user"} = $pa_config->{"console_user"}; + $params->{"pass"} = $pa_config->{"console_pass"}; + $params->{"op"} = $op; + $params->{"op2"} = $op2; + $params->{"id"} = $id; + $params->{"id2"} = $id2; + $params->{"other"} = $other; + $params->{"other_mode"} = "url_encode_separator_|"; + + # Call the API. + my $ua = new LWP::UserAgent; + my $url = $pa_config->{"console_api_url"}; + my $response = $ua->post($url, $params); + + if ($response->is_success) { + $content = $response->decoded_content(); + } else { + $content = $response->decoded_content(); + } + }; + + return $content; +} + ############################################################################### # Disable a entire group ############################################################################### @@ -4083,6 +4124,18 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 1); cli_recreate_collection(); } + elsif ($param eq '--create_tag') { + param_check($ltotal, 4, 2); + cli_create_tag(); + } + elsif ($param eq '--add_tag_to_user_profile') { + param_check($ltotal, 4); + cli_add_tag_to_user_profile(); + } + elsif ($param eq '--add_tag_to_module') { + param_check($ltotal, 3); + cli_add_tag_to_module(); + } else { print_log "[ERROR] Invalid option '$param'.\n\n"; $param = ''; @@ -4281,5 +4334,77 @@ sub cli_create_local_component() { $parameters{'ff_timeout'} = $ff_timeout unless !defined ($ff_timeout); my $component_id = enterprise_hook('pandora_create_local_component_from_hash',[$conf, \%parameters, $dbh]); - +} + +############################################################################## +# Create a new tag. +############################################################################## + +sub cli_create_tag() { + my ($tag_name, $tag_description, $tag_url, $tag_email) = @ARGV[2..5]; + + # Call the API. + my $result = api_call(\%conf, 'set', 'create_tag', undef, undef, "$tag_name|$tag_description|$tag_url|$tag_email"); + print "\n$result\n"; +} + +############################################################################## +# Add a tag to the specified profile and group. +############################################################################## + +sub cli_add_tag_to_user_profile() { + my ($user_id, $tag_name, $group_name, $profile_name) = @ARGV[2..5]; + + # Check the user. + my $user_exists = get_user_exists($dbh, $user_id); + exist_check($user_exists, 'user', $user_id); + + # Check the group. + my $group_id; + if ($group_name eq 'All') { + $group_id = 0; + } else { + $group_id = get_group_id($dbh, $group_name); + exist_check($group_id, 'group', $group_name); + } + + # Check the profile. + my $profile_id = get_profile_id($dbh, $profile_name); + exist_check($profile_id, 'profile', $profile_name); + + # Make sure the tag exists. + my $tag_id = get_tag_id($dbh, $tag_name); + exist_check($tag_id, 'tag', $tag_name); + + # Make sure the profile is associated to the user. + my $user_profile_id = get_user_profile_id($dbh, $user_id, $profile_id, $group_id); + exist_check($user_profile_id, 'given profile and group combination for user', $user_id); + + # Call the API. + my $result = api_call(\%conf, 'set', 'tag_user_profile', $user_id, $tag_id, "$group_id|$profile_id"); + print "\n$result\n"; +} + +############################################################################## +# Add a tag to the specified profile and group. +############################################################################## + +sub cli_add_tag_to_module() { + my ($agent_name, $module_name, $tag_name) = @ARGV[2..4]; + + # Check the tag. + my $tag_id = get_tag_id($dbh, $tag_name); + exist_check($tag_id, 'tag', $tag_name); + + # Check the agent. + my $agent_id = get_agent_id($dbh, $agent_name); + exist_check($agent_id, 'agent', $agent_name); + + # Check the module. + my $module_id = get_agent_module_id($dbh, $module_name, $agent_id); + exist_check($module_id, 'module name', $module_name); + + # Call the API. + my $result = api_call(\%conf, 'set', 'add_tag_module', $module_id, $tag_id); + print "\n$result\n"; } From cfb676eb707fa0c68ef6d4ff93625d26b5f3c262 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 26 Mar 2015 15:21:49 +0100 Subject: [PATCH 13/19] Fixed a string. --- pandora_server/util/pandora_manage.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index c998dde4bd..8fadef36e6 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -189,8 +189,8 @@ sub help_screen{ print "\nTAGS\n\n" unless $param ne ''; help_screen_line('--create_tag', ' [] []', 'Create a new tag'); - help_screen_line('--add_tag_to_user_profile', ' ', 'Add a tag to the given user profile.'); - help_screen_line('--add_tag_to_module', ' ', 'Add a tag to the given module.'); + help_screen_line('--add_tag_to_user_profile', ' ', 'Add a tag to the given user profile'); + help_screen_line('--add_tag_to_module', ' ', 'Add a tag to the given module'); print "\n"; exit; From c7b3104224b56696a8215547c2ff892ffdc62c72 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 26 Mar 2015 15:33:37 +0100 Subject: [PATCH 14/19] In alert command preview is not array but contain data, create textarea instead of select --- .../godmode/alerts/alert_commands.php | 40 +++++++++++-------- .../godmode/alerts/configure_alert_action.php | 15 ++++--- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index d0ded3d06e..40c00406da 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -120,24 +120,32 @@ if (is_ajax ()) { $fields_value_select = array(); $fv = explode(';', $field_value); - if (!empty($fv)) { - foreach ($fv as $fv_option) { - $fv_option = explode(',', $fv_option); - - if (empty($fv_option)) - continue; - - if (!isset($fv_option[1])) - $fv_option[1] = $fv_option[0]; - - $fields_value_select[$fv_option[0]] = $fv_option[1]; + if (count($fv) > 1) { + if (!empty($fv)) { + foreach ($fv as $fv_option) { + $fv_option = explode(',', $fv_option); + + if (empty($fv_option)) + continue; + + if (!isset($fv_option[1])) + $fv_option[1] = $fv_option[0]; + + $fields_value_select[$fv_option[0]] = $fv_option[1]; + } } - } - $ffield = html_print_select($fields_value_select, - 'field'.$i.'_value', '', '', '', 0, true, false, false, 'fields'); - $rfield = html_print_select($fields_value_select, - 'field'.$i.'_recovery_value', '', '', '', 0, true, false, false, 'fields_recovery'); + $ffield = html_print_select($fields_value_select, + 'field'.$i.'_value', '', '', '', 0, true, false, false, 'fields'); + $rfield = html_print_select($fields_value_select, + 'field'.$i.'_recovery_value', '', '', '', 0, true, false, false, 'fields_recovery'); + } + else{ + $ffield = html_print_textarea ('field' . $i . '_value',1, 1, $fv[0], + 'style="min-height:40px" class="fields"', true); + $rfield = html_print_textarea ('field' . $i . '_recovery_value', 1, 1, $fv[0], + 'style="min-height:40px" class="fields_recovery"', true); + } } } else { diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 553f33a67c..1dfdbb2200 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -284,7 +284,8 @@ $(document).ready (function () { $table_macros_field.hide(); continue; } - + old_value = ''; + old_recovery_value = ''; // Only keep the value if is provided from hidden (first time) if (($("[name=field" + i + "_value]").attr('id')) == ("hidden-field" + i + "_value")) { @@ -301,10 +302,14 @@ $(document).ready (function () { // Replace the old column with the new $table_macros_field.replaceWith(field_row); - - $("[name=field" + i + "_value]").val(old_value); - $("[name=field" + i + "_recovery_value]").val(old_recovery_value); - + if (old_value != '' && old_recovery_value != ''){ + $("[name=field" + i + "_value]").val(old_value); + $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + } + else{ + $("[name=field" + i + "_value]").val($("[name=field" + i + "_value]").val()); + $("[name=field" + i + "_recovery_value]").val($("[name=field" + i + "_recovery_value]").val()); + } // Add help hint only in first field if (i == 1) { var td_content = $table_macros_field.find('td').eq(0); From b72af65bd00f151e9554a0de1adcd69d91d1d344 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 26 Mar 2015 18:44:16 +0100 Subject: [PATCH 15/19] Fixed the ajax of get modules when the user have profiles with tags and without tags. --- pandora_console/include/functions_agents.php | 7 ++-- pandora_console/include/functions_tags.php | 38 +++++++++++++------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 61bf8d7eae..e37cf5e808 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1161,9 +1161,11 @@ function agents_get_modules ($id_agent = null, $details = false, //$where .= " AND id_policy_module = 0 "; - $where_tags = tags_get_acl_tags($config['id_user'], $id_groups, 'AR', 'module_condition', 'AND', 'tagente_modulo'); + $where_tags = tags_get_acl_tags($config['id_user'], $id_groups, 'AR', + 'module_condition', 'AND', 'tagente_modulo', false, array(), + true); - $where .= $where_tags; + $where .= "\n\n" . $where_tags; switch ($config["dbtype"]) { case "mysql": @@ -1189,6 +1191,7 @@ function agents_get_modules ($id_agent = null, $details = false, break; } + $result = db_get_all_rows_sql ($sql); if (empty ($result)) { diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index a2a6b87171..9f5af24fdf 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -596,7 +596,10 @@ function tags_get_tags_formatted ($tags_array, $get_url = true) { * @return mixed/string Tag ids */ -function tags_get_acl_tags($id_user, $id_group, $access = 'AR', $return_mode = 'module_condition', $query_prefix = '', $query_table = '', $meta = false, $childrens_ids = array(), $force_group_and_tag = false) { +function tags_get_acl_tags($id_user, $id_group, $access = 'AR', + $return_mode = 'module_condition', $query_prefix = '', + $query_table = '', $meta = false, $childrens_ids = array(), + $force_group_and_tag = false) { global $config; @@ -635,6 +638,7 @@ function tags_get_acl_tags($id_user, $id_group, $access = 'AR', $return_mode = ' $acltags = tags_get_user_module_and_tags($id_user, $access); + // Delete the groups without tag restrictions from the acl tags array if $force_group_and_tag == false // Delete the groups that aren't in the received groups id $acltags_aux = array(); @@ -660,7 +664,9 @@ function tags_get_acl_tags($id_user, $id_group, $access = 'AR', $return_mode = ' break; case 'module_condition': // Return the condition of the tags for tagente_modulo table - $condition = tags_get_acl_tags_module_condition($acltags, $query_table, true); + + $condition = tags_get_acl_tags_module_condition($acltags, + $query_table); if (!empty($condition)) { return " $query_prefix " . $condition; } @@ -701,7 +707,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') { // Fix: Wrap SQL expression with "()" to avoid bad SQL sintax that makes Pandora retrieve all modules without taking care of id_agent => id_agent = X AND (sql_tag_expression) if ($i == 0) - $condition .= ' ( '; + $condition .= ' ( ' . "\n"; // Group condition (The module belongs to an agent of the group X) // Juanma (08/05/2014) Fix: Now group and tag is checked at the same time, before only tag was checked due to a bad condition @@ -713,7 +719,7 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') { //Avoid the user profiles with all group access. $group_condition = " 1 = 1 "; } - + //When the acl is only group without tags if (empty($group_tags)) { $condition .= "($group_condition)\n"; @@ -727,9 +733,14 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') { // Tags condition (The module has at least one of the restricted tags) $tags_condition = sprintf('%sid_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN (%s))', $modules_table, $group_tags_query); - $condition .= "($group_condition AND \n$tags_condition)\n"; + $condition .= + " ( \n" . + " $group_condition \n" . + " AND \n" . + " $tags_condition \n" . + " )\n"; } - + $i++; } @@ -2147,10 +2158,10 @@ function tags_get_monitors_alerts ($id_tag, $groups_and_tags = array(), $id_agen AND tagente_modulo.id_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag = $id_tag) $agents_clause $groups_clause"; - + $count = db_get_sql ($sql); - - return $count; + + return $count; } function __add_acltags (&$acltags, $group_id, $tags_str) { @@ -2215,7 +2226,7 @@ function tags_get_user_module_and_tags ($id_user = false, $access = 'AR', $stric tperfil.%s = 1 ORDER BY id_grupo", $id_user, $acl_column); $tags_and_groups = db_get_all_rows_sql($sql); - + if ($tags_and_groups === false) $tags_and_groups = array(); @@ -2226,11 +2237,12 @@ function tags_get_user_module_and_tags ($id_user = false, $access = 'AR', $stric $all_groups = groups_get_all(); if (!empty($all_groups)) $all_group_ids = array_keys($all_groups); - + + $tags_and_groups_aux = array(); foreach ($tags_and_groups as $data) { // All group - if ($data['id_grupo'] == 0) { + if ($data['id_grupo'] === 0) { // All group with empty tags. All groups without tags permission! if (empty($data['tags'])) { foreach ($all_group_ids as $group_id) { @@ -2257,10 +2269,12 @@ function tags_get_user_module_and_tags ($id_user = false, $access = 'AR', $stric $tags_and_groups = $tags_and_groups_aux; unset($tags_and_groups_aux); + foreach ($tags_and_groups as $group_tag) { __add_acltags($acltags, $group_tag['id_grupo'], $group_tag['tags']); } + return $acltags; } From 63d322244dd9ca51ee35c1f7cd38b4c3755ef9e0 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 26 Mar 2015 19:34:56 +0100 Subject: [PATCH 16/19] Added a new parameter to the modules retrieving by tag function --- pandora_console/include/functions_networkmap.php | 4 ++-- pandora_console/include/functions_reporting.php | 12 ++++++------ pandora_console/include/functions_tags.php | 11 ++++++++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 005f8f3274..e02aa75f8a 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -376,7 +376,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, // Get agent modules data if ($strict_user) { - $modules = tags_get_agent_modules ($agent['id_agente'], $acltags, false, $filter, false); + $modules = tags_get_agent_modules ($agent['id_agente'], false, $acltags, false, $filter, false); } else { $modules = agents_get_modules($agent['id_agente'], '*', $filter, true, true); } @@ -792,7 +792,7 @@ function networkmap_generate_dot_groups ($pandora_name, $group = 0, // Get agent modules data if ($strict_user) { $filter['disabled'] = 0; - $modules = tags_get_agent_modules ($agent['id_agente'], $acltags, false, $filter, false); + $modules = tags_get_agent_modules ($agent['id_agente'], false, $acltags, false, $filter, false); } else { $modules = agents_get_modules ($agent['id_agente'], false, array('disabled' => 0), true, false); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 55c818c4e4..4ea953ce9a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7862,14 +7862,14 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent', $ $id_agent = $counts_info['id_agente']; $counts_info = array(); - $counts_info['normal_count'] = count(tags_get_agent_modules ($id_agent, $acltags, false, $filter, false, AGENT_MODULE_STATUS_NORMAL)); - $counts_info['warning_count'] = count(tags_get_agent_modules ($id_agent, $acltags, false, $filter, false, AGENT_MODULE_STATUS_WARNING)); - $counts_info['critical_count'] = count(tags_get_agent_modules ($id_agent, $acltags, false, $filter, false, AGENT_MODULE_STATUS_CRITICAL_BAD)); - $counts_info['notinit_count'] = count(tags_get_agent_modules ($id_agent, $acltags, false, $filter, false, AGENT_MODULE_STATUS_NOT_INIT)); - $counts_info['unknown_count'] = count(tags_get_agent_modules ($id_agent, $acltags, false, $filter, false, AGENT_MODULE_STATUS_UNKNOWN)); + $counts_info['normal_count'] = count(tags_get_agent_modules ($id_agent, false, $acltags, false, $filter, false, AGENT_MODULE_STATUS_NORMAL)); + $counts_info['warning_count'] = count(tags_get_agent_modules ($id_agent, false, $acltags, false, $filter, false, AGENT_MODULE_STATUS_WARNING)); + $counts_info['critical_count'] = count(tags_get_agent_modules ($id_agent, false, $acltags, false, $filter, false, AGENT_MODULE_STATUS_CRITICAL_BAD)); + $counts_info['notinit_count'] = count(tags_get_agent_modules ($id_agent, false, $acltags, false, $filter, false, AGENT_MODULE_STATUS_NOT_INIT)); + $counts_info['unknown_count'] = count(tags_get_agent_modules ($id_agent, false, $acltags, false, $filter, false, AGENT_MODULE_STATUS_UNKNOWN)); $counts_info['total_count'] = $counts_info['normal_count'] + $counts_info['warning_count'] + $counts_info['critical_count'] + $counts_info['unknown_count'] + $counts_info['notinit_count']; - $all_agent_modules = tags_get_agent_modules ($id_agent, $acltags, false, $filter); + $all_agent_modules = tags_get_agent_modules ($id_agent, false, $acltags, false, $filter); if (!empty($all_agent_modules)) { $mod_clause = "(".implode(',', array_keys($all_agent_modules)).")"; diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index a2a6b87171..74d7b66d8d 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -2419,7 +2419,7 @@ function tags_get_all_user_agents ($id_tag = false, $id_user = false, $groups_an return $user_agents; } -function tags_get_agent_modules ($id_agent, $groups_and_tags = array(), $fields = false, $filter = false, $return_all_fields = false, $get_filter_status = -1) { +function tags_get_agent_modules ($id_agent, $id_tag = false, $groups_and_tags = array(), $fields = false, $filter = false, $return_all_fields = false, $get_filter_status = -1) { global $config; @@ -2427,6 +2427,12 @@ function tags_get_agent_modules ($id_agent, $groups_and_tags = array(), $fields if (empty($id_agent)) return false; + if (empty($id_tag)) { + $tag_filter = ""; + } else { + $tag_filter = " AND tagente_modulo.id_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag = $id_tag) "; + } + if (!is_array ($fields)) { $fields = array (); $fields[0] = "tagente_modulo.id_agente_modulo"; @@ -2445,12 +2451,11 @@ function tags_get_agent_modules ($id_agent, $groups_and_tags = array(), $fields } - $tag_filter = ""; if (!empty($groups_and_tags)) { $agent_group = db_get_value('id_grupo', 'tagente', 'id_agente', $id_agent); if (isset($groups_and_tags[$agent_group]) && ($groups_and_tags[$agent_group] != '')) { //~ $tag_filter = " AND ttag_module.id_tag IN (".$groups_and_tags[$agent_group].")"; - $tag_filter = " AND tagente_modulo.id_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN (".$groups_and_tags[$agent_group]."))"; + $tag_filter .= " AND tagente_modulo.id_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN (".$groups_and_tags[$agent_group]."))"; } } From b99e7773004a4b2ddaee61bf5396c917e69f6acf Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 26 Mar 2015 21:17:53 +0100 Subject: [PATCH 17/19] Fixed an error on the function"tags_get_all_user_agents" --- pandora_console/include/functions_tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 74d7b66d8d..6cc25d6d37 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -2298,7 +2298,7 @@ function tags_get_all_user_agents ($id_tag = false, $id_user = false, $groups_an $groups_clause = " AND ".tags_get_acl_tags_module_condition($groups_and_tags, "tagente_modulo"); } } else { - $groups_clause = " AND tagente.id_grupo IN (".implode(',',$groups_and_tags).")"; + $groups_clause = " AND tagente.id_grupo IN (".implode(',', array_keys($groups_and_tags)).")"; } if (!empty($filter['id_group'])) { From 3d84b80c5296d626e43f7fe2c6ae09f8c31b9ee8 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 26 Mar 2015 22:28:18 +0100 Subject: [PATCH 18/19] Fixed an error on the function 'tags_get_user_module_and_tags' caused by a string=integer comparision --- pandora_console/include/functions_tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index f263254f59..b1eef539b2 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -2242,7 +2242,7 @@ function tags_get_user_module_and_tags ($id_user = false, $access = 'AR', $stric $tags_and_groups_aux = array(); foreach ($tags_and_groups as $data) { // All group - if ($data['id_grupo'] === 0) { + if ((int)$data['id_grupo'] === 0) { // All group with empty tags. All groups without tags permission! if (empty($data['tags'])) { foreach ($all_group_ids as $group_id) { From c29c47dc09d954ff8da21facd5f85f6aa41c3c51 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 27 Mar 2015 00:01:12 +0100 Subject: [PATCH 19/19] 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/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) mode change 100755 => 100644 pandora_server/util/pandora_manage.pl diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 70f4ff0e37..dcc4594941 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0dev-150326 +Version: 6.0dev-150327 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 39de2618a8..c360f0169c 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="6.0dev-150326" +pandora_version="6.0dev-150327" 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 ff68099392..422198280e 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0dev'; -use constant AGENT_BUILD => '150326'; +use constant AGENT_BUILD => '150327'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 10f82ccf06..ea56c607a8 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 6.0dev -%define release 150326 +%define release 150327 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 ecad8ad241..0b0233c08a 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 6.0dev -%define release 150326 +%define release 150327 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 39113092d4..dd25b93c2d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150326} +{150327} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9b080ea0c1..e9917f8f0a 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 ("6.0dev(Build 150326)") +#define PANDORA_VERSION ("6.0dev(Build 150327)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 943dba4e92..edaa4d4dbe 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", "(6.0dev(Build 150326))" + VALUE "ProductVersion", "(6.0dev(Build 150327))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9809a5325b..19f5bec6b9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0dev-150326 +Version: 6.0dev-150327 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 843d98f89e..bcdb62a992 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="6.0dev-150326" +pandora_version="6.0dev-150327" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8125592125..85f540d49e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150326'; +$build_version = 'PC150327'; $pandora_version = 'v6.0dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5b1f853c59..eb7026078e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@