diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 91f24b80bc..b4a41c494d 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -122,10 +122,11 @@ class Tree public function setFilter($filter) { // There is not module filter in metaconsole. - if (is_metaconsole()) { + /* + if (is_metaconsole()) { $filter['searchModule'] = ''; $filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS; - } + }*/ $this->filter = $filter; } diff --git a/pandora_console/include/lib/Dashboard/Widgets/groups_status.php b/pandora_console/include/lib/Dashboard/Widgets/groups_status.php index c4ed2e72b2..2ba42f7bc2 100755 --- a/pandora_console/include/lib/Dashboard/Widgets/groups_status.php +++ b/pandora_console/include/lib/Dashboard/Widgets/groups_status.php @@ -340,6 +340,7 @@ class GroupsStatusWidget extends Widget // Head agents. $table->data[0][0] = ''; + $table->data[0][0] .= html_print_image( 'images/agent.png', true, @@ -359,38 +360,70 @@ class GroupsStatusWidget extends Widget $table->data[0][1] .= ''; if ($stats['total_agents'] !== 0) { + if (is_metaconsole() === true) { + $agentdetail_url = $url.'&statusAgent='; + } else { + $agentdetail_url = $url.'&status='; + } + // Agent Critical. - $table->data[1][0] = $this->getCellCounter( + $agent_url = ''; + $agent_url .= $agentdetail_url.'1'; + $agent_data = ''; + $agent_data .= $this->getCellCounter( $stats['agent_critical'], '', 'bg_ff5' ); + $agent_data .= ''; + + $table->data[1][0] = $agent_data; // Agent Warning. - $table->data[2][0] = $this->getCellCounter( + $agent_url = ''; + $agent_url .= $agentdetail_url.'2'; + $agent_data = ''; + $agent_data .= $this->getCellCounter( $stats['agent_warning'], '', 'bg_ffd' ); + $agent_data .= ''; + $table->data[2][0] = $agent_data; // Agent OK. - $table->data[3][0] = $this->getCellCounter( + $agent_url = ''; + $agent_url .= $agentdetail_url.'0'; + $agent_data = ''; + $agent_data .= $this->getCellCounter( $stats['agent_ok'], '', 'bg_82B92E' ); + $agent_data .= ''; + $table->data[3][0] = $agent_data; // Agent Unknown. - $table->data[1][1] = $this->getCellCounter( + $agent_url = ''; + $agent_url .= $agentdetail_url.'3'; + $agent_data = ''; + $agent_data .= $this->getCellCounter( $stats['agent_unknown'], '#B2B2B2' ); + $agent_data .= ''; + $table->data[1][1] = $agent_data; // Agent Not Init. - $table->data[2][1] = $this->getCellCounter( + $agent_url = ''; + $agent_url .= $agentdetail_url.'5'; + $agent_data = ''; + $agent_data .= $this->getCellCounter( $stats['agent_not_init'], '#4a83f3' ); + $agent_data .= ''; + $table->data[2][1] = $agent_data; $data .= html_print_table($table, true); $data .= ''; @@ -436,38 +469,69 @@ class GroupsStatusWidget extends Widget $table->data[0][1] .= ''; $table->data[0][1] .= ''; + if (is_metaconsole() === true) { + $monitordetail_url = $url.'&statusModule='; + } else { + $monitordetail_url = 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group='.$this->values['groupId'].'&status='; + } + // Modules Critical. - $table->data[1][0] = $this->getCellCounter( + $module_url = ''; + $module_url .= $monitordetail_url.'1'; + $module_data = ''; + $module_data .= $this->getCellCounter( $stats['monitor_critical'], '', 'bg_ff5' ); + $module_data .= ''; + $table->data[1][0] = $module_data; // Modules Warning. - $table->data[2][0] = $this->getCellCounter( + $module_url = ''; + $module_url .= $monitordetail_url.'2'; + $module_data = ''; + $module_data .= $this->getCellCounter( $stats['monitor_warning'], '', 'bg_ffd' ); + $module_data .= ''; + $table->data[2][0] = $module_data; // Modules OK. - $table->data[3][0] = $this->getCellCounter( + $module_url = ''; + $module_url .= $monitordetail_url.'0'; + $module_data = ''; + $module_data .= $this->getCellCounter( $stats['monitor_ok'], '', 'bg_82B92E' ); + $module_data .= ''; + $table->data[3][0] = $module_data; // Modules Unknown. - $table->data[1][1] = $this->getCellCounter( + $module_url = ''; + $module_url .= $monitordetail_url.'3'; + $module_data = ''; + $module_data .= $this->getCellCounter( $stats['monitor_unknown'], '#B2B2B2' ); + $module_data .= ''; + $table->data[1][1] = $module_data; // Modules Not Init. - $table->data[2][1] = $this->getCellCounter( + $module_url = ''; + $module_url .= $monitordetail_url.'5'; + $module_data = ''; + $module_data .= $this->getCellCounter( $stats['monitor_not_init'], '#4a83f3' ); + $module_data .= ''; + $table->data[2][1] = $module_data; $data .= html_print_table($table, true); $data .= ''; diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 41784398fe..2f690dc0b5 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -291,47 +291,46 @@ if (is_metaconsole() === true) { ); } -if (is_metaconsole() === false) { - // Module filter. - $module_status_arr = []; - $module_status_arr[-1] = __('All'); - // Default. - $module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal'); - $module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning'); - $module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical'); - $module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown'); - $module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init'); - $module_status_arr['fired'] = __('Fired alerts'); +// if (is_metaconsole() === false) { +// Module filter. +$module_status_arr = []; +$module_status_arr[-1] = __('All'); +// Default. +$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal'); +$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning'); +$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical'); +$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown'); +$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init'); +$module_status_arr['fired'] = __('Fired alerts'); - $table->data['last_row'][] = html_print_label_input_block( - __('Search module'), - html_print_input_text('search_module', $search_module, '', 25, 30, true) - ); +$table->data['last_row'][] = html_print_label_input_block( + __('Search module'), + html_print_input_text('search_module', $search_module, '', 25, 30, true) +); - $table->data['last_row'][] = html_print_label_input_block( - __('Show not init modules'), - html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true) - ); - - $table->data['last_row'][] = html_print_label_input_block( - __('Module status'), - html_print_select( - $module_status_arr, - 'status_module', - $status_module, - '', - '', - 0, - true, - false, - false, - '', - false, - 'width:100%' - ) - ); -} +$table->data['last_row'][] = html_print_label_input_block( + __('Show not init modules'), + html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true) +); +$table->data['last_row'][] = html_print_label_input_block( + __('Module status'), + html_print_select( + $module_status_arr, + 'status_module', + $status_module, + '', + '', + 0, + true, + false, + false, + '', + false, + 'width:100%' + ) +); +// } $form_html = '