$module) { if($module == $name){ $modules_by_name[$cont-1]['id'][] = $key; } else{ $name = $module; $modules_by_name[$cont]['name'] = $name; $modules_by_name[$cont]['id'][] = $key; $cont ++; } } echo '
<< | "; } echo "".__("Agents")." \\ ".__("Modules")." | "; $nmodules = 0; foreach($modules_by_name as $module) { $nmodules++; if($nmodules <= $hor_offset || $nmodules > ($hor_offset+$block)) { continue; } echo "".printTruncateText($module['name'],4, false)." | "; } if(($hor_offset + $block) < $nmodules) { $new_hor_offset = $hor_offset+$block; echo ">> | "; } $agents = get_agents (array ('offset' => (int) $offset, 'limit' => (int) $config['block_size'])); // Prepare pagination pagination ((int)count(get_agents ())); echo "|
---|---|---|---|---|
"; } echo " | ".printTruncateText($agent['nombre'],20)." | "; $agent_modules = get_agent_modules($agent['id_agente']); $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 = get_agentmodule_status($module_id); echo ""; switch($status){ case 0: print_status_image ('module_ok.png', $module['name']." in ".$agent['nombre'].": ".__('NORMAL')); break; case 1: print_status_image ('module_critical.png', $module['name']." in ".$agent['nombre'].": ".__('CRITICAL')); break; case 2: print_status_image ('module_warning.png', $module['name']." in ".$agent['nombre'].": ".__('WARNING')); break; case 3: print_status_image ('module_unknown.png', $module['name']." in ".$agent['nombre'].": ".__('UNKNOWN')); break; case 4: print_status_image ('module_alertsfired.png', $module['name']." in ".$agent['nombre'].": ".__('ALERTS FIRED')); break; } echo " | "; $match = true; } } if(!$match) { echo ""; } } if(($hor_offset+$block) < $nmodules) { echo " | "; } echo " |
" . __("The colours meaning:") . "