$model->url, 'label' => __('Cluster list'), 'selected' => false, ]; $bc[] = [ 'link' => $model->url.'&op=view&id='.$cluster->id(), 'label' => __('Cluster details'), 'selected' => true, ]; $html->prepareBreadcrum($bc); // Header. $main_page = ''; $main_page .= html_print_image( 'images/logs@svg.svg', true, [ 'title' => __('Cluster list'), 'class' => 'main_menu_icon invert_filter', ] ); $main_page .= ''; $edit = ''; $edit .= html_print_image( 'images/configuration@svg.svg', true, [ 'title' => __('Edit this cluster'), 'class' => 'main_menu_icon invert_filter', ] ); $edit .= ''; ui_print_page_header( __('Cluster details').' » '.$cluster->name(), '', false, // Help link. 'cluster_view', true, // Buttons. [ [ 'active' => false, 'text' => $main_page, ], [ 'active' => false, 'text' => $edit, ], ], false, '', GENERIC_SIZE_TEXT, '', $html->printHeader(true) ); if (empty($error) === false) { echo $error; } if (empty($message) === false) { echo $message; } if ($critical === true) { // Print always go back button. HTML::printForm($model->getGoBackForm(), false); return; } /* * * All this block has been retrieved from 'estado_generalagente.php' as * described in issue #5755. * */ /* * * * CLUSTER AGENT DETAILS. * */ // Prepare information for view. $alive_animation = agents_get_status_animation( agents_get_interval_status($cluster->agent()->toArray(), false) ); $agent_name = ui_print_agent_name( $cluster->agent()->id_agente(), true, 500, 'font-size: medium;font-weight:bold', true, '', '', false, false ); $in_planned_downtime = db_get_sql( 'SELECT executed FROM tplanned_downtime INNER JOIN tplanned_downtime_agents ON tplanned_downtime.id = tplanned_downtime_agents.id_downtime WHERE tplanned_downtime_agents.id_agent = '.$cluster->agent()->id_agente().' AND tplanned_downtime.executed = 1' ); if ($cluster->agent()->disabled()) { if ($in_planned_downtime) { $agent_name = ''.$agent_name.ui_print_help_tip(__('Disabled'), true); } else { $agent_name = ''.$agent_name.''.ui_print_help_tip(__('Disabled'), true); } } else if ($cluster->agent()->quiet()) { if ($in_planned_downtime) { $agent_name = "".$agent_name.' '.html_print_image('images/dot_blue.png', true, ['border' => '0', 'title' => __('Quiet'), 'alt' => '']); } else { $agent_name = "".$agent_name.' '.html_print_image('images/dot_blue.png', true, ['border' => '0', 'title' => __('Quiet'), 'alt' => '']).''; } } else { $agent_name = $agent_name; } if ($in_planned_downtime && !$cluster->agent()->disabled() && !$cluster->agent()->quiet()) { $agent_name .= ' '.ui_print_help_tip( __('Agent in scheduled downtime'), true, 'images/minireloj-16.png' ).''; } else if (($in_planned_downtime && !$cluster->agent()->disabled()) || ($in_planned_downtime && !$cluster->agent()->quiet()) ) { $agent_name .= ' '.ui_print_help_tip( __('Agent in scheduled downtime'), true, 'images/clock.svg' ).''; } $table_agent_header = '
'; $table_agent_header .= $agent_name; $table_agent_header .= '
'; $table_agent_header .= '
'; if (!$config['show_group_name']) { $table_agent_header .= ui_print_group_icon( $cluster->agent()->id_grupo(), true, 'groups_small', 'padding-right: 6px;' ); } $table_agent_header .= '
'; $status_img = agents_detail_view_status_img( $cluster->agent()->critical_count(), $cluster->agent()->warning_count(), $cluster->agent()->unknown_count(), $cluster->agent()->total_count(), $cluster->agent()->notinit_count() ); $table_agent_header .= '
'.$status_img.'
'; $table_agent_header .= '  '; $table_agent_header .= ''.html_print_image( 'images/force@svg.svg', true, [ 'title' => __('Force cluster status calculation'), 'alt' => '', 'class' => 'main_menu_icon invert_filter', ] ).''; // Fixed width non interactive charts. $status_chart_width = 180; $graph_width = 180; $table_agent_graph = '
'; $table_agent_graph .= graph_agent_status( $cluster->agent()->id_agente(), $graph_width, $graph_width, true, false, false, true ); $table_agent_graph .= '
'; $table_agent_os = '

