, 2003-2006 // Raul Mateos , 2005-2006 // Load globar vars require("include/config.php"); if (comprueba_login() == 0) { // $id_agente can be obtained as global variable or GET param. if (isset($_GET["id_agente"])){ $id_agente = $_GET["id_agente"]; } echo "

".$lang_label["monitor_listing"]." ".$lang_label["help"]."

"; // Get all module from agent $sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' order by tagente_modulo.nombre'; $result_t=mysql_query($sql_t); if (mysql_num_rows ($result_t)) { $color=0; $string=''; while ($row_t=mysql_fetch_array($result_t)){ # For evey module in the status table $est_modulo = $row_t["nombre"]; $est_tipo = dame_nombre_tipo_modulo($row_t["id_tipo_modulo"]); $est_description = $row_t["descripcion"]; $est_timestamp = $row_t["timestamp"]; $est_estado = $row_t["estado"]; $est_datos = $row_t["datos"]; $est_cambio = $row_t["cambio"]; $est_interval = $row_t["module_interval"]; if (($est_interval != $intervalo) && ($est_interval > 0)) { $temp_interval = $est_interval; } else { $temp_interval = $intervalo; } if ($est_estado <>100){ # si no es un modulo de tipo datos # Determinamos si se ha caido el agente (tiempo de intervalo * 2 superado) if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } $ahora=date("Y/m/d H:i:s"); $seconds = strtotime($ahora) - strtotime($row_t["timestamp"]); if ($seconds >= ($temp_interval*2)) // If every interval x 2 secs. we get nothing, there's and alert $agent_down = 1; else $agent_down = 0; if (!isset($string)) {$string='';} $string=$string."".$est_tipo; $string=$string."".$est_modulo; $string=$string."".substr($est_description,0,32); // echo "".$row3["datos"]; if ($agent_down == 1) $string=$string.""; else if ($est_estado == 1) if ($est_cambio ==1) $string=$string.""; else $string=$string.""; else $string=$string.""; $string=$string."".$temp_interval; $string=$string.""; if ($agent_down == 1) // Si el agente esta down, lo mostramos en negrita y en rojo $string=$string.""; $string=$string.$row_t["timestamp"].""; } else unset($string); } if (isset($string)) { echo ""; echo $string; echo '
".$lang_label["type"]."".$lang_label["module_name"]."".$lang_label["description"]."".$lang_label["status"]."".$lang_label["interval"]."".$lang_label["last_contact"]."
'; } else { echo "".$lang_label["no_monitors"].""; } } else echo "".$lang_label["no_monitors"].""; } ?>