" . __("Zero results found") . "
\n"; } } else { $table->cellpadding = 4; $table->cellspacing = 4; $table->width = "98%"; $table->class = "databox"; $table->head = array (); if ($only_count) { $table->head[0] = __('Agent'); $table->head[1] = __('OS'); $table->head[2] = __('Interval'); $table->head[3] = __('Group'); } else { $table->head[0] = __('Agent') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->head[1] = __('OS') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . ''; $table->head[2] = __('Interval') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectIntervalUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectIntervalDown)) . ''; $table->head[3] = __('Group') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown)) . ''; } $table->head[4] = __('Modules'); $table->head[5] = __('Status'); $table->head[6] = __('Alerts'); $table->head[7] = __('Last contact'). ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown)) . ''; $table->head[8] = ''; $table->align = array (); $table->align[0] = "left"; $table->align[1] = "left"; $table->align[2] = "left"; $table->align[3] = "left"; $table->align[4] = "left"; $table->align[5] = "left"; $table->align[6] = "left"; $table->align[7] = "left"; $table->align[8] = "center"; $table->data = array (); foreach ($agents as $agent) { $agent_info = reporting_get_agent_module_info ($agent["id_agente"]); $modulesCell = reporting_tiny_stats($agent_info, true); if ($agent['disabled']) { $cellName = "" . ''. ''.$agent["alias"].''. ui_print_help_tip(__('Disabled'), true) . ""; } else { $cellName = ''. ''.$agent["alias"].''; } if ($agent['quiet']) { $cellName .= " "; $cellName .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")); } $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 = '. $agent["id_agente"] . ' AND tplanned_downtime.executed = 1'); if ($in_planned_downtime) { $cellName .= "".ui_print_help_tip (__('Agent in planned downtime'), true, 'images/minireloj-16.png'); $cellName .= ""; } $last_time = strtotime ($agent["ultimo_contacto"]); $now = time (); $diferencia = $now - $last_time; $time = ui_print_timestamp ($last_time, true); $time_style = $time; if ($diferencia > ($agent["intervalo"] * 2)) $time_style = ''.$time.''; $manage_agent = ''; if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { $url_manage = 'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&id_agente='. $agent["id_agente"]; $manage_agent = '' . html_print_image("images/cog.png", true, array("title" => __('Manage'), "alt" => __('Manage'))) . ''; } array_push($table->data, array( $cellName, ui_print_os_icon ($agent["id_os"], false, true), human_time_description_raw($agent['intervalo'], false, 'tiny'), ui_print_group_icon ($agent["id_grupo"], true), $modulesCell, $agent_info["status_img"], $agent_info["alert_img"], $time_style, $manage_agent)); } echo "
"; if (!$only_count) { ui_pagination ($totalAgents); } html_print_table ($table); unset($table); if (!$only_count) { ui_pagination ($totalAgents); } } if ($only_count) { $list_agents = ob_get_clean(); } ?>