".$lang_label["ag_title"]." > "; echo $lang_label["monitor_listing"].""; $ag_freestring = get_parameter ("ag_freestring", ""); $ag_modulename = get_parameter ("ag_modulename", ""); $ag_group = get_parameter ("ag_group", -1); $offset = get_parameter ("offset", 0); $status = get_parameter ("status", 0); $URL = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$lang_label["group"].""; echo ""; echo ""; echo lang_string ("Monitor status"); echo ""; echo ""; echo "
".$lang_label["module_name"]." "; echo ""; echo lang_string ("Free text"); echo ""; echo ""; echo ""; echo ""; echo "
"; // Begin Build SQL sentences $SQL_pre = "SELECT tagente_modulo.id_agente_modulo, tagente.nombre, tagente_modulo.nombre, tagente_modulo.descripcion, tagente.id_grupo, tagente.id_agente, tagente_modulo.id_tipo_modulo, tagente_modulo.module_interval "; $SQL_pre_count = "SELECT count(tagente_modulo.id_agente_modulo) "; $SQL = " FROM tagente, tagente_modulo, tagente_estado WHERE tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente.disabled = 0 AND tagente_modulo.id_tipo_modulo in (2, 9, 12, 18, 6, 100) AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo "; // Agent group selector if ($ag_group > 1) $SQL .=" AND tagente.id_grupo = ".$ag_group; else { // User has explicit permission on group 1 ? $all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='$id_user' AND id_grupo = 1"); if ($all_group == 0) $SQL .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') "; } // Module name selector // This code thanks for an idea from Nikum, nikun_h@hotmail.com if ($ag_modulename != "") $SQL .= " AND tagente_modulo.nombre = '$ag_modulename'"; // Freestring selector if ($ag_freestring != "") $SQL .= " AND ( tagente.nombre LIKE '%".$ag_freestring."%' OR tagente_modulo.nombre LIKE '%".$ag_freestring."%' OR tagente_modulo.descripcion LIKE '%".$ag_freestring."%') "; // Status selector if ($status == 1) $SQL .= " AND tagente_estado.estado = 0 "; elseif ($status == 0) $SQL .= " AND tagente_estado.estado = 1 "; // Final order $SQL .= " ORDER BY tagente.id_grupo, tagente.nombre"; // Build final SQL sentences $SQL_FINAL = $SQL_pre . $SQL; $SQL_COUNT = $SQL_pre_count . $SQL; $counter = get_db_sql ($SQL_COUNT); if ( $counter > $config["block_size"]) { pagination ($counter, $URL, $offset); $SQL_FINAL .= " LIMIT $offset , ".$config["block_size"]; } if ($counter > 0){ echo " "; $color =1; $result=mysql_query($SQL_FINAL); while ($data=mysql_fetch_array($result)){ //while there are agents if ($color == 1){ $tdcolor="datos"; $color =0; } else { $tdcolor="datos2"; $color =1; } echo ""; echo ""; echo ""; echo ""; } echo "
".$lang_label["agent"]." ".$lang_label["type"]." ".$lang_label["name"]." ".$lang_label["description"]." ".$lang_label["interval"]." ".$lang_label["status"]." ".$lang_label["timestamp"]."
"; echo ""; echo ""; echo ""; echo "". strtoupper(substr($data[1],0,21)).""; echo ""; echo "". substr($data[2],0,21). "".substr($data[3],0,30).""; if ($data[7] == 0){ $my_interval = give_agentinterval($data[5]); } else { $my_interval = $data[7]; } echo $my_interval; $query_gen2='SELECT * FROM tagente_estado WHERE id_agente_modulo = '.$data[0]; $result_gen2=mysql_query($query_gen2); $data2=mysql_fetch_array($result_gen2); echo ""; if ($data2["datos"] > 0){ echo ""; } else { echo ""; } echo ""; $seconds = time() - $data2["utimestamp"]; if ($seconds >= ($my_interval*2)) echo ""; else echo ""; echo human_time_comparation($data2["timestamp"]); echo "
"; } else { echo "
".$lang_label["no_monitors_g"]."
"; } echo ""; echo ""; echo ""; echo ""; echo "
"; echo "  ".lang_string("Monitor up")."  ".lang_string("Monitor down")."
"; ?>