// Additions to Pandora FMS 1.2 graph code and new XML reporting template management // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; version 2 // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Load global vars require("include/config.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 "

".$lang_label["agent_error"]."

"; echo ""; include ("general/footer.php"); exit; } } echo "

".$lang_label["ag_title"]." > ".$lang_label["view_agent_general_data"]." ".$lang_label["help"]."

"; // Blank space below title echo "
"; echo ''; echo "
"; echo ''; echo "'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if ($agent_type == 0) { echo ''; } else { echo ''; } // Total packets echo ''; // Last contact echo '
"; echo '
'.$lang_label["agent_name"].' '.strtoupper(salida_limpia($nombre_agente)); echo "".$lang_label["refresh_data"].""."  "; // Data base access graph echo '
'.$lang_label["ip_address"].' '; // Show all address for this agent, show first the main IP (taken from tagente table) echo ""; //if ($agent_type == 0) { echo '
'.$lang_label["os"].' - '.dame_so_name($id_os); if ($os_version != "") echo ' '.salida_limpia($os_version); /* } elseif ($agent_type == 1) { echo '
'.$lang_label["agent_type"].' '; }*/ echo '
'.$lang_label["interval"].' '.$intervalo.'
'.salida_limpia($lang_label["description"]).' '.$comentarios.'
'.salida_limpia($lang_label["group"]).'    '.dame_grupo($id_grupo).'
'.$lang_label["agentversion"].' '.salida_limpia($agent_version).'
'.$lang_label["agentversion"].' N/A
'.$lang_label["total_packets"].' '; $total_paketes= 0; $sql_3='SELECT COUNT(*) FROM tagente_datos WHERE id_agente = '.$id_agente; $result_3=mysql_query($sql_3); $row3=mysql_fetch_array($result_3); $total_paketes = $row3[0]; echo $total_paketes; echo '
'.$lang_label["last_contact"]." / ".$lang_label["remote"].' '; if ($ultima_act == "0000-00-00 00:00:00"){ echo $lang_label["never"]; } else { echo $ultima_act; } echo " / "; if ($ultima_act_remota == "0000-00-00 00:00:00"){ echo $lang_label["never"]; } else { echo $ultima_act_remota; } // Asigned/active server echo '
'.$lang_label["server_asigned"].' '; if ($server == ""){ echo "N/A"; } else { echo give_server_name($server); } // Next contact $ultima = strtotime($ultima_act); $ahora = strtotime("now"); $diferencia = $ahora - $ultima; // Get higher interval set for the set of modules from this agent $sql_maxi ="SELECT MAX(module_interval) FROM tagente_modulo WHERE id_agente = ".$id_agente; $result_maxi=mysql_query($sql_maxi); if ($row_maxi=mysql_fetch_array($result_maxi)) if ($row_maxi[0] > 0 ) $intervalo = $row_maxi[0]; if ($intervalo > 0){ $percentil = round($diferencia/(($intervalo*2) / 100)); } else { $percentil = -1; } echo "
".$lang_label['next_contact']."
".$lang_label["agent_access_rate"]."

".$lang_label["agent_module_shareout"]."

"; } ?>