2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
|
|
|
// Pandora - The Free Monitoring System
|
|
|
|
// This code is protected by GPL license.
|
|
|
|
// Este codigo esta protegido por la licencia GPL.
|
|
|
|
// Sancho Lerena <slerena@gmail.com>, 2003-2006
|
|
|
|
// Raul Mateos <raulofpandora@gmail.com>, 2005-2006
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
require("include/config.php");
|
|
|
|
//require("include/functions.php");
|
|
|
|
//require("include/functions_db.php");
|
|
|
|
if (comprueba_login() == 0) {
|
|
|
|
|
|
|
|
if (isset($_GET["id_agente"])){
|
|
|
|
$id_agente = $_GET["id_agente"];
|
|
|
|
// Connect BBDD
|
|
|
|
$sql1='SELECT * FROM tagente WHERE id_agente = '.$id_agente;
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
if ($row=mysql_fetch_array($result)){
|
|
|
|
$intervalo = $row["intervalo"]; // Interval in seconds to receive data
|
|
|
|
$nombre_agente = $row["nombre"];
|
|
|
|
$direccion_agente =$row["direccion"];
|
|
|
|
$ultima_act = $row["ultimo_contacto"];
|
|
|
|
$ultima_act_remota =$row["ultimo_contacto_remoto"];
|
|
|
|
$comentarios = $row["comentarios"];
|
|
|
|
$id_grupo = $row["id_grupo"];
|
|
|
|
$id_os= $row["id_os"];
|
|
|
|
$os_version = $row["os_version"];
|
|
|
|
$agent_version = $row["agent_version"];
|
|
|
|
$disabled= $row["disabled"];
|
|
|
|
$agent_type= $row["agent_type"];
|
|
|
|
$server = $row["id_server"];
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
echo "<h3 class='error'>".$lang_label["agent_error"]."</h3>";
|
|
|
|
echo "</table>";
|
|
|
|
include ("general/footer.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Load icon index from tgrupos
|
|
|
|
$iconindex_g[]="";
|
|
|
|
|
|
|
|
$sql_tg='SELECT id_grupo, icon FROM tgrupo';
|
|
|
|
$result_tg=mysql_query($sql_tg);
|
|
|
|
while ($row_tg=mysql_fetch_array($result_tg)){
|
|
|
|
$iconindex_g[$row_tg["id_grupo"]] = $row_tg["icon"];
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<h2>".$lang_label["ag_title"]."</h2>";
|
2006-07-04 12:09:39 +02:00
|
|
|
echo "<h3>".$lang_label["view_agent_general_data"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3321' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
2006-03-27 05:37:27 +02:00
|
|
|
echo '<table cellspacing=3 cellpadding=3 border=0 width=750>';
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["agent_name"].'</b> <td class="datos">'.salida_limpia($nombre_agente);
|
|
|
|
|
|
|
|
echo " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'><img src='images/refresh.gif' class='top' border=0></a>";
|
|
|
|
if (dame_admin($_SESSION['id_usuario'])==1 )
|
|
|
|
echo " <a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$id_agente."'><img src='images/setup.gif' border=0 width=19 class='top' ></a>";
|
|
|
|
// Data base access graph
|
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
echo "<td rowspan=4><b>".$lang_label["agent_access_rate"]."</b><br><br>
|
|
|
|
<img border=1 src='reporting/fgraph.php?id=".$id_agente."&tipo=agentaccess&periodo=1440' border=0>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["ip_address"].'</b> <td class="datos2">'.salida_limpia($direccion_agente);
|
2006-03-27 05:37:27 +02:00
|
|
|
if ($agent_type == 0) {
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["os"].'</b> <td class="datos"><img border=0 src="images/'.dame_so_icon($id_os).'"> - '.dame_so_name($id_os);
|
|
|
|
} elseif ($agent_type == 1) {
|
2006-07-01 03:48:56 +02:00
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["agent_type"].'</b> <td class="datos2"><img border=0 src="images/network.gif"';
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
|
|
|
if ($os_version != "") echo ' v'.salida_limpia($os_version);
|
2006-07-01 03:48:56 +02:00
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["interval"].'</b> <td class="datos2">'.$intervalo;
|
2006-03-27 05:37:27 +02:00
|
|
|
echo '<tr><td class="datos"><b>'.salida_limpia($lang_label["description"]).'</b> <td class="datos">'.$comentarios;
|
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
echo "<td rowspan=6><b>".$lang_label["agent_module_shareout"]."</b><br><br>";
|
|
|
|
echo "<img border=1 src='reporting/fgraph.php?id=".$id_agente."&tipo=agentmodules' border=0>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
echo '<tr><td class="datos2"><b>'.salida_limpia($lang_label["group"]).'</b> <td class="datos2"> <img src="images/g_'.$iconindex_g[$row["id_grupo"]].'.gif" border="0"> ( '.dame_grupo($id_grupo).' )';
|
2006-03-27 05:37:27 +02:00
|
|
|
if ($agent_type == 0) {
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["agentversion"].'</b> <td class="datos">'.salida_limpia($agent_version);
|
|
|
|
}
|
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
// Total packets
|
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["total_packets"].'</b> <td class="datos2">';
|
2006-03-27 05:37:27 +02:00
|
|
|
$total_paketes= 0;
|
|
|
|
$id_agente = dame_agente_id($nombre_agente);
|
|
|
|
$sql_2='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
|
|
|
|
$result_t=mysql_query($sql_2);
|
|
|
|
while ($row=mysql_fetch_array($result_t)){
|
|
|
|
$sql_3='SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"];
|
|
|
|
$result_3=mysql_query($sql_3);
|
|
|
|
$row3=mysql_fetch_array($result_3);
|
|
|
|
$total_paketes = $total_paketes + $row3[0];
|
|
|
|
}
|
|
|
|
echo $total_paketes;
|
|
|
|
|
2006-07-01 03:48:56 +02:00
|
|
|
// Last contact
|
2006-03-27 05:37:27 +02:00
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["last_contact"]." / ".$lang_label["remote"].'</b> <td class="datosf9">';
|
|
|
|
echo $ultima_act." / ".$ultima_act_remota;
|
2006-07-01 03:48:56 +02:00
|
|
|
|
|
|
|
// Asigned/active server
|
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["server_asigned"].'</b> <td class="datos2">';
|
|
|
|
if ($server == ""){
|
|
|
|
echo "N/A";
|
2006-03-27 05:37:27 +02:00
|
|
|
} else {
|
|
|
|
echo give_server_name($server);
|
|
|
|
}
|
2006-07-01 03:48:56 +02:00
|
|
|
|
|
|
|
// Next contact
|
|
|
|
|
|
|
|
$ultima = strtotime($ultima_act);
|
|
|
|
$ahora = strtotime("now");
|
|
|
|
$diferencia = $ahora - $ultima;
|
|
|
|
if ($intervalo > 0){
|
|
|
|
$percentil = round($diferencia/(($intervalo*2) / 100));
|
|
|
|
} else {
|
|
|
|
echo "N/A";
|
|
|
|
}
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["next_contact"].'</b> <td class="datos2">';
|
|
|
|
echo "<img src='reporting/fgraph.php?tipo=progress&percent=".$percentil."&height=20&width=200'>";
|
2006-03-27 05:37:27 +02:00
|
|
|
echo "</td></tr></table>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-07-05 15:33:13 +02:00
|
|
|
?>
|