'.ui_print_os_icon( $cluster->agent()->id_os(), false, true, true, false, false, false, ['title' => __('OS').': '.get_os_name($cluster->agent()->id_os())] ); $table_agent_os .= (empty($cluster->agent()->os_version()) === true) ? get_os_name((int) $cluster->agent()->id_os()) : $cluster->agent()->os_version().'

'; $addresses = agents_get_addresses($cluster->agent()->id_agente()); $address = agents_get_address($cluster->agent()->id_agente()); foreach ($addresses as $k => $add) { if ($add == $address) { unset($addresses[$k]); } } if (empty($address) === false) { $table_agent_ip = '

'.html_print_image( 'images/web@groups.svg', true, [ 'title' => __('IP address'), 'class' => 'main_menu_icon invert_filter', ] ); $table_agent_ip .= ''; $table_agent_ip .= empty($address) ? ''.__('N/A').'' : $address; $table_agent_ip .= '

'; } $table_agent_description = '

'.html_print_image( 'images/logs@svg.svg', true, [ 'title' => __('Description'), 'class' => 'main_menu_icon invert_filter', ] ); $table_agent_description .= ''; $table_agent_description .= empty( $cluster->description() ) ? ''.__('N/A').'' : $cluster->description(); $table_agent_description .= '

'; $table_agent_count_modules = reporting_tiny_stats( $cluster->agent()->toArray(), true, 'agent', // Useless. ':', true ); $table_agent_version = '

'.html_print_image( 'images/version.png', true, [ 'title' => __('Agent Version'), 'class' => 'invert_filter', ] ); $table_agent_version .= ''; $table_agent_version .= empty($cluster->agent()->agent_version()) ? ''.__('Cluster agent').'' : $cluster->agent()->agent_version(); $table_agent_version .= '

'; /* * * MAP * */ $nodes = $cluster->getNodes(); $font_size = 20; $width = '45%'; $height = '500'; $node_radius = 40; // Generate map. $map_manager = new NetworkMap( [ 'nodes' => $nodes, 'no_pandora_node' => 1, 'pure' => 1, 'map_options' => [ 'generation_method' => LAYOUT_SPRING1, 'font_size' => $font_size, 'node_radius' => $node_radius, 'height' => $height, 'width' => '100%', 'tooltip' => true, 'size_image' => 50, 'z_dash' => 0.5, 'map_filter' => [ 'node_sep' => 7, 'node_radius' => 50, 'x_offs' => 130, 'y_offs' => -70, ], ], ] ); /* * * EVENTS 24h * */ $table_events = '
'; $table_events .= '
'; $table_events .= ''; $table_events .= __('Events (Last 24h)'); $table_events .= ''; $table_events .= '
'; $table_events .= '
'; $table_events .= graph_graphic_agentevents( $cluster->agent()->id_agente(), 95, 70, SECONDS_1DAY, '', true, true, 500 ); $table_events .= '
'; $table_events .= '
'; ?>
printMap(); ?>
agent()->id_agente(); require_once $config['homedir'].'/operation/agentes/estado_monitores.php'; ?>
'sub ok', 'icon' => 'next', ], true ); echo '
'; html_print_action_buttons( implode('', $buttons), ['type' => 'form_action'] ); echo '
'; // Print always go back button. HTML::printForm($model->getGoBackForm(), false);