".$lang_label["ag_title"]." > "; echo $lang_label["monitor_listing"].""; if (isset($_POST["ag_group"])) $ag_group = $_POST["ag_group"]; elseif (isset($_GET["group_id"])) $ag_group = $_GET["group_id"]; else $ag_group = -1; if (isset($_GET["ag_group_refresh"])){ $ag_group = $_GET["ag_group_refresh"]; } if (isset($_POST["ag_group"])){ $ag_group = $_POST["ag_group"]; echo "
"; } else { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$lang_label["group"].""; echo ""; // Module name selector // This code thanks for an idea from Nikum, nikun_h@hotmail.com if (isset($_POST["ag_modulename"])){ $ag_modulename = $_POST["ag_modulename"]; echo ""; } else { echo ""; } echo ""; echo "
".$lang_label["green_light"]."
"; echo "
".$lang_label["red_light"]."
".$lang_label["module_name"]." "; echo " "; // Show only selected names & groups if ($ag_group > 1) $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre'; else $sql='SELECT * FROM tagente ORDER BY id_grupo, nombre'; echo "
"; echo "
"; $color =1; $result=mysql_query($sql); if (mysql_num_rows($result)){ while ($row=mysql_fetch_array($result)){ //while there are agents if ($row["disabled"] == 0) { if ((isset($ag_modulename)) && ($ag_modulename != $lang_label["all"])){ $query_gen='SELECT id_agente, id_tipo_modulo, module_interval, id_agente_modulo, nombre, descripcion FROM tagente_modulo WHERE id_agente = '.$row["id_agente"].' AND nombre = "'.entrada_limpia($_POST["ag_modulename"]).'" AND id_tipo_modulo in (2, 9, 12, 18, 6, 100)'; // generic_proc, remote_tcp_proc, ??, remote_snmp_proc, remote_icmp_proc } else { $query_gen='SELECT id_agente, id_tipo_modulo, module_interval, id_agente_modulo, nombre, descripcion FROM tagente_modulo WHERE id_agente = '.$row["id_agente"].' AND id_tipo_modulo in (2, 9, 12, 18, 6, 100)'; } $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor="datos"; $color =0; } else { $tdcolor="datos2"; $color =1; } if (!isset($string)) {$string='';} $string=$string. ""; $string=$string. ""; $string=$string.""; $string=$string. ""; $string=$string."". strtoupper(substr(dame_nombre_agente($data["id_agente"]),0,21)).""; $string=$string.""; $string=$string." "; $string=$string."". substr($data["nombre"],0,21).""; $string=$string."". substr($data["descripcion"],0,30).""; $string=$string.""; if ($data["module_interval"] == 0){ $my_interval = give_agentinterval($data["id_agente"]); } else { $my_interval = $data["module_interval"]; } $string .= $my_interval; $query_gen2='SELECT * FROM tagente_estado WHERE id_agente_modulo = '.$data["id_agente_modulo"]; $result_gen2=mysql_query($query_gen2); $data2=mysql_fetch_array($result_gen2); $string=$string.""; if ($data2["datos"] > 0){ $string=$string.""; } else { $string=$string.""; } $string=$string.""; $seconds = time() - $data2["utimestamp"]; if ($seconds >= ($my_interval*2)) $string .= ""; else $string .= ""; $string .= human_time_comparation($data2["timestamp"])." "; } } } } if (isset($string)) { echo " "; echo $string; //the built table of monitors echo "
".$lang_label["agent"]." ".$lang_label["type"]." ".$lang_label["name"]." ".$lang_label["description"]." ".$lang_label["interval"]." ".$lang_label["status"]." ".$lang_label["timestamp"]."
"; } else { echo "
".$lang_label["no_monitors_g"]."
"; } } else { echo "
".$lang_label["no_agent"]."
"; } ?>