From 06830c9f692fa497230f316d5a2948b0369c9854 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 13 Nov 2018 12:55:25 +0100 Subject: [PATCH 01/19] Added profiller to docker --- pandora_console/ajax.php | 13 ++++++++++ pandora_console/include/functions.php | 34 +++++++++++++++++++++++++++ pandora_console/index.php | 16 +++++++++++++ 3 files changed, 63 insertions(+) diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index 6947bfcc3a..83ee051458 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -14,6 +14,15 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +// Enable profiler for testing +if (!defined("__PAN_XHPROF__")) define ("__PAN_XHPROF__", 0); + +if (__PAN_XHPROF__ === 1) { + if (function_exists('tideways_xhprof_enable')) { + tideways_xhprof_enable(); + } +} + if ((! file_exists("include/config.php")) || (! is_readable("include/config.php"))) { exit; } @@ -90,4 +99,8 @@ if (file_exists ($page)) { else { echo '
Sorry! I can\'t find the page '.$page.'!'; } + +if (__PAN_XHPROF__ === 1) { + pandora_xhprof_display_result("ajax", "console"); +} ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index ff2ce52deb..ae6ac202bd 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3391,5 +3391,39 @@ function validate_csrf_code() { function generate_hash_to_api(){ hash('sha256', db_get_value ('value', 'tupdate_settings', '`key`', 'customer_key')); +} + +/** + * Disable the profiller and display de result + * + * @param string Key to identify the profiler run. + * @param string Way to display the result + * "link" (default): Click into word "Performance" to display the profilling info. + * "console": Display with a message in pandora_console.log. + */ +function pandora_xhprof_display_result($key = "", $method = "link") { + // Check if function exists + if (!function_exists('tideways_xhprof_disable')) { + error_log("Cannot find tideways_xhprof_disable function"); + return; } + + $run_id = uniqid(); + $data = tideways_xhprof_disable(); + $source = "pandora_$key"; + file_put_contents( + sys_get_temp_dir() . "/" . $run_id . ".$source.xhprof", + serialize($data) + ); + $new_url = "http://{$_SERVER['HTTP_HOST']}/profiler/index.php?run={$run_id}&source={$source}"; + switch($method) { + case "console": + error_log("'{$new_url}'"); + case "link": + default: + echo "Performance\n"; + break; + + } +} ?> diff --git a/pandora_console/index.php b/pandora_console/index.php index 9111aec168..8669f39d2d 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -14,6 +14,17 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +// Enable profiler for testing +if (!defined("__PAN_XHPROF__")) define ("__PAN_XHPROF__", 0); + +if (__PAN_XHPROF__ === 1) { + if (function_exists('tideways_xhprof_enable')) { + tideways_xhprof_enable(); + } else { + error_log("Cannot find tideways_xhprof_enable function"); + } +} + //Set character encoding to UTF-8 - fixes a lot of multibyte character headaches if (function_exists ('mb_internal_encoding')) { mb_internal_encoding ("UTF-8"); @@ -1266,3 +1277,8 @@ require('include/php_to_js_values.php'); */ } + \ No newline at end of file From 58289e73bcab4e2a98b7b4a28e8518eed099a127 Mon Sep 17 00:00:00 2001 From: samucarc Date: Mon, 17 Dec 2018 17:51:30 +0100 Subject: [PATCH 02/19] Added new functionality for CLI to delete policy agents. Former-commit-id: 753f9c47d2a4ffe8e5eb599dbd41d5b851500164 --- pandora_console/include/functions_api.php | 49 +++++++++++++++++++++++ pandora_server/util/pandora_manage.pl | 18 +++++++++ 2 files changed, 67 insertions(+) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 53479ae7ed..f406ddd275 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -32,6 +32,7 @@ include_once($config['homedir'] . "/include/functions_servers.php"); include_once($config['homedir'] . "/include/functions_planned_downtimes.php"); include_once($config['homedir'] . "/include/functions_db.php"); include_once($config['homedir'] . "/include/functions_event_responses.php"); +include_once($config['homedir'] . "/include/functions_policies.php"); enterprise_include_once ('include/functions_local_components.php'); enterprise_include_once ('include/functions_events.php'); enterprise_include_once ('include/functions_agents.php'); @@ -6448,6 +6449,54 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) { array('type' => 'string', 'data' => __('SNMP policy module updated.'))); } + +function api_set_remove_agent_from_policy ($id, $id2, $thrash2, $thrash3) { + global $config; + + if (!check_acl($config['id_user'], 0, "AW")){ + returnError('forbidden', 'string'); + return; + } + + if ($id == '' || !$id) { + returnError('error_parameter', __('Error deleting agent from policy. Policy cannot be left blank.')); + return; + } + + if ($id2 == '' || !$id2) { + returnError('error_parameter', __('Error deleting agent from policy. Agent cannot be left blank.')); + return; + } + + $policy = policies_get_policy ($id, false, false); + $agent = db_get_row_filter('tagente', array('id_agente' => $id2)); + $policy_agent = db_get_row_filter('tpolicy_agents', array('id_policy' => $id ,'id_agent' => $id2)); + + if (empty ($policy)){ + returnError('error_policy', __('This policy does not exist.')); + return; + } + if (empty ($agent)){ + returnError('error_agent', __('This agent does not exist.')); + return; + } + if (empty ($policy_agent)){ + returnError('error_policy_agent', __('This agent does not exist in this policy.')); + return; + } + + $return = policies_change_delete_pending_agent($policy_agent['id']); + $data = __('Successfully added to delete pending id agent %d to id policy %d.', $id2, $id); + + if ($return === false) + returnError('error_delete_policy_agent', 'Could not be deleted id agent %d from id policy %d', $id2, $id); + else + returnData('string', array('type' => 'string', 'data' => $data)); + + +} + + /** * Create a new group. And return the id_group of the new group. * diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ba3799b47f..2ec51b7519 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -195,6 +195,7 @@ sub help_screen{ help_screen_line('--apply_policy', '', 'Force apply a policy'); help_screen_line('--apply_all_policies', '', 'Force apply to all the policies'); help_screen_line('--add_agent_to_policy', ' ', 'Add an agent to a policy'); + help_screen_line('--remove_agent_from_policy', ' ', 'Delete an agent to a policy'); help_screen_line('--delete_not_policy_modules', '', 'Delete all modules without policy from configuration file'); help_screen_line('--disable_policy_alerts', '', 'Disable all the alerts of a policy'); help_screen_line('--create_policy', ' '); @@ -4101,6 +4102,19 @@ sub cli_policy_add_agent() { } } +############################################################################## +# delete an agent to a policy +# Related option: --remove_agent_from_policy +############################################################################## + +sub cli_policy_delete_agent() { + my ($policy_id, $agent_id) = @ARGV[2..3]; + + my $result = api_call(\%conf,'set', 'remove_agent_from_policy', $policy_id, $agent_id); + print "$result \n\n "; + +} + sub cli_create_planned_downtime() { my $name = @ARGV[2]; my @todo = @ARGV[3..21]; @@ -5836,6 +5850,10 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 2); cli_policy_add_agent(); } + elsif ($param eq '--remove_agent_from_policy') { + param_check($ltotal, 2); + cli_policy_delete_agent(); + } elsif ($param eq '--enable_user') { param_check($ltotal, 1); cli_user_enable(); From a9d3d81757a09a5e3bbbe90edf2beaa7efeca2fe Mon Sep 17 00:00:00 2001 From: samucarc Date: Mon, 17 Dec 2018 17:56:01 +0100 Subject: [PATCH 03/19] Fixed api function Former-commit-id: 9b376941609b04ac13da551e8253d5ed5a8085dc --- pandora_console/include/functions_api.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index f406ddd275..8c4bc6520c 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -6449,7 +6449,16 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) { array('type' => 'string', 'data' => __('SNMP policy module updated.'))); } - +/** + * Remove an agent from a policy. + * @param $id Id of the policy + * @param $id2 Id of the agent policy + * @param $trash1 + * @param $trash2 + * + * Example: + * api.php?op=set&op2=remove_agent_from_policy&apipass=1234&user=admin&pass=pandora&id=11&id2=2 + */ function api_set_remove_agent_from_policy ($id, $id2, $thrash2, $thrash3) { global $config; From 7e2fb25e2746d23ffd5382f763e87a2052ed02c8 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 24 Dec 2018 08:59:23 +0100 Subject: [PATCH 04/19] fixed errors in massive operation edit modules Former-commit-id: 2d2fa21660369607e6c206d269b12d2041f74a1a --- .../godmode/massive/massive_edit_modules.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index f09d495c0a..35d5bd1abc 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -51,31 +51,27 @@ if ($update) { $agents_ = array(); $force = get_parameter('force_type', false); - + if ($agents_select == false) { $agents_select = array(); } - - foreach ($agents_select as $agent_name) { - $agents_[] = agents_get_agent_id($agent_name); - } + $agents_ = $agents_select; $modules_ = $module_name; - } else if ($selection_mode == 'agents') { $force = get_parameter('force_group', false); - + $agents_ = $agents_id; $modules_ = $modules_select; } - + $success = 0; $count = 0; - + if ($agents_ == false) $agents_ = array(); - + // If the option to select all of one group or module type is checked if ($force) { if ($force == 'type') { From ac228a7fad7a8c4cf709eeb2f9270a288664c0c7 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 28 Dec 2018 12:14:17 +0100 Subject: [PATCH 05/19] fixed error in massive operation Former-commit-id: 691f3557d44c686645cfa634eab3630d060def33 --- pandora_console/godmode/massive/massive_delete_modules.php | 2 +- pandora_console/include/functions_agents.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 8462d75b7e..74860bb50f 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -285,7 +285,7 @@ else { $filter = false; } $names = agents_get_modules (array_keys ($agents), - 'DISTINCT(tagente_modulo.nombre)', $filter, false); + 'tagente_modulo.nombre', $filter, false); foreach ($names as $name) { $modules[$name['nombre']] = $name['nombre']; } diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index d69a27d8fe..b10251b9b2 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1231,8 +1231,8 @@ function agents_get_modules ($id_agent = null, $details = false, ON tagente.id_agente = tasg.id_agent WHERE tagente_modulo.delete_pending = 0 AND %s - GROUP BY tagente_modulo.id_agente_modulo - ORDER BY tagente_modulo.nombre', + GROUP BY 1 + ORDER BY 1', ($details != 'tagente_modulo.*' && $indexed) ? 'tagente_modulo.id_agente_modulo,' : '', io_safe_output(implode (",", (array) $details)), $sql_tags_join, From 0445e212fe311134a029f726087ac144d8eba237 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 8 Jan 2019 12:54:32 +0100 Subject: [PATCH 06/19] Added default_no_hierarchy to config global variable Former-commit-id: 0daba928d7adc7a848bca04b04168d05a82ea609 --- pandora_console/include/functions_config.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index bd0c78bd76..17f6d9b345 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -312,6 +312,8 @@ function config_update_config () { $error_update[] = __('Autocreate profile group'); if (!config_update_value ('default_assign_tags', implode(",",get_parameter ('default_assign_tags')))) $error_update[] = __('Autocreate profile tags'); + if (!config_update_value ('default_no_hierarchy', (int)get_parameter ('default_no_hierarchy'))) + $error_update[] = __('Automatically assigned no hierarchy'); if (!config_update_value ('autocreate_blacklist', get_parameter ('autocreate_blacklist'))) $error_update[] = __('Autocreate blacklist'); @@ -1452,7 +1454,10 @@ function config_process_config () { if (!isset ($config['default_assign_tags'])) { config_update_value ( 'default_assign_tags', ''); } - + if (!isset ($config['default_no_hierarchy'])) { + config_update_value ('default_no_hierarchy', 0); + } + if (!isset ($config['ldap_server'])) { config_update_value ( 'ldap_server', 'localhost'); } From f0c0a865330a3e193a5d06926a63401f4b233e46 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 8 Jan 2019 16:42:23 +0100 Subject: [PATCH 07/19] LDAP no hierarchy groups on node functionallity Former-commit-id: a9fe31be70e178e190c0d0bacf1dd6e27e71f03b --- pandora_console/include/auth/mysql.php | 101 ++++++++---------- pandora_console/include/functions_profile.php | 6 +- 2 files changed, 47 insertions(+), 60 deletions(-) diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index ffd618fb65..3b73fd7f37 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -269,32 +269,8 @@ function process_user_login_remote ($login, $pass, $api = false) { else { delete_user_pass_ldap ($login); } - - $permissions = array(); - if($config['ldap_advanced_config']){ - $i = 0; - - $ldap_adv_perms = json_decode(io_safe_output($config['ldap_adv_perms']), true); - foreach ($ldap_adv_perms as $ldap_adv_perm) { - $attributes = $ldap_adv_perm['groups_ldap']; - - foreach ($attributes as $attr) { - $attr = explode('=', $attr, 2); - foreach ($sr[$attr[0]] as $s_attr) { - if(preg_match('/' . $attr[1] . '/', $s_attr)){ - $permissions[$i]["profile"] = $ldap_adv_perm['profile']; - $permissions[$i]["groups"] = $ldap_adv_perm['group']; - $permissions[$i]["tags"] = implode(",",$ldap_adv_perm['tags']); - $i++; - } - } - } - } - } else { - $permissions[0]["profile"] = $config['default_remote_profile']; - $permissions[0]["groups"][] = $config['default_remote_group']; - $permissions[0]["tags"] = $config['default_assign_tags']; - } + + $permissions = fill_permissions_ldap($sr); if(empty($permissions)) { $config["auth_error"] = __("User not found in database or incorrect password"); return false; @@ -388,33 +364,7 @@ function process_user_login_remote ($login, $pass, $api = false) { } } - $permissions = array(); - if($config['ldap_advanced_config']){ - $i = 0; - - $ldap_adv_perms = json_decode(io_safe_output($config['ldap_adv_perms']), true); - - foreach ($ldap_adv_perms as $ldap_adv_perm) { - $attributes = $ldap_adv_perm['groups_ldap']; - - foreach ($attributes as $attr) { - $attr = explode('=', $attr, 2); - foreach ($sr[$attr[0]] as $s_attr) { - if(preg_match('/' . $attr[1] . '/', $s_attr)){ - $permissions[$i]["profile"] = $ldap_adv_perm['profile']; - $permissions[$i]["groups"] = $ldap_adv_perm['group']; - $permissions[$i]["tags"] = implode(",",$ldap_adv_perm['tags']); - $i++; - } - } - } - } - } else { - $permissions[0]["profile"] = $config['default_remote_profile']; - $permissions[0]["groups"][] = $config['default_remote_group']; - $permissions[0]["tags"] = $config['default_assign_tags']; - } - + $permissions = fill_permissions_ldap($sr); if(empty($permissions)) { $config["auth_error"] = __("User not found in database or incorrect password"); return false; @@ -904,10 +854,11 @@ function create_user_and_permisions_ldap ($id_user, $password, $user_info, $id_profile = $permission["profile"]; $id_groups = $permission["groups"]; $tags = $permission["tags"]; + $no_hierarchy = (bool)$permission["no_hierarchy"] ? 1 : 0; foreach ($id_groups as $id_group) { $profile = profile_create_user_profile( - $id_user, $id_profile, $id_group, false, $tags); + $id_user, $id_profile, $id_group, false, $tags, $no_hierarchy); } if ( defined("METACONSOLE") && $syncronize ) { @@ -934,7 +885,7 @@ function create_user_and_permisions_ldap ($id_user, $password, $user_info, db_process_sql_insert ("tusuario", $values); foreach ($id_groups as $id_group) { $profile = profile_create_user_profile ($id_user, - $id_profile, $id_group, false, $tags); + $id_profile, $id_group, false, $tags, $no_hierarchy); } } @@ -1141,6 +1092,46 @@ function check_permission_ldap ($id_user, $password, $user_info, } } +/** + * Fill permissions array with setup values + * + * @param string sr return value from LDAP connection + * + * @return array with all permission on LDAP authentication + */ +function fill_permissions_ldap ($sr) { + global $config; + + $permissions = array(); + if(!$config['ldap_advanced_config']){ + $permissions[0]["profile"] = $config['default_remote_profile']; + $permissions[0]["groups"][] = $config['default_remote_group']; + $permissions[0]["tags"] = $config['default_assign_tags']; + $permissions[0]["no_hierarchy"] = $config['default_no_hierarchy']; + return $permissions; + } + + // Decode permissions in advanced mode + $ldap_adv_perms = json_decode(io_safe_output($config['ldap_adv_perms']), true); + foreach ($ldap_adv_perms as $ldap_adv_perm) { + $attributes = $ldap_adv_perm['groups_ldap']; + foreach ($attributes as $attr) { + $attr = explode('=', $attr, 2); + foreach ($sr[$attr[0]] as $s_attr) { + if(preg_match('/' . $attr[1] . '/', $s_attr)){ + $permissions[] = array( + "profile" => $ldap_adv_perm['profile'], + "groups" => $ldap_adv_perm['group'], + "tags" => implode(",",$ldap_adv_perm['tags']), + "no_hierarchy" => (bool)$ldap_adv_perm['no_hierarchy'] ? 1 : 0 + ); + } + } + } + } + return $permissions; +} + /** * Update local user pass from ldap user * diff --git a/pandora_console/include/functions_profile.php b/pandora_console/include/functions_profile.php index 01d876697d..292d2892a7 100644 --- a/pandora_console/include/functions_profile.php +++ b/pandora_console/include/functions_profile.php @@ -79,14 +79,10 @@ function profile_create_user_profile ($id_user, $tags = '', $no_hierarchy = false ) { - global $config; if (empty ($id_profile) || $id_group < 0) - return false; - - // Secondary server is an enterprise function - if (!enterprise_installed() && $no_hierarchy) return false; + return false; // Checks if the user exists $result_user = users_get_user_by_id($id_user); From 07dc9a0b8427939b1585592570cc919f280c9aac Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 9 Jan 2019 12:27:22 +0100 Subject: [PATCH 08/19] first load it does not show the data Former-commit-id: 417e37dfb7acd78f3fb9e379a62534ca611aa9b1 --- .../operation/agentes/status_monitor.php | 150 ++++++++++-------- 1 file changed, 80 insertions(+), 70 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 5ae0748599..724feb4aea 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -552,7 +552,7 @@ if (is_metaconsole()) { $filters .= html_print_table($table, true); $filters .= ""; - ui_toggle($filters, __('Show Options')); + ui_toggle($filters, __('Show Options'), '', false); } else { $table->colspan[3][0] = 7; @@ -778,84 +778,89 @@ $sql = 'SELECT ORDER BY ' . $order['field'] . " " . $order['order'] . ' LIMIT '.$offset.",".$limit_sql; -if (! defined ('METACONSOLE')) { - $result = db_get_all_rows_sql ($sql); - - if ($result === false) { - $result = array (); +// When you enter for the first time you have less than 4 query params in the url +$first_interaction = count($_GET) > 4; +// We do not show the modules until the user searches with the filter +if ($first_interaction) { + if (! defined ('METACONSOLE')) { + $result = db_get_all_rows_sql($sql); + + if ($result === false) { + $result = array(); + } else { + ui_pagination($count, false, $offset); + } } - else - ui_pagination ($count, false, $offset); -} -else { - // For each server defined and not disabled: - $servers = db_get_all_rows_sql ('SELECT * + else { + // For each server defined and not disabled: + $servers = db_get_all_rows_sql('SELECT * FROM tmetaconsole_setup WHERE disabled = 0'); - if ($servers === false) - $servers = array(); - - $result = array(); - $count_modules = 0; - foreach ($servers as $server) { + if ($servers === false) + $servers = array(); + + $result = array(); + $count_modules = 0; + foreach ($servers as $server) { // If connection was good then retrieve all data server - if (metaconsole_connect($server) == NOERR) - $connection = true; - else - $connection = false; - - $result_server = db_get_all_rows_sql ($sql); - - if (!empty($result_server)) { + if (metaconsole_connect($server) == NOERR) + $connection = true; + else + $connection = false; + + $result_server = db_get_all_rows_sql($sql); + + if (!empty($result_server)) { // Create HASH login info - $pwd = $server['auth_token']; - $auth_serialized = json_decode($pwd,true); - - if (is_array($auth_serialized)) { - $pwd = $auth_serialized['auth_token']; - $api_password = $auth_serialized['api_password']; - $console_user = $auth_serialized['console_user']; - $console_password = $auth_serialized['console_password']; - } - - $user = $config['id_user']; - $user_rot13 = str_rot13($config['id_user']); - $hashdata = $user.$pwd; - $hashdata = md5($hashdata); - $url_hash = '&' . - 'loginhash=auto&' . - 'loginhash_data=' . $hashdata . '&' . - 'loginhash_user=' . $user_rot13; - - foreach ($result_server as $result_element_key => $result_element_value) { - - $result_server[$result_element_key]['server_id'] = $server['id']; - $result_server[$result_element_key]['server_name'] = $server['server_name']; - $result_server[$result_element_key]['server_url'] = $server['server_url'].'/'; - $result_server[$result_element_key]['hashdata'] = $hashdata; - $result_server[$result_element_key]['user'] = $config['id_user']; - $result_server[$result_element_key]['groups_in_server'] = - agents_get_all_groups_agent( + $pwd = $server['auth_token']; + $auth_serialized = json_decode($pwd, true); + + if (is_array($auth_serialized)) { + $pwd = $auth_serialized['auth_token']; + $api_password = $auth_serialized['api_password']; + $console_user = $auth_serialized['console_user']; + $console_password = $auth_serialized['console_password']; + } + + $user = $config['id_user']; + $user_rot13 = str_rot13($config['id_user']); + $hashdata = $user . $pwd; + $hashdata = md5($hashdata); + $url_hash = '&' . + 'loginhash=auto&' . + 'loginhash_data=' . $hashdata . '&' . + 'loginhash_user=' . $user_rot13; + + foreach ($result_server as $result_element_key => $result_element_value) { + + $result_server[$result_element_key]['server_id'] = $server['id']; + $result_server[$result_element_key]['server_name'] = $server['server_name']; + $result_server[$result_element_key]['server_url'] = $server['server_url'] . '/'; + $result_server[$result_element_key]['hashdata'] = $hashdata; + $result_server[$result_element_key]['user'] = $config['id_user']; + $result_server[$result_element_key]['groups_in_server'] = + agents_get_all_groups_agent( $result_element_value['id_agent'], $result_element_value['id_group'] - ); - - $count_modules++; - + ); + + $count_modules++; + + } + + $result = array_merge($result, $result_server); } - - $result = array_merge($result, $result_server); + metaconsole_restore_db(); } - metaconsole_restore_db(); + + if ($count_modules > $config['block_size']) { + ui_pagination($count_modules, false, $offset); + } + + // Get number of elements of the pagination + $result = ui_meta_get_subset_array($result, $inferior_limit, $superior_limit); } - - if ($count_modules > $config['block_size']) { - ui_pagination ($count_modules, false, $offset); - } - - // Get number of elements of the pagination - $result = ui_meta_get_subset_array($result, $inferior_limit, $superior_limit); } if (($config['dbtype'] == 'oracle') && ($result !== false)) { @@ -1391,9 +1396,14 @@ if (!empty($result)) { } html_print_table ($table); + +} else { + if ($first_interaction) { + ui_print_info_message(array('no_close' => true, 'message' => __('This group doesn\'t have any monitor'))); + } else { + ui_print_info_message(array('no_close' => true, 'message' => __('Sorry no search parameters'))); + } } -else - ui_print_info_message ( array ( 'no_close' => true, 'message' => __('This group doesn\'t have any monitor') ) ); // End Build List Result ///////////////////////////////////// From 5abf8e14ff91f90fc9bf31f33e9a7b98e775d07c Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 12 Jan 2019 00:01:24 +0100 Subject: [PATCH 09/19] Auto-updated build strings. Former-commit-id: f78ab7f528f841aeda3dd7e28b1a2fcb34c9a05e --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d1b5318f88..646cc80574 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190111 +Version: 7.0NG.730-190112 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 72960a6318..d0f817a242 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.730-190111" +pandora_version="7.0NG.730-190112" 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 8ca0e748a6..029a910bd2 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.730'; -use constant AGENT_BUILD => '190111'; +use constant AGENT_BUILD => '190112'; # 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 2e5c1eceaf..119bcd4b5a 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.730 -%define release 190111 +%define release 190112 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 b725d63a08..13800f74b1 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.730 -%define release 190111 +%define release 190112 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 902fc67022..c498fb066e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190111" +PI_BUILD="190112" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index affb521211..b6b1768d3d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190111} +{190112} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 877abd9b57..a743ceb71e 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.730(Build 190111)") +#define PANDORA_VERSION ("7.0NG.730(Build 190112)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f97e885ed9..f7b6bee405 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.730(Build 190111))" + VALUE "ProductVersion", "(7.0NG.730(Build 190112))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ddbf2c8119..242938b323 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190111 +Version: 7.0NG.730-190112 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 0a8a8b2b97..868ec1e5e4 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.730-190111" +pandora_version="7.0NG.730-190112" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4a5301cd69..4d1453f917 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 = 'PC190111'; +$build_version = 'PC190112'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index bb7ce75b46..cd1eeca07f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 250d45ae40..e78a99970e 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.730 -%define release 190111 +%define release 190112 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a86f26050b..38656a9f30 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.730 -%define release 190111 +%define release 190112 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 04a349843c..aeb039df51 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190111" +PI_BUILD="190112" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 71c18dbf30..677b36473c 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.730 PS190111"; +my $version = "7.0NG.730 PS190112"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 031dba98a7..da5ebbf9d9 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.730 PS190111"; +my $version = "7.0NG.730 PS190112"; # save program name for logging my $progname = basename($0); From 20a0aefe8422a499ea40e22e11b57d3f7416892d Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 13 Jan 2019 00:01:23 +0100 Subject: [PATCH 10/19] Auto-updated build strings. Former-commit-id: aab4a872f690f104fe10dbdf7ef8ba86e02daef8 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 646cc80574..4b414446ae 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190112 +Version: 7.0NG.730-190113 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 d0f817a242..62d7dc6151 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.730-190112" +pandora_version="7.0NG.730-190113" 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 029a910bd2..f333fca800 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.730'; -use constant AGENT_BUILD => '190112'; +use constant AGENT_BUILD => '190113'; # 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 119bcd4b5a..a6b0b51975 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.730 -%define release 190112 +%define release 190113 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 13800f74b1..2341ada7af 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.730 -%define release 190112 +%define release 190113 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 c498fb066e..fdb2435445 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190112" +PI_BUILD="190113" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b6b1768d3d..0c20d37aa5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190112} +{190113} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a743ceb71e..5d1f049ec8 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.730(Build 190112)") +#define PANDORA_VERSION ("7.0NG.730(Build 190113)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f7b6bee405..b172f886c7 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.730(Build 190112))" + VALUE "ProductVersion", "(7.0NG.730(Build 190113))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 242938b323..03b1d6e04b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190112 +Version: 7.0NG.730-190113 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 868ec1e5e4..f63c954604 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.730-190112" +pandora_version="7.0NG.730-190113" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4d1453f917..58ad2b9686 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 = 'PC190112'; +$build_version = 'PC190113'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index cd1eeca07f..4c01e19d4e 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index e78a99970e..e540371620 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.730 -%define release 190112 +%define release 190113 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 38656a9f30..07bbfb9000 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.730 -%define release 190112 +%define release 190113 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index aeb039df51..019ef9d63e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190112" +PI_BUILD="190113" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 677b36473c..431b312ddc 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.730 PS190112"; +my $version = "7.0NG.730 PS190113"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index da5ebbf9d9..3efd78ff98 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.730 PS190112"; +my $version = "7.0NG.730 PS190113"; # save program name for logging my $progname = basename($0); From ad9a316a47685593e19114985ad8ec4a2dcbd2f4 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 14 Jan 2019 00:01:23 +0100 Subject: [PATCH 11/19] Auto-updated build strings. Former-commit-id: 3426e636c31a7a9dcea09e442811310a4956d6ce --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 4b414446ae..93d33eeb57 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190113 +Version: 7.0NG.730-190114 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 62d7dc6151..401f8a55f5 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.730-190113" +pandora_version="7.0NG.730-190114" 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 f333fca800..689d78d6f8 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.730'; -use constant AGENT_BUILD => '190113'; +use constant AGENT_BUILD => '190114'; # 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 a6b0b51975..f720753314 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.730 -%define release 190113 +%define release 190114 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 2341ada7af..4c91275acb 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.730 -%define release 190113 +%define release 190114 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 fdb2435445..2f507648aa 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190113" +PI_BUILD="190114" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0c20d37aa5..ae07cdabda 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190113} +{190114} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5d1f049ec8..44c51021fe 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.730(Build 190113)") +#define PANDORA_VERSION ("7.0NG.730(Build 190114)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b172f886c7..d0afbe404d 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.730(Build 190113))" + VALUE "ProductVersion", "(7.0NG.730(Build 190114))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 03b1d6e04b..39804f1c84 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190113 +Version: 7.0NG.730-190114 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 f63c954604..bae1a3364a 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.730-190113" +pandora_version="7.0NG.730-190114" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 58ad2b9686..42aa1ddd86 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 = 'PC190113'; +$build_version = 'PC190114'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4c01e19d4e..3345cf73b8 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index e540371620..3d68990e7f 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.730 -%define release 190113 +%define release 190114 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 07bbfb9000..d5d1314c95 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.730 -%define release 190113 +%define release 190114 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 019ef9d63e..17745ba520 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190113" +PI_BUILD="190114" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 431b312ddc..8c9df508ca 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.730 PS190113"; +my $version = "7.0NG.730 PS190114"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 3efd78ff98..1aaca520e2 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.730 PS190113"; +my $version = "7.0NG.730 PS190114"; # save program name for logging my $progname = basename($0); From 5a8e46d608c88f58ab0961572125de2c1f13925c Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 14 Jan 2019 12:10:43 +0100 Subject: [PATCH 12/19] modify the way event responses are executed in event list Former-commit-id: 14ef545eef10427d95f96484e8d6b8d9656bd53c --- pandora_console/include/ajax/events.php | 46 ++++-- .../include/javascript/pandora_events.js | 87 ++++++++++- .../operation/events/events.build_table.php | 138 +++++++++++++++++- 3 files changed, 254 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index afdd2fc759..4138b048f6 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -193,25 +193,49 @@ if ($dialogue_event_response) { $event_id = get_parameter ('event_id'); $response_id = get_parameter ('response_id'); $command = get_parameter ('target'); - + $massive = get_parameter ('massive'); + $end = get_parameter ('end'); + $show_execute_again_btn = get_parameter ('show_execute_again_btn'); + $out_iterator = get_parameter ('out_iterator'); $event_response = db_get_row('tevent_response','id',$response_id); $event = db_get_row('tevento','id_evento',$event_id); $prompt = "
> "; - switch($event_response['type']) { case 'command': - echo "
"; - echo $prompt.sprintf(__('Executing command: %s',$command)); - echo "

"; + - echo ""; - echo "
"; - - echo "
"; + if ($massive) { + echo "
"; + echo $prompt.sprintf("(Event #$event_id) ".__('Executing command: %s',$command)); + echo "

"; + + echo ""; + echo "
"; + + if ($end) { + + echo "
"; + } + } + else { + + echo "
"; + echo $prompt.sprintf(__('Executing command: %s',$command)); + echo "

"; + + echo ""; + echo "
"; + + echo "
"; + } + break; case 'url': $command = str_replace("localhost",$_SERVER['SERVER_NAME'],$command); diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 02eac5553c..5c680a319d 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -158,10 +158,11 @@ function show_response_dialog(event_id, response_id, response) { var params = []; params.push("page=include/ajax/events"); params.push("dialogue_event_response=1"); + params.push("massive=0"); params.push("event_id="+event_id); params.push("target="+response['target']); params.push("response_id="+response_id); - + jQuery.ajax ({ data: params.join ("&"), type: 'POST', @@ -187,6 +188,54 @@ function show_response_dialog(event_id, response_id, response) { }); } +//Show the modal window of event responses when multiple events are selected +function show_massive_response_dialog(event_id, response_id, response, out_iterator, end) { + var ajax_file = $('#hidden-ajax_file').val(); + + var params = []; + params.push("page=include/ajax/events"); + params.push("dialogue_event_response=1"); + params.push("massive=1"); + params.push("end="+end); + params.push("out_iterator="+out_iterator); + params.push("event_id="+event_id); + params.push("target="+response['target']); + params.push("response_id="+response_id); + + + jQuery.ajax ({ + data: params.join ("&"), + response_tg: response['target'], + response_id: response_id, + out_iterator: out_iterator, + type: 'POST', + url: action=ajax_file, + dataType: 'html', + success: function (data) { + if (out_iterator === 0) + $("#event_response_window").empty(); + + $("#event_response_window").hide () + .append (data) + .dialog ({ + title: $('#select_custom_response option:selected').html(), + resizable: true, + draggable: true, + modal: false, + open: function(event, ui) { + $('#response_loading_dialog').hide(); + $('#button-submit_event_response').show(); + }, + width: response['modal_width'], + height: response['modal_height'] + }) + .show (); + + perform_response_massive(this.response_tg, this.response_id, this.out_iterator); + } + }); +} + // Get an event response from db function get_response(response_id) { var ajax_file = $('#hidden-ajax_file').val(); @@ -371,6 +420,42 @@ function perform_response(target, response_id) { return false; } +// Perform a response and put the output into a div +function perform_response_massive(target, response_id, out_iterator) { + var ajax_file = $('#hidden-ajax_file').val(); + + $('#re_exec_command').hide(); + $('#response_loading_command_'+out_iterator).show(); + $('#response_out_'+out_iterator).html(''); + + var finished = 0; + var time = Math.round(+new Date()/1000); + var timeout = time + 10; + + var params = []; + params.push("page=include/ajax/events"); + params.push("perform_event_response=1"); + params.push("target="+target); + params.push("response_id="+response_id) + + jQuery.ajax ({ + data: params.join ("&"), + type: 'POST', + url: action=ajax_file, + async: true, + timeout: 10000, + dataType: 'html', + success: function (data) { + var out = data.replace(/[\n|\r]/g, "
"); + $('#response_out_'+out_iterator).html(out); + $('#response_loading_command_'+out_iterator).hide(); + $('#re_exec_command_'+out_iterator).show(); + } + }); + + return false; +} + // Change the status of an event to new, in process or validated function event_change_status(event_ids) { var ajax_file = $('#hidden-ajax_file').val(); diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 92b7eecad8..881ea4ac32 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -20,6 +20,8 @@ require_once ($config["homedir"] . "/include/functions_ui.php"); $sort_field = get_parameter("sort_field", "timestamp"); $sort = get_parameter("sort", "down"); +$response_id = get_parameter ("response_id", ""); + $table = new stdClass(); if(!isset($table->width)) { $table->width = '100%'; @@ -887,9 +889,8 @@ else { echo '
'; if (!$readonly && $show_validate_button) { - html_print_button(__('In progress selected'), 'validate_button', false, 'validate_selected(2);', 'class="sub ok"'); - echo " "; - html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected(1);', 'class="sub ok"'); + $array_events_actions['in_progress_selected'] = 'In progress selected'; + $array_events_actions['validate_selected'] = 'Validate selected'; // Fix: validated_selected JS function has to be included with the proper user ACLs ?> '; echo ''; + + $sql_event_resp = "SELECT id, name FROM tevent_response WHERE type LIKE 'command'"; + $event_responses = db_get_all_rows_sql ($sql_event_resp); + + foreach ($event_responses as $val) + $array_events_actions[$val['id']] = $val['name']; + + echo '
'; + echo '
'; + html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); + echo '  '; + html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); + echo ""; + echo '
'; + echo ''; + echo '
'; } + + ?> + + ' . __('No events') . '
'; } echo '
'; } -?> +?> \ No newline at end of file From efa2e5332ff70f427018548ccc08694f2f7fd10f Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 14 Jan 2019 13:40:49 +0100 Subject: [PATCH 13/19] fix massive custom event responses Former-commit-id: 24db40167b05bfd7fe4de88060f03a7a0ec38e73 --- .../operation/events/events.build_table.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 881ea4ac32..064a26d294 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -971,14 +971,6 @@ else { $('#button-submit_event_response').hide(function() { $('#response_loading_dialog').show(function() { - var total_checked = $(".chk_val:checked").length; - - // Limit number of events to apply custom responses to for performance reasons - if (total_checked > 10) { - $('#max_custom_event_resp_msg').show(); - return; - } - $(".chk_val").each(function() { if ($(this).is(":checked")) { @@ -1002,14 +994,6 @@ else { $('#button-btn_str').hide(function() { $('#execute_again_loading').show(function() { - var total_checked = $(".chk_val:checked").length; - - // Limit number of events to apply custom responses to for performance reasons - if (total_checked > 10) { - $('#max_custom_event_resp_msg').show(); - return; - } - $(".chk_val").each(function() { if ($(this).is(":checked")) { From 68946234297aa993f4f4f9f5c98b1bc1cd734d5e Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 15 Jan 2019 00:01:25 +0100 Subject: [PATCH 14/19] Auto-updated build strings. Former-commit-id: 582bbf87e0972212cf48dc220871981f80974321 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 93d33eeb57..cc0f3850df 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190114 +Version: 7.0NG.730-190115 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 401f8a55f5..861f6db6e6 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.730-190114" +pandora_version="7.0NG.730-190115" 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 689d78d6f8..94995fcac4 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.730'; -use constant AGENT_BUILD => '190114'; +use constant AGENT_BUILD => '190115'; # 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 f720753314..aa2d6205b4 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.730 -%define release 190114 +%define release 190115 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 4c91275acb..86c141d0cb 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.730 -%define release 190114 +%define release 190115 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 2f507648aa..8d554c6ec7 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190114" +PI_BUILD="190115" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ae07cdabda..afcb597e6d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190114} +{190115} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 44c51021fe..0d53efcb89 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.730(Build 190114)") +#define PANDORA_VERSION ("7.0NG.730(Build 190115)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d0afbe404d..c8c4cee86b 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.730(Build 190114))" + VALUE "ProductVersion", "(7.0NG.730(Build 190115))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 39804f1c84..a0cf1e6211 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190114 +Version: 7.0NG.730-190115 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 bae1a3364a..9da4a3959e 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.730-190114" +pandora_version="7.0NG.730-190115" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 42aa1ddd86..18f1ba08b3 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 = 'PC190114'; +$build_version = 'PC190115'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 3345cf73b8..193dd05f03 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 3d68990e7f..f3ed455dce 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.730 -%define release 190114 +%define release 190115 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index d5d1314c95..0ecc406f6e 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.730 -%define release 190114 +%define release 190115 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 17745ba520..d459159431 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190114" +PI_BUILD="190115" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8c9df508ca..df9dc55d28 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.730 PS190114"; +my $version = "7.0NG.730 PS190115"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1aaca520e2..bf45ed3b20 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.730 PS190114"; +my $version = "7.0NG.730 PS190115"; # save program name for logging my $progname = basename($0); From 1ed90180c9eb388fe0c4699d8a242a0d5c6a27f3 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 15 Jan 2019 11:27:05 +0100 Subject: [PATCH 15/19] disable actions in event list when centralized mode is enabled and improve behavior of checkboxes when a massive action is applied Former-commit-id: 11f4606d2e7dd9b91c918323dc8a3dada0c8f765 --- pandora_console/include/javascript/pandora_events.js | 3 +++ pandora_console/operation/events/events.build_table.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 5c680a319d..c2fda51dfb 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -226,6 +226,9 @@ function show_massive_response_dialog(event_id, response_id, response, out_itera $('#response_loading_dialog').hide(); $('#button-submit_event_response').show(); }, + close: function(event, ui) { + $( ".chk_val" ).prop( "checked", false ); + }, width: response['modal_width'], height: response['modal_height'] }) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 064a26d294..ee0dde9431 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -1027,6 +1027,8 @@ else { delete_selected(); break; } + + $( ".chk_val" ).prop( "checked", false ); } } From 5235b62c0d3fe07d53310ec254e0b93b56b0526f Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 15 Jan 2019 11:29:12 +0100 Subject: [PATCH 16/19] fix disable actions in event list when centralized mode is enabled Former-commit-id: d5f16b4453b1e291ba051cd381fc6c09ce0bd027 --- .../operation/events/events.build_table.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index ee0dde9431..bf674d88a6 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -927,15 +927,17 @@ else { foreach ($event_responses as $val) $array_events_actions[$val['id']] = $val['name']; - echo '
'; - echo '
'; - html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); - echo '  '; - html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); - echo ""; - echo '
'; - echo ''; - echo '
'; + if (!$config["centralized_management"]) { + echo '
'; + echo '
'; + html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); + echo '  '; + html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); + echo ""; + echo '
'; + echo ''; + echo '
'; + } } ?> From 9048a138402a5b6ca8c39e0a104d3a3e6c061cc1 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 15 Jan 2019 13:27:14 +0100 Subject: [PATCH 17/19] fix bug: in progress events deleting on event view massive deletion Former-commit-id: 4c4f0a387ad3abd7cfea913b45c885ab3af4ecc6 --- .../operation/events/events.build_table.php | 6 +++--- pandora_console/operation/events/events.php | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index bf674d88a6..dab7d5439c 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -900,10 +900,12 @@ else { validate_event_advanced($(this).val(), new_status); } }); + location.reload(); } @@ -927,7 +929,7 @@ else { foreach ($event_responses as $val) $array_events_actions[$val['id']] = $val['name']; - if (!$config["centralized_management"]) { + if ($config['event_replication'] != 1) { echo '
'; echo '
'; html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); @@ -1029,8 +1031,6 @@ else { delete_selected(); break; } - - $( ".chk_val" ).prop( "checked", false ); } } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index ad692695ae..5f76201864 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -559,6 +559,18 @@ if ($validate) { if ($delete) { $ids = (array) get_parameter ("validate_ids", -1); + // Discard deleting in progress events + $in_process_status = db_get_all_rows_sql(" + SELECT id_evento + FROM tevento + WHERE estado=2"); + + foreach ($in_process_status as $val) { + if (($key = array_search($val['id_evento'], $ids)) !== false) { + unset($ids[$key]); + } + } + if ($ids[0] != -1) { $return = events_delete_event ($ids, ($group_rep == 1), $meta); ui_print_result_message ($return, From aabcf732103c2540449fc6601aa1737cb3bbc039 Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Tue, 15 Jan 2019 16:33:52 +0100 Subject: [PATCH 18/19] Fixed bug in functions_api Former-commit-id: 28e5d9cf323dd04432ca5cabcd447e8cbf748706 --- pandora_console/include/functions_api.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 8c4bc6520c..8695ad9b1d 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9774,6 +9774,11 @@ function api_set_create_event($id, $trash1, $other, $returnType) { return; } $values['id_grupo'] = $other['data'][1]; + + if (groups_get_name($values['id_grupo']) === false) { + returnError('error_parameter', 'Group ID does not exist'); + return; + } } else { returnError('error_parameter', 'Group ID required.'); @@ -10117,7 +10122,7 @@ function api_get_netflow_get_summary ($discard_1, $discard_2, $params) { } //http://localhost/pandora_console/include/api.php?op=set&op2=validate_event_by_id&id=23&apipass=1234&user=admin&pass=pandora -function api_set_validate_event_by_id ($id, $trash1, $trash2, $returnType) { +function api_set_validate_event_by_id ($id, $trash1 = null, $trash2 = null, $returnType = 'string') { global $config; $data['type'] = 'string'; $check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id); @@ -10136,7 +10141,7 @@ function api_set_validate_event_by_id ($id, $trash1, $trash2, $returnType) { 'ack_utimestamp' => $ack_utimestamp, 'estado' => 1 ); - + $result = db_process_sql_update('tevento', $values, array('id_evento' => $id)); if ($result === false) { From fe13a117aa4ab79a840b8fc963aaa7fdd7eed200 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 16 Jan 2019 00:01:27 +0100 Subject: [PATCH 19/19] Auto-updated build strings. Former-commit-id: 04682af4f07a1cb2bae17db88c4a4f4e17ad5600 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index cc0f3850df..758ee6811a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.730-190115 +Version: 7.0NG.730-190116 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 861f6db6e6..4e5706c7cf 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.730-190115" +pandora_version="7.0NG.730-190116" 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 94995fcac4..9646cee020 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.730'; -use constant AGENT_BUILD => '190115'; +use constant AGENT_BUILD => '190116'; # 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 aa2d6205b4..bd1b569af4 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.730 -%define release 190115 +%define release 190116 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 86c141d0cb..1156c6297a 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.730 -%define release 190115 +%define release 190116 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 8d554c6ec7..b4c3b66bab 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190115" +PI_BUILD="190116" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index afcb597e6d..3c639031de 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190115} +{190116} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0d53efcb89..87cec0dbac 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.730(Build 190115)") +#define PANDORA_VERSION ("7.0NG.730(Build 190116)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c8c4cee86b..91df373d23 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.730(Build 190115))" + VALUE "ProductVersion", "(7.0NG.730(Build 190116))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a0cf1e6211..d7e1669bf6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.730-190115 +Version: 7.0NG.730-190116 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 9da4a3959e..af3a24ea27 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.730-190115" +pandora_version="7.0NG.730-190116" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 18f1ba08b3..280aba46a5 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 = 'PC190115'; +$build_version = 'PC190116'; $pandora_version = 'v7.0NG.730'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 193dd05f03..a82dfc4ca6 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -116,7 +116,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index f3ed455dce..87903a3efb 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.730 -%define release 190115 +%define release 190116 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0ecc406f6e..1f46908e02 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.730 -%define release 190115 +%define release 190116 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d459159431..636984f6b0 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.730" -PI_BUILD="190115" +PI_BUILD="190116" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index df9dc55d28..da655fa933 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.730 PS190115"; +my $version = "7.0NG.730 PS190116"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5169fabe09..85e8ce85f6 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.730 PS190115"; +my $version = "7.0NG.730 PS190116"; # save program name for logging my $progname = basename($0);