diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c6caa93c43..c08c213aff 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.748-200804 +Version: 7.0NG.748-200811 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 98737a607a..d446c8d824 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.748-200804" +pandora_version="7.0NG.748-200811" 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 6e16e3bf43..a5c63ffd55 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -55,7 +55,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.748'; -use constant AGENT_BUILD => '200804'; +use constant AGENT_BUILD => '200811'; # 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 e61e022d4c..683386c5e0 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.748 -%define release 200804 +%define release 200811 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 afbccad224..33f2dbdb1b 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.748 -%define release 200804 +%define release 200811 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 24872b6049..b6de8386b4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.748" -PI_BUILD="200804" +PI_BUILD="200811" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/grep_log b/pandora_agents/unix/plugins/grep_log index 76661c5230..2143464b48 100755 --- a/pandora_agents/unix/plugins/grep_log +++ b/pandora_agents/unix/plugins/grep_log @@ -56,6 +56,8 @@ my $Reg_exp = ''; # Flag to show or not summary module my $summary_flag = 0; +my $nodatalist_flag = 0; + # Number of coincidences found my $coincidences = 0; @@ -120,7 +122,15 @@ sub error_msg ($) { # Print a help message. ############################################################################### sub print_help () { - print "Usage: $0 [--summary]\n"; + print "Usage: $0 [--summary] [--nodatalist]\n\n"; + print "Options:\n"; + print "\t\t\tPath to the log file to be monitored\n"; + print "\t\t\tName of the module that will be created\n"; + print "\t\t\tRegex string to be matched in log file\n"; + print "\t\tShows NUM lines before matching lines to provide context\n"; + print "\t\tShows NUM lines after matching lines to provide context\n"; + print "\t--summary\t\tCreates a module with the total number of matches\n"; + print "\t--nodatalist\t\tInserts all coincidences in a single data output instead of a data per line\n"; } ############################################################################### @@ -317,6 +327,7 @@ sub print_log ($) { if ($#kdata < 0) { print_summary() if ($summary_flag == 1); return; + } # Log module @@ -341,6 +352,18 @@ sub print_log ($) { $output = "\n"; $output .= "\n"; $output .= "\n"; + if ($nodatalist_flag == 1){ + $output .= "{$line}}) { + my $processed_line = $content; + $processed_line =~ "\n"; + $output .= $processed_line; + } + } + $output .= "]]>\n"; + } + else { $output .= "\n"; foreach my $line (@kdata) { $output .= "\n"; } $output .= "\n"; + } $output .= "\n"; print stdout $output; } + } ############################################################################### @@ -376,12 +401,18 @@ $Reg_exp = trim($ARGV[2]); my $up_lines = trim($ARGV[3]); my $bot_lines = trim($ARGV[4]); my $sum_flag = trim($ARGV[5]); +my $nodatalist = trim($ARGV[6]); -if ( ( defined($up_lines) && ($up_lines eq "--summary")) - || ( defined($bot_lines) && ($bot_lines eq "--summary")) - || ( defined($sum_flag) && ($sum_flag eq "--summary")) ) { - $summary_flag = 1; +if ( grep { /--summary/ } @ARGV ) +{ + $summary_flag = 1; } + +if ( grep { /--nodatalist/ } @ARGV ) +{ + $nodatalist_flag = 1; +} + # Create index file storage directory if ( ! -d $Idx_dir) { mkdir($Idx_dir) || error_msg("Error creating directory $Idx_dir: " diff --git a/pandora_agents/win32/bin/util/grep_log.exe b/pandora_agents/win32/bin/util/grep_log.exe index 4e4029fb60..dbabc454b4 100644 Binary files a/pandora_agents/win32/bin/util/grep_log.exe and b/pandora_agents/win32/bin/util/grep_log.exe differ diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2956285e7d..eba7041fb5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200804} +{200811} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index cb81732026..ec1084545f 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.748(Build 200804)") +#define PANDORA_VERSION ("7.0NG.748(Build 200811)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 69e7afa4fe..7e1c5246b0 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.748(Build 200804))" + VALUE "ProductVersion", "(7.0NG.748(Build 200811))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/.htaccess b/pandora_console/.htaccess index a1e6f62d2d..ca572f7df1 100644 --- a/pandora_console/.htaccess +++ b/pandora_console/.htaccess @@ -4,5 +4,4 @@ Options -Indexes Order Allow,Deny Deny from All - - + \ No newline at end of file diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 812a5a30d5..957f209119 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.748-200804 +Version: 7.0NG.748-200811 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 924911c102..3b64b77f3c 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.748-200804" +pandora_version="7.0NG.748-200811" package_pear=0 package_pandora=1 diff --git a/pandora_console/attachment/.htaccess b/pandora_console/attachment/.htaccess index 71f7bf9540..ddd1f3ee4c 100644 --- a/pandora_console/attachment/.htaccess +++ b/pandora_console/attachment/.htaccess @@ -6,6 +6,4 @@ Deny from all Allow from localhost - -php_flag engine off - + \ No newline at end of file diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php index 4cb4a29740..0335ef76be 100644 --- a/pandora_console/general/alert_enterprise.php +++ b/pandora_console/general/alert_enterprise.php @@ -165,7 +165,12 @@ if (check_login()) { break; case 'monitorcheckmodal': - echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system.'); + // Get agent/module average. + $agentCount = db_get_value_sql('SELECT count(*) FROM tagente'); + $modulesCount = db_get_value_sql('SELECT count(*) FROM tagente_modulo'); + $average = ($modulesCount / $agentCount); + + echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 100 modules per agent. This configuration has %d modules per agent. Checkout the Enterprise Version for a professional supported system.', $average); break; case 'remotemodulesmodal': diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 2ae1761f49..7aef28931b 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -24,7 +24,16 @@ require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_servers.php'; -$search_string = io_safe_output(urldecode(trim(get_parameter('search_string', '')))); +$search_string = io_safe_output( + urldecode( + trim( + get_parameter( + 'search_string', + '' + ) + ) + ) +); global $policy_page; @@ -32,17 +41,27 @@ if (!isset($policy_page)) { $policy_page = false; } -// Search string filter form + +echo '
'; + +echo ''; +echo "
"; +echo __('Search').' '.html_print_input_text( + 'search_string', + $search_string, + '', + 15, + 255, + true +); +html_print_input_hidden('search', 1); +// Search string filter form. if (($policy_page) || (isset($agent))) { echo ''; } else { echo ''; } -echo ''; -echo "'; echo "'; echo ""; echo ''; // Check if there is at least one server of each type available to assign that -// kind of modules. If not, do not show server type in combo +// kind of modules. If not, do not show server type in combo. $network_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 1' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $wmi_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 6' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $plugin_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 4' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $prediction_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 5' ); -// POSTGRESQL AND ORACLE COMPATIBLE -// Development mode to use all servers +// POSTGRESQL AND ORACLE COMPATIBLE. +// Development mode to use all servers. if ($develop_bypass || is_metaconsole()) { $network_available = 1; $wmi_available = 1; $plugin_available = 1; - // FIXME when prediction predictions server modules can be configured - // on metaconsole + // FIXME when prediction predictions server modules can be configured. + // on metaconsole. $prediction_available = is_metaconsole() ? 0 : 1; } @@ -140,7 +159,7 @@ if (($policy_page) || (isset($agent))) { } if ($show_creation) { - // Create module/type combo + // Create module/type combo. echo ''; if (!$policy_page) { echo ''; } echo ''; echo ''; echo "'; echo "'; -echo "'; +echo "'; +echo "'; echo "'; echo "'; @@ -175,6 +175,7 @@ echo "'; echo "'; echo "'; +echo "'; echo ''; echo '
"; -echo __('Search').' '.html_print_input_text('search_string', $search_string, '', 15, 255, true); - html_print_input_hidden('search', 1); echo '"; html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"'); @@ -50,38 +69,38 @@ echo '
'; @@ -151,13 +170,33 @@ if (($policy_page) || (isset($agent))) { $checked = false; } - html_print_checkbox('status_hierachy_mode', '', $checked, false, false, 'onChange=change_mod_filter();'); + html_print_checkbox( + 'status_hierachy_mode', + '', + $checked, + false, + false, + 'onChange=change_mod_filter();' + ); echo ''; echo __('

