2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-04-01 15:53:11 +02:00
|
|
|
// Pandora FMS - the Free Monitoring System
|
2007-03-02 18:56:07 +01:00
|
|
|
// ========================================
|
2008-04-01 15:53:11 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es
|
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
|
|
|
|
2006-07-11 13:02:20 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-04-01 15:53:11 +02:00
|
|
|
// as published by the Free Software Foundation for 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.
|
2008-03-13 19:57:21 +01:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
// Load global vars
|
2008-07-21 14:23:28 +02:00
|
|
|
require ("include/config.php");
|
|
|
|
check_login ();
|
2006-07-11 13:02:20 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
if (isset($_GET["id_agente"])){
|
|
|
|
$id_agente = $_GET["id_agente"];
|
2006-03-27 05:37:27 +02:00
|
|
|
// Connect BBDD
|
2008-07-21 14:23:28 +02:00
|
|
|
$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"];
|
|
|
|
$id_parent= $row["id_parent"];
|
|
|
|
$os_version = $row["os_version"];
|
|
|
|
$agent_version = $row["agent_version"];
|
|
|
|
$disabled= $row["disabled"];
|
|
|
|
$network_server = $row["id_network_server"];
|
|
|
|
} else {
|
|
|
|
echo "<h3 class='error'>".$lang_label["agent_error"]."</h3>";
|
|
|
|
echo "</table>";
|
|
|
|
echo "</div><div id='foot'>";
|
|
|
|
include ("general/footer.php");
|
|
|
|
echo "</div>";
|
|
|
|
exit;
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2008-07-21 14:23:28 +02:00
|
|
|
}
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
echo "<h2>".$lang_label["ag_title"]." > ".$lang_label["view_agent_general_data"]."</h2>";
|
2007-03-02 18:56:07 +01:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
// Blank space below title
|
|
|
|
echo "<div style='height: 10px'> </div>";
|
|
|
|
|
|
|
|
echo '<table cellspacing="0" cellpadding="0" width="750" border=0 class="databox">';
|
|
|
|
echo "<tr><td>";
|
|
|
|
echo '<table cellspacing="4" cellpadding="4" border=0 class="databox">';
|
|
|
|
echo '<tr>
|
2006-11-17 23:56:50 +01:00
|
|
|
<td class="datos"><b>'.$lang_label["agent_name"].'</b></td>
|
2007-09-08 20:05:06 +02:00
|
|
|
<td class="datos"><b>'.strtoupper(salida_limpia($nombre_agente)).'</b></td>';
|
2008-07-21 14:23:28 +02:00
|
|
|
echo "<td class='datos2' width='40'>
|
2008-06-16 20:09:56 +02:00
|
|
|
<a class='info' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."&refr=60'><span>".$lang_label["refresh_data"]."</span><img src='images/refresh.png' class='top' border=0></a> ";
|
2008-07-21 14:23:28 +02:00
|
|
|
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&flag_agent=1&id_agente=$id_agente'><img src='images/target.png' border=0></A>";
|
|
|
|
// Data base access graph
|
|
|
|
echo '</td></tr>';
|
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["ip_address"].'</b></td><td class="datos2" colspan=2>';
|
|
|
|
// Show all address for this agent, show first the main IP (taken from tagente table)
|
|
|
|
echo "<select style='padding:0px' name='notused' size='1'>";
|
|
|
|
echo "<option>".salida_limpia($direccion_agente)."</option>";
|
|
|
|
$sql_2='SELECT id_a FROM taddress_agent WHERE id_agent = '.$id_agente;
|
|
|
|
$result_t=mysql_query($sql_2);
|
|
|
|
while ($row=mysql_fetch_array($result_t)){
|
|
|
|
$sql_3='SELECT ip FROM taddress WHERE id_a = '.$row[0];
|
|
|
|
$result_3=mysql_query($sql_3);
|
|
|
|
$row3=mysql_fetch_array($result_3);
|
|
|
|
if ($direccion_agente != $row3[0]) {
|
|
|
|
echo "<option value='".salida_limpia($row3[0])."'>".salida_limpia($row3[0])."</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</select>";
|
2007-03-02 18:56:07 +01:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["os"].'</b></td><td class="datos" colspan="2"><img src="images/'.dame_so_icon($id_os).'"> - '.dame_so_name($id_os);
|
2007-04-13 20:47:58 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
if ($os_version != "") {
|
|
|
|
echo ' '.salida_limpia($os_version);
|
|
|
|
}
|
2007-04-13 20:47:58 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
echo '</td>';
|
|
|
|
echo '</tr>';
|
2007-04-13 20:47:58 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
// Parent
|
|
|
|
echo '<tr><td class="datos2"><b>'.lang_string("Parent").'</b></td><td class="datos2" colspan=2>';
|
|
|
|
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_parent'>";
|
|
|
|
echo dame_nombre_agente($id_parent).'</a></td>';
|
|
|
|
|
|
|
|
// Agent Interval
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["interval"].'</b></td><td class="datos" colspan=2>'. human_time_description_raw($intervalo).'</td></tr>';
|
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
// Comments
|
|
|
|
echo '<tr><td class="datos2"><b>'.$lang_label["description"].'</b></td><td class="datos2" colspan=2>'.$comentarios.'</td></tr>';
|
|
|
|
|
|
|
|
// Group
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b></td><td class="datos" colspan="2">
|
2007-04-18 11:58:26 +02:00
|
|
|
<img class="bot" src="images/groups_small/'.show_icon_group($id_grupo).'.png" > '.dame_grupo($id_grupo).'</td></tr>';
|
* ChangeLog: Create this file, prior to launch final 1.2 version. For the next
versions, will use it for every branch and subproject.
* configurar_agente.php : Fixed Undefined index: combo_snmp_oid notice error.
* estado_grupo.php: Detect old "OK" monitors, but doesnt check if they are down
in time, so for example, a old monitor with OK signal but from a week old, it is
shown as GREEN (good) value, not as a DOWN (white with ? symbol). FIXED.
Now counts data modules for DOWN total account, and show grey button if ANY
type of module is down, not only monitors. Improved SQL searches.
* estado_agente.php, estado_ultimopaquete.php: Same as estado_grupo with data_modules,
included in total account, more accurate accounting. A new value shown in grey for
DOWN modules, being monitors or single data modules, no matter type. Improved SQL
searches. Individual module intervals are used to determine if a module is down,
if there is no individual module interval, global agent interval is used.
Now it's possible to have a module with higher interval than Agent interval, so
we take now the more higest interval in modules to calculate if an agent is DOWN.
* fgraph.php: updated progressbar function to show N/A when data is above 100 or below 0.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@115 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-07-09 22:29:44 +02:00
|
|
|
|
2008-07-21 14:23:28 +02:00
|
|
|
// Agent version
|
|
|
|
echo '<tr><td class="datos2"><b>'.lang_string ("agentversion"). '</b>';
|
|
|
|
echo '<td class="datos2" colspan=2>'.salida_limpia($agent_version). '</td>';
|
|
|
|
|
|
|
|
// Total packets
|
|
|
|
echo '<tr><td class="datos"><b>'. lang_string ("total_packets"). '</b></td>';
|
|
|
|
echo '<td class="datos" colspan=2>';
|
|
|
|
$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 '</td></tr>';
|
|
|
|
|
|
|
|
// Last contact
|
|
|
|
echo '<tr><td class="datos2f9"><b>'.$lang_label["last_contact"]." / ".$lang_label["remote"].'</b></td><td class="datos2 f9" colspan="2">';
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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];
|
|
|
|
}
|
2006-07-01 03:48:56 +02:00
|
|
|
if ($intervalo > 0){
|
|
|
|
$percentil = round($diferencia/(($intervalo*2) / 100));
|
|
|
|
} else {
|
* ChangeLog: Create this file, prior to launch final 1.2 version. For the next
versions, will use it for every branch and subproject.
* configurar_agente.php : Fixed Undefined index: combo_snmp_oid notice error.
* estado_grupo.php: Detect old "OK" monitors, but doesnt check if they are down
in time, so for example, a old monitor with OK signal but from a week old, it is
shown as GREEN (good) value, not as a DOWN (white with ? symbol). FIXED.
Now counts data modules for DOWN total account, and show grey button if ANY
type of module is down, not only monitors. Improved SQL searches.
* estado_agente.php, estado_ultimopaquete.php: Same as estado_grupo with data_modules,
included in total account, more accurate accounting. A new value shown in grey for
DOWN modules, being monitors or single data modules, no matter type. Improved SQL
searches. Individual module intervals are used to determine if a module is down,
if there is no individual module interval, global agent interval is used.
Now it's possible to have a module with higher interval than Agent interval, so
we take now the more higest interval in modules to calculate if an agent is DOWN.
* fgraph.php: updated progressbar function to show N/A when data is above 100 or below 0.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@115 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-07-09 22:29:44 +02:00
|
|
|
$percentil = -1;
|
2006-07-01 03:48:56 +02:00
|
|
|
}
|
2008-07-21 14:23:28 +02:00
|
|
|
echo "<tr><td class='datos'><b>".$lang_label['next_contact']."</b>
|
|
|
|
<td class='datosf9' colspan=2>
|
|
|
|
<img src='reporting/fgraph.php?tipo=progress&percent=".$percentil."&height=20&width=200'>
|
|
|
|
</td></tr></table>
|
|
|
|
|
|
|
|
<td valign='top'><table border=0>
|
|
|
|
<tr><td><b>".$lang_label["agent_access_rate"]."</b><br><br>
|
|
|
|
<img border=1 src='reporting/fgraph.php?id=".$id_agente."&tipo=agentaccess&periodo=1440&height=70&width=280'>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><div style='height:25px'> </div>
|
|
|
|
<b>".lang_string("Events generated -by module-")."</b><br><br>
|
|
|
|
<img src='reporting/fgraph.php?tipo=event_module&width=250&height=180&id_agent=".$id_agente."' >
|
|
|
|
</td></tr>
|
2007-03-07 13:37:23 +01:00
|
|
|
</table></td></tr>
|
2008-07-21 14:23:28 +02:00
|
|
|
</table>";
|
2006-11-23 13:29:02 +01:00
|
|
|
?>
|