'.__("Tag's information").''; echo ""; foreach ($tags as $tag) { echo ''; echo ''; echo ''; echo ''; } echo '
'; if (tags_get_module_policy_tags($tag, $id_agente_modulo)) { html_print_image( 'images/policies_mc.png', false, [ 'style' => 'vertical-align: middle;', 'class' => 'invert_filter', ] ); } echo ''; echo tags_get_name($tag); echo '
'; return; } if ($get_relations_tooltip === true) { $id_agente_modulo = (int) get_parameter('id_agente_modulo'); if ($id_agente_modulo === 0) { return; } $id_agente = modules_get_agentmodule_agent($id_agente_modulo); $params = [ 'id_agent' => $id_agente, 'id_module' => $id_agente_modulo, ]; $relations = modules_get_relations($params); if (empty($relations) === true) { return; } $table_relations = new stdClass(); $table_relations->id = 'module_'.$id_agente_modulo.'_relations'; $table_relations->width = '100%'; $table_relations->class = 'databox filters'; $table_relations->style = []; $table_relations->style[0] = 'font-weight: bold;'; $table_relations->style[2] = 'font-weight: bold;'; $table_relations->head = []; $table_relations->head[0] = __('Relationship information'); $table_relations->head_colspan[0] = 4; $table_relations->data = []; foreach ($relations as $relation) { if ($relation['module_a'] == $id_agente_modulo) { $id_module = $relation['module_b']; } else { $id_module = $relation['module_a']; } $id_agent = modules_get_agentmodule_agent($id_module); $data = []; $data[0] = __('Agent'); $data[1] = ui_print_agent_name($id_agent, true); $data[2] = __('Module'); $data[3] = "".ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_medium', true, true, true, '[…]').''; $table_relations->data[] = $data; } html_print_table($table_relations); return; } return; } if (isset($id_agente) === false) { // This page is included, $id_agente should be passed to it. db_pandora_audit( AUDIT_LOG_HACK_ATTEMPT, 'Trying to get the monitor list without id_agent passed' ); include 'general/noaccess.php'; exit; } $id_agent = (int) get_parameter('id_agente'); $status_filter_monitor = (int) get_parameter('status_filter_monitor', -1); $status_text_monitor = get_parameter('status_text_monitor', ''); $status_hierachy_mode = get_parameter('status_hierachy_mode', -1); $sort_field = get_parameter('sort_field', 'name'); $sort = get_parameter('sort', 'up'); $modules_not_init = agents_monitor_notinit($id_agente); if (empty($modules_not_init) === false) { $help_not_init = ui_print_warning_message( __('Non-initialized modules found.') ); } else { $help_not_init = ''; } ob_start(); print_form_filter_monitors( $id_agente, $status_filter_monitor, $status_text_monitor, $status_hierachy_mode ); echo html_print_div( [ 'id' => 'module_list', 'content' => '', ], true ); $html_toggle = ob_get_clean(); html_print_div( [ 'class' => 'agent_details_line', 'content' => ui_toggle( $html_toggle, __('List of modules').' '.$help_not_init.ui_print_help_tip( __('To see the list of modules paginated, enable this option in the Styles Configuration.'), true ).reporting_tiny_stats( $agent, true, 'modules', ':', true, ), 'status_monitor_agent', false, false, true, '', 'white-box-content', 'box-flat white_table_graph w100p' ), ], ); ?> "; ui_include_time_picker(); ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); ?> __('All'), AGENT_MODULE_STATUS_CRITICAL_BAD => __('Critical'), AGENT_MODULE_STATUS_CRITICAL_ALERT => __('Alert'), AGENT_MODULE_STATUS_NORMAL => __('Normal'), AGENT_MODULE_STATUS_NOT_NORMAL => __('Not Normal'), AGENT_MODULE_STATUS_WARNING => __('Warning'), AGENT_MODULE_STATUS_UNKNOWN => __('Unknown'), ]; $rows = db_get_all_rows_sql( sprintf( 'SELECT * FROM tmodule_group WHERE id_mg IN (SELECT id_module_group FROM tagente_modulo WHERE id_agente = %d ) ORDER BY name', $id_agent ) ); $rows_select[-1] = __('All'); if (empty($rows) === false) { foreach ($rows as $module_group) { $rows_select[$module_group['id_mg']] = __($module_group['name']); } } $form_text = ''; $table = new stdClass(); $table->class = 'filter-table-adv'; // $table->id = 'module_filter_agent_view'; // $table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;'; $table->width = '100%'; $table->size[0] = '25%'; $table->size[1] = '25%'; $table->size[2] = '25%'; $table->size[3] = '25%'; // Captions. $table->data[0][0] = html_print_label_input_block( html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden( 'monitors_change_filter', 1, true ).__('Status:'), html_print_select( $status_list, 'status_filter_monitor', $status_filter_monitor, '', '', 0, true, false, true, 'w100p', false, 'width:100%' ) ); $table->data[0][1] = html_print_label_input_block( __('Free text for search (*):').ui_print_help_tip( __('Search by module name, list matches.'), true ), html_print_input_text( 'status_text_monitor', $status_text_monitor, '', '', 100, true ) ); $table->data[0][2] = html_print_label_input_block( __('Module group'), html_print_select( $rows_select, 'status_module_group', $status_module_group, '', '', 0, true, false, true, 'w100p', false, 'width:100%' ) ); $table->data[0][3] = html_print_label_input_block( __('Show in hierachy mode'), html_print_switch( [ 'name' => 'status_hierachy_mode', 'value' => $all_events_24h, 'onchange' => 'change_module_filter()', 'id' => 'checkbox-status_hierachy_mode', ] ) ); $form_text = html_print_table($table, true); $filtersButtons = []; $filtersButtons[] = html_print_button( __('Filter'), 'filter', false, 'filter_modules();', [ 'icon' => 'search', 'mode' => 'secondary mini', 'style' => 'margin-left: 15px', ], true ); $filtersButtons[] = html_print_button( __('Reset'), 'filter', false, 'reset_filter_modules();', [ 'icon' => 'fail', 'mode' => 'secondary mini', ], true ); // TODO. Unused code. if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) { $filter_hidden = true; } else { $filter_hidden = false; } echo $form_text; html_print_div( [ 'class' => 'action-buttons-right-forced', 'content' => implode('', $filtersButtons), ] ); }