"ANY(SELECT id_agente FROM tagente WHERE id_grupo = " . $group); db_process_sql_update('tagente_modulo', array("flag" => 1), $where); } else { db_pandora_audit("ACL Violation", "Trying to set flag for groups"); require ("general/noaccess.php"); exit; } } if ($config["realtimestats"] == 0) { $updated_info = __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true); } else { $updated_info = __("Updated at realtime"); } $updated_time = $updated_info; $modulegroup = get_parameter('modulegroup', 0); $refr = get_parameter('refr', 30); // By default 30 seconds $group_id = (int)get_parameter('group_id', 0); $offset = (int)get_parameter('offset', 0); $hor_offset = (int)get_parameter('hor_offset', 0); $block = $config['block_size']; $groups = users_get_groups (); $filter_module_groups = '
'; $filter_groups = ''; $comborefr = '"; if ($config["pure"] == 0) { $fullscreen['text'] = '' . html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode'))) . ""; } else { $fullscreen['text'] = '' . html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode'))) . ""; $config['refr'] = $refr; } $onheader = array('updated_time' => $updated_time, 'fullscreen' => $fullscreen, 'combo_module_groups' => $filter_module_groups, 'combo_groups' => $filter_groups); if ($config['pure'] == 1) { $onheader['combo_refr'] = $comborefr; } // Header ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $updated_time); // Old style table, we need a lot of special formatting,don't use table function // Prepare old-style table echo '" . $filter_module_groups . " | "; echo "" . $filter_groups . " | "; if ($config['pure'] == 1) echo "" . $comborefr . " | "; echo "" . __("Full screen") . "" . $fullscreen['text'] . " | "; echo "
" . __("Agents") . " / " . __("Modules") . " | "; if ($hor_offset > 0) { $new_hor_offset = $hor_offset-$block; echo "" . "" . html_print_image("images/arrow_left.png", true, array('title' => __('Previous modules'))) . "" . " | "; } $nmodules = 0; foreach ($modules_by_name as $module) { $nmodules++; if ($nmodules <= $hor_offset || $nmodules > ($hor_offset+$block)) { continue; } $text = ui_print_truncate_text(io_safe_output($module['name']), 'module_small'); echo '
| ';
}
if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = $hor_offset+$block;
echo "" . "" . html_print_image( "images/arrow.png", true, array('title' => __('More modules'))) . "" . " | "; } echo "
---|---|---|---|
" . ui_print_truncate_text(io_safe_output($agent['nombre']), 'agent_size_text_small', true, true, true, '...', 'font-size:10px; font-weight: bold;') . " | "; $agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, false); $nmodules = 0; foreach ($modules_by_name as $module) { $nmodules++; if ($nmodules <= $hor_offset || $nmodules > ($hor_offset+$block)) { continue; } $match = false; foreach ($module['id'] as $module_id) { if (!$match && array_key_exists($module_id,$agent_modules)) { $status = modules_get_agentmodule_status($module_id); echo ""; $win_handle = dechex(crc32($module_id.$module["name"])); $graph_type = return_graphtype (modules_get_agentmodule_type($module_id)); $link ="winopeng('" . "operation/agentes/stat_win.php?" . "type=$graph_type&" . "period=" . SECONDS_1DAY . "&" . "id=" . $module_id . "&" . "label=" . rawurlencode( urlencode( base64_encode($module["name"]))) . "&" . "refresh=" . SECONDS_10MINUTES . "', 'day_".$win_handle."')"; echo ''; switch ($status) { case AGENT_MODULE_STATUS_NORMAL: ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; case AGENT_MODULE_STATUS_CRITICAL_BAD: ui_print_status_image ('module_critical.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; case AGENT_MODULE_STATUS_WARNING: ui_print_status_image ('module_warning.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; case AGENT_MODULE_STATUS_UNKNOWN: ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; case 4: ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); break; } echo ''; echo " | "; $match = true; } } if (!$match) { echo ""; } } echo " |
" . __('Legend') . " | |
" . __("Orange cell when the module has fired alerts") . " | |
" . __("Red cell when the module has a critical status") . " | |
" . __("Yellow cell when the module has a warning status") . " | |
" . __("Green cell when the module has a normal status") . " | |
" . __("Grey cell when the module has an unknown status") . " |