Type

'); - html_print_select($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;'); + html_print_select( + $modules, + 'moduletype', + '', + '', + '', + '', + false, + false, + false, + '', + false, + 'max-width:300px;' + ); html_print_input_hidden('edit_module', 1); echo '
'; @@ -212,7 +251,13 @@ if ($multiple_delete) { } enterprise_include_once('include/functions_config_agents.php'); - enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_agent_module_del), modules_get_agentmodule_name($id_agent_module_del)]); + enterprise_hook( + 'config_agents_delete_module_in_conf', + [ + modules_get_agentmodule_agent($id_agent_module_del), + modules_get_agentmodule_name($id_agent_module_del), + ] + ); $error = 0; @@ -220,7 +265,12 @@ if ($multiple_delete) { // error. NOTICE that we don't delete all data here, just marking for deletion // and delete some simple data. $status = ''; - $agent_id_of_module = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', (int) $id_agent_module_del); + $agent_id_of_module = db_get_value( + 'id_agente', + 'tagente_modulo', + 'id_agente_modulo', + (int) $id_agent_module_del + ); if (db_process_sql( "UPDATE tagente_modulo @@ -235,7 +285,7 @@ if ($multiple_delete) { ) { $error++; } else { - // Set flag to update module status count + // Set flag to update module status count. if ($agent_id_of_module !== false) { db_process_sql( 'UPDATE tagente @@ -286,32 +336,48 @@ if ($multiple_delete) { break; } - // Trick to detect if we are deleting a synthetic module (avg or arithmetic) - // If result is empty then module doesn't have this type of submodules - $ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_agent_module_del]); + // Trick to detect if we are deleting a synthetic module (avg or arithmetic). + // If result is empty then module doesn't have this type of submodules. + $ops_json = enterprise_hook( + 'modules_get_synthetic_operations', + [$id_agent_module_del] + ); $result_ops_synthetic = json_decode($ops_json); if (!empty($result_ops_synthetic)) { - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_agent_module_del]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [$id_agent_module_del] + ); if ($result === false) { $error++; } - } //end if - else { - $result_components = enterprise_hook('modules_get_synthetic_components', [$id_agent_module_del]); + } else { + $result_components = enterprise_hook( + 'modules_get_synthetic_components', + [$id_agent_module_del] + ); $count_components = 1; if (!empty($result_components)) { - // Get number of components pending to delete to know when it's needed to update orders + // Get number of components pending to delete to know when it's needed to update orders. $num_components = count($result_components); $last_target_module = 0; foreach ($result_components as $id_target_module) { - // Detects change of component or last component to update orders - if (($count_components == $num_components) or ($last_target_module != $id_target_module)) { + // Detects change of component or last component to update orders. + if (($count_components == $num_components) || ($last_target_module != $id_target_module) + ) { $update_orders = true; } else { $update_orders = false; } - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_agent_module_del, $update_orders]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [ + $id_target_module, + $id_agent_module_del, + $update_orders, + ] + ); if ($result === false) { $error++; } @@ -323,7 +389,7 @@ if ($multiple_delete) { } - // Check for errors + // Check for errors. if ($error != 0) { } else { $count_correct_delete_modules++; @@ -509,7 +575,7 @@ switch ($sortField) { } -// Build the order sql +// Build the order sql. if (!empty($order)) { $order_sql = ' ORDER BY '; } @@ -525,7 +591,7 @@ foreach ($order as $ord) { $order_sql .= $ord['field'].' '.$ord['order']; } -// Get limit and offset parameters +// Get limit and offset parameters. $limit = (int) $config['block_size']; $offset = (int) get_parameter('offset'); @@ -559,9 +625,15 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente); $search_string_entities = io_safe_input($search_string); -$basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", $search_string, $search_string_entities, $search_string, $search_string_entities); +$basic_where = sprintf( + "(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", + $search_string, + $search_string_entities, + $search_string, + $search_string_entities +); -// Tags acl +// Tags acl. $agent_tags = tags_get_user_applied_agent_tags($id_agente); if ($agent_tags !== true) { $where_tags = ' AND ttag_module.id_tag IN ('.implode(',', $agent_tags).')'; @@ -619,7 +691,7 @@ if ($modules === false) { return; } -// Prepare pagination +// Prepare pagination. $url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string); if ($paginate_module) { @@ -635,17 +707,48 @@ $table = new stdClass(); $table->width = '100%'; $table->class = 'info_table'; $table->head = []; -$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); -$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown); +$table->head['checkbox'] = html_print_checkbox( + 'all_delete', + 0, + false, + true, + false +); +$table->head[0] = __('Name').ui_get_sorting_arrows( + $url_name.'up', + $url_name.'down', + $selectNameUp, + $selectNameDown +); -// The access to the policy is granted only with AW permission -if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { +// The access to the policy is granted only with AW permission. +if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' +) +) { $table->head[1] = "".__('P.').''; } -$table->head[2] = "".__('S.').''.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown); -$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown); -$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown); +$table->head[2] = "".__('S.').''.ui_get_sorting_arrows( + $url_server.'up', + $url_server.'down', + $selectServerUp, + $selectServerDown +); +$table->head[3] = __('Type').ui_get_sorting_arrows( + $url_type.'up', + $url_type.'down', + $selectTypeUp, + $selectTypeDown +); +$table->head[4] = __('Interval').ui_get_sorting_arrows( + $url_interval.'up', + $url_interval.'down', + $selectIntervalUp, + $selectIntervalDown +); $table->head[5] = __('Description'); $table->head[6] = __('Status'); $table->head[7] = __('Warn'); @@ -690,7 +793,16 @@ if ($checked) { } foreach ($modules as $module) { - if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && ! check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) { + if (! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AW' + ) && ! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AD' + ) + ) { continue; } @@ -712,7 +824,9 @@ foreach ($modules as $module) { if (!$checked) { if ($module['id_module_group'] != $last_modulegroup) { $last_modulegroup = $module['id_module_group']; - $data[0] = ''.modules_get_modulegroup_name($last_modulegroup).''; + $data[0] = ''.modules_get_modulegroup_name( + $last_modulegroup + ).''; $i = array_push($table->data, $data); $table->rowstyle[($i - 1)] = 'text-align: center'; $table->rowclass[($i - 1)] = 'datos3'; @@ -727,14 +841,23 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - $data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); + $data['checkbox'] = html_print_checkbox( + 'id_delete[]', + $module['id_agente_modulo'], + false, + true + ); } $data[0] = ''; if (isset($module['deep']) && ($module['deep'] != 0)) { $data[0] .= str_repeat('    ', $module['deep']); - $data[0] .= html_print_image('images/icono_escuadra.png', true, ['style' => 'padding-bottom: inherit;']).'  '; + $data[0] .= html_print_image( + 'images/icono_escuadra.png', + true, + ['style' => 'padding-bottom: inherit;'] + ).'  '; } if ($module['quiet']) { @@ -754,17 +877,38 @@ foreach ($modules as $module) { } if ($module['disabled']) { - $data[0] .= ''.ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt').''; + $data[0] .= ''.ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ).''; } else { - $data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt'); + $data[0] .= ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ); } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { $data[0] .= ''; } - // The access to the policy is granted only with AW permission - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { + // The access to the policy is granted only with AW permission. + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' + ) + ) { $policyInfo = policies_info_module_policy($module['id_agente_modulo']); if ($policyInfo === false) { $data[1] = ''; @@ -798,17 +942,27 @@ foreach ($modules as $module) { } } - // Module type (by server type ) + // Module type (by server type ). $data[2] = ''; if ($module['id_modulo'] > 0) { $data[2] = servers_show_type($module['id_modulo']); } - $module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module['id_agente_modulo']); + $module_status = db_get_row( + 'tagente_estado', + 'id_agente_modulo', + $module['id_agente_modulo'] + ); - modules_get_status($module['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title); + modules_get_status( + $module['id_agente_modulo'], + $module_status['estado'], + $module_status['datos'], + $status, + $title + ); - // This module is initialized ? (has real data) + // This module is initialized ? (has real data). if ($status == STATUS_MODULE_NO_DATA) { $data[2] .= html_print_image( 'images/error.png', @@ -817,13 +971,13 @@ foreach ($modules as $module) { ); } - // Module type (by data type) + // Module type (by data type). $data[3] = ''; if ($type) { $data[3] = ui_print_moduletype_icon($type, true); } - // Module interval + // Module interval. if ($module['module_interval']) { $data[4] = human_time_description_raw($module['module_interval']); } else { @@ -831,12 +985,23 @@ foreach ($modules as $module) { } if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { - $data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true); + $data[4] .= ui_print_help_tip( + __('The policy modules of data type will only update their intervals when policy is applied.'), + true + ); } - $data[5] = ui_print_truncate_text($module['descripcion'], 'description', false); + $data[5] = ui_print_truncate_text( + $module['descripcion'], + 'description', + false + ); - $data[6] = ui_print_status_image($status, htmlspecialchars($title), true); + $data[6] = ui_print_status_image( + $status, + htmlspecialchars($title), + true + ); // MAX / MIN values. if ($module['id_tipo_modulo'] != 25) { @@ -884,7 +1049,7 @@ foreach ($modules as $module) { ); $data[8] .= ' '; - // Make a data normalization + // Make a data normalization. if (isset($numericModules[$type])) { if ($numericModules[$type] === true) { $data[8] .= ''; @@ -904,7 +1069,7 @@ foreach ($modules as $module) { $data[8] .= '  '; } - // create network component action + // Create network component action. if ((is_user_admin($config['id_user'])) && ($module['id_modulo'] == MODULE_NETWORK) ) { @@ -927,7 +1092,7 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - // Delete module + // Delete module. $data[9] = ''; $data[9] .= html_print_image( @@ -959,7 +1124,12 @@ html_print_table($table); if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { echo '
'; html_print_input_hidden('multiple_delete', 1); - html_print_submit_button(__('Delete'), 'multiple_delete', false, 'class="sub delete"'); + html_print_submit_button( + __('Delete'), + 'multiple_delete', + false, + 'class="sub delete"' + ); echo '
'; echo ''; } diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index f179da95fe..f509b104b4 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -464,6 +464,8 @@ $data[1] = html_print_select( $disabledBecauseInPolicy ); +$data[1] .= '

'.__('Manage credentials').''; + $array_os = [ 'inherited' => __('Inherited'), 'linux' => __('SSH'), diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index da68135ad3..1b57c53780 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -60,7 +60,7 @@ if ($al_action !== false) { __('Alerts').' » '.__('Configure alert action'), 'images/gm_alerts.png', false, - '', + 'alert_config', true ); } @@ -73,7 +73,7 @@ if ($al_action !== false) { __('Alerts').' » '.__('Configure alert action'), 'images/gm_alerts.png', false, - '', + 'alert_config', true ); } @@ -283,12 +283,12 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) { // Store the value in a hidden to keep it on first execution $table->data['field'.$i][1] .= html_print_input_hidden( 'field'.$i.'_value', - !empty($action['field'.$i]) ? $action['field'.$i] : '', + (!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '', true ); $table->data['field'.$i][2] .= html_print_input_hidden( 'field'.$i.'_recovery_value', - !empty($action['field'.$i.'_recovery']) ? $action['field'.$i.'_recovery'] : '', + (!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '', true ); } diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 1f7284ca5b..ddb06070b5 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -35,12 +35,15 @@ global $config; check_login(); -enterprise_hook('open_meta_frame'); - require_once $config['homedir'].'/include/functions_groups.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_users.php'; -enterprise_include_once('meta/include/functions_agents_meta.php'); + +if (is_metaconsole()) { + enterprise_include_once('include/functions_metaconsole.php'); + enterprise_include_once('meta/include/functions_agents_meta.php'); + enterprise_hook('open_meta_frame'); +} if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'AR')) { @@ -714,7 +717,12 @@ if ($tab == 'tree') { foreach ($groups as $key => $group) { $url = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; - $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo']; + if (is_metaconsole()) { + $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups'; + } else { + $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo']; + } + $table->data[$key][0] = $group['id_grupo']; $table->data[$key][1] = ''.$group['nombre'].''; if ($group['icon'] != '') { diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 70ac08216e..e6e0bcb862 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -164,9 +164,9 @@ echo '
".__('Percentil').'".html_print_checkbox('percentil', 1, $percentil, true).'
".__('Equalize maximum thresholds').''; - html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, false, false, '', false); -echo '
".__('Equalize maximum thresholds').'".html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, true, false, '', false); +echo '
".__('Add summatory series').'".html_print_checkbox('summatory_series', 1, $summatory_series, true)." ".__('Add average series').'
".__('Modules and series').'".html_print_checkbox('modules_series', 1, $modules_series, true).'".__('Show full scale graph (TIP)').'".html_print_checkbox('fullscale', 1, $fullscale, true).'
'; @@ -190,9 +191,9 @@ echo ''; echo '