2006-03-27 05:37:27 +02:00
< ? php
2006-07-11 10:49:21 +02:00
// Pandora - the Free monitoring system
// ====================================
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// 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; either version 2
// of the License, or (at your option) any later version.
// 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.
2006-03-27 05:37:27 +02:00
// Load global vars
require ( " include/config.php " );
2006-07-11 10:49:21 +02:00
2006-03-27 05:37:27 +02:00
if ( comprueba_login () == 0 ) {
if (( give_acl ( $id_user , 0 , " AR " ) == 1 ) or ( give_acl ( $id_user , 0 , " AW " )) or ( dame_admin ( $id_user ) == 1 )) {
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 " ];
}
echo " <h2> " . $lang_label [ " ag_title " ] . " </h2> " ;
2006-07-09 16:58:02 +02:00
echo " <h3> " . $lang_label [ " summary " ] . " <a href='help/ " . $help_code . " /chap3.php#331' target='_help' class='help'> <span> " . $lang_label [ " help " ] . " </span></a></h3> " ;
2006-03-27 05:37:27 +02:00
$iduser_temp = $_SESSION [ 'id_usuario' ];
// Show group selector
if ( isset ( $_POST [ " ag_group " ])){
$ag_group = $_POST [ " ag_group " ];
echo " <form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&ag_group_refresh= " . $ag_group . " '> " ;
} else {
echo " <form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60'> " ;
}
2006-12-03 03:07:36 +01:00
echo " <table cellpadding='3' cellspacing='3'><tr> " ;
echo " <td> " . $lang_label [ " group " ] . " </td> " ;
echo " <td valign='middle'> " ;
2006-10-09 17:22:28 +02:00
echo " <select name='ag_group' onChange='javascript:this.form.submit();' class='w130'> " ;
2006-03-27 05:37:27 +02:00
if ( $ag_group > 1 ){
echo " <option value=' " . $ag_group . " '> " . dame_nombre_grupo ( $ag_group );
}
echo " <option value=1> " . dame_nombre_grupo ( 1 ); // Group all is always active
// Group 1 (ALL) gives A LOT of problems, be careful with this code:
// Run query on all groups and show data only if ACL check its ok: $iduser_temp is user, and acl is AR (agent read)
$mis_grupos [] = " " ; // Define array mis_grupos to put here all groups with Agent Read permission
$sql = 'SELECT * FROM tgrupo' ;
$result = mysql_query ( $sql );
while ( $row = mysql_fetch_array ( $result )){
if ( $row [ " id_grupo " ] != 1 ){
if ( give_acl ( $iduser_temp , $row [ " id_grupo " ], " AR " ) == 1 ){
echo " <option value=' " . $row [ " id_grupo " ] . " '> " . dame_nombre_grupo ( $row [ " id_grupo " ]);
$mis_grupos [] = $row [ " id_grupo " ]; //Put in an array all the groups the user belongs
}
}
}
echo " </select> " ;
2006-12-03 03:07:36 +01:00
echo " <td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value=' " . $lang_label [ " show " ] . " '></noscript></td></form> " ;
2006-03-27 05:37:27 +02:00
// Show only selected groups
if ( $ag_group > 1 )
2006-11-14 01:26:29 +01:00
$sql = 'SELECT * FROM tagente WHERE id_grupo=' . $ag_group . ' AND disabled = 0 ORDER BY nombre' ;
2006-03-27 05:37:27 +02:00
else
2006-11-14 01:26:29 +01:00
$sql = 'SELECT * FROM tagente WHERE disabled = 0 ORDER BY id_grupo, nombre' ;
2006-03-27 05:37:27 +02:00
$result = mysql_query ( $sql );
if ( mysql_num_rows ( $result )){
// Load icon index from tgrupos
$iconindex_g [] = " " ;
$sql_g = 'SELECT id_grupo, icon FROM tgrupo' ;
$result_g = mysql_query ( $sql_g );
while ( $row_g = mysql_fetch_array ( $result_g )){
* 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
$iconindex_g [ $row_g [ " id_grupo " ]] = $row_g [ " icon " ];
2006-03-27 05:37:27 +02:00
}
echo " <td class='f9l30'> " ;
echo " <img src='images/dot_red.gif'> - " . $lang_label [ " fired " ];
echo " </td> " ;
2006-11-14 01:26:29 +01:00
echo " <td> " ;
2006-03-27 05:37:27 +02:00
echo " <img src='images/dot_green.gif'> - " . $lang_label [ " not_fired " ];
echo " </td></tr></table> " ;
echo " <br> " ;
echo " <table cellpadding='3' cellspacing='3' width='700'> " ;
echo " <th> " . $lang_label [ " agent " ] . " </th> " ;
echo " <th> " . $lang_label [ " os " ] . " </th> " ;
echo " <th> " . $lang_label [ " interval " ] . " </th> " ;
echo " <th> " . $lang_label [ " group " ] . " </th> " ;
echo " <th> " . $lang_label [ " modules " ] . " </th> " ;
echo " <th> " . $lang_label [ " status " ] . " </th> " ;
echo " <th> " . $lang_label [ " alerts " ] . " </th> " ;
echo " <th> " . $lang_label [ " last_contact " ] . " </th> " ;
* 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
// For every agent defined in the agent table
2006-07-04 12:09:39 +02:00
$color = 1 ;
2006-03-27 05:37:27 +02:00
while ( $row = mysql_fetch_array ( $result )){
* 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
$intervalo = $row [ " intervalo " ]; // Interval in seconds
$id_agente = $row [ 'id_agente' ];
$nombre_agente = $row [ " nombre " ];
$direccion_agente = $row [ " direccion " ];
$id_grupo = $row [ " id_grupo " ];
$id_os = $row [ " id_os " ];
$agent_type = $row [ " agent_type " ];
$ultimo_contacto = $row [ " ultimo_contacto " ];
$biginterval = $intervalo ;
foreach ( $mis_grupos as $migrupo ){ //Verifiy if the group this agent begins is one of the user groups
if (( $migrupo == 1 ) || ( $id_grupo == $migrupo )){
$pertenece = 1 ;
break ;
2006-03-27 05:37:27 +02:00
}
* 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
else
$pertenece = 0 ;
}
if ( $pertenece == 1 ) { // Si el agente pertenece a uno de los grupos que el usuario puede visualizar
// Obtenemos la lista de todos los modulos de cada agente
$sql_t = " SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente= " . $id_agente ;
$result_t = mysql_query ( $sql_t );
$estado_general = 0 ; $numero_modulos = 0 ; $numero_monitor = 0 ; $est_timestamp = " " ; $monitor_bad = 0 ; $monitor_ok = 0 ; $monitor_down = 0 ; $numero_datamodules = 0 ;
$estado_cambio = 0 ; // Oops, I forgot initialize this fucking var... many problems due it
$ahora = date ( " Y/m/d H:i:s " );
// Calculate module/monitor totals for this agent
while ( $row_t = mysql_fetch_array ( $result_t )){
$est_modulo = $row_t [ " estado " ];
$ultimo_contacto_modulo = $row_t [ " timestamp " ];
$module_interval = $row_t [ " module_interval " ];
if ( $module_interval > $biginterval )
$biginterval = $module_interval ;
if ( $module_interval != 0 )
$intervalo_comp = $module_interval ;
else
$intervalo_comp = $intervalo ;
2006-03-27 05:37:27 +02:00
if ( $ultimo_contacto <> " " )
* 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
$seconds = strtotime ( $ahora ) - strtotime ( $ultimo_contacto_modulo );
2006-03-27 05:37:27 +02:00
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
$seconds = - 1 ;
2006-03-27 05:37:27 +02:00
# Defines if Agent is down (interval x 2 > time last contact
* 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
if ( $seconds >= ( $intervalo_comp * 2 )){ // If (intervalx2) secs. ago we don't get anything, show alert
if ( $est_modulo != 100 )
$numero_monitor ++ ;
$monitor_down ++ ;
2006-07-01 03:48:56 +02:00
}
* 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
elseif ( $est_modulo <> 100 ) { // estado=100 are data modules
$estado_general = $estado_general + $est_modulo ;
$estado_cambio = $estado_cambio + $row_t [ " cambio " ];
$numero_monitor ++ ;
if ( $est_modulo <> 0 )
$monitor_bad ++ ;
else
$monitor_ok ++ ;
} elseif ( $est_modulo == 100 ){ // Data modules
$numero_datamodules ++ ;
2006-03-27 05:37:27 +02:00
}
* 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
$numero_modulos ++ ;
}
// Color change for each line (1.2 beta2)
if ( $color == 1 ){
$tdcolor = " datos " ;
$color = 0 ;
}
else {
$tdcolor = " datos2 " ;
$color = 1 ;
}
echo " <tr> " ;
echo " <td class=' $tdcolor '> " ;
$id_grupo = dame_id_grupo ( $id_agente );
if ( give_acl ( $id_user , $id_grupo , " AW " ) == 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=15></a> " ;
}
echo " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente= " . $id_agente . " '><b> " . $nombre_agente . " </b></a> " ;
if ( $agent_type == 0 ) {
// Show SO icon :)
echo " <td class=' $tdcolor ' align='center'><img border=0 src='images/ " . dame_so_icon ( $id_os ) . " ' height=18 alt=' " . dame_so_name ( $id_os ) . " '> " ;
} elseif ( $agent_type == 1 ) {
// Show network icon (for pandora 1.2)
echo " <td class=' $tdcolor ' align='center'><img border=0 src='images/network.gif' height=18 alt='Network Agent'> " ;
}
// If there are a module interval bigger than agent interval
if ( $biginterval > $intervalo )
echo " <td class=' $tdcolor '><font color='green'> " . $biginterval . " </font> " ;
else
2006-07-01 03:48:56 +02:00
echo " <td class=' $tdcolor '> " . $intervalo ;
2006-12-03 03:07:36 +01:00
echo '<td class="' . $tdcolor . '"><img src="images/g_' . $iconindex_g [ $id_grupo ] . '.gif"> ( ' . dame_grupo ( $id_grupo ) . ' )' ;
* 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
echo " <td class=' $tdcolor '> " . $numero_modulos . " <b>/</b> " . $numero_monitor ;
if ( $monitor_bad <> 0 )
echo " <b>/</b> <font class='red'> " . $monitor_bad . " </font> " ;
if ( $monitor_down <> 0 )
echo " <b>/</b> <font class='grey'> " . $monitor_down . " </font> " ;
if ( $numero_monitor <> 0 ){
if ( $estado_general <> 0 ){
if ( $estado_cambio == 0 ){
echo " <td class=' $tdcolor ' align='center'><img src='images/b_red.gif'> " ;
} else {
echo " <td class=' $tdcolor ' align='center'><img src='images/b_yellow.gif'> " ;
2006-07-01 03:48:56 +02:00
}
* 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
} elseif ( $monitor_ok > 0 )
echo " <td class=' $tdcolor ' align='center'><img src='images/b_green.gif'> " ;
elseif ( $numero_datamodules > 0 )
echo " <td class=' $tdcolor ' align='center'><img src='images/b_white.gif'> " ;
elseif ( $monitor_down > 0 )
echo " <td class=' $tdcolor ' align='center'><img src='images/b_down.gif'> " ;
} else
echo " <td class=' $tdcolor ' align='center'><img src='images/b_blue.gif'> " ;
// checks if an alert was fired recently
echo " <td class=' $tdcolor ' align='center'> " ;
if ( check_alert_fired ( $id_agente ) == 1 )
echo " <img src='images/dot_red.gif'> " ;
else
echo " <img src='images/dot_green.gif'> " ;
2006-07-01 03:48:56 +02:00
* 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
echo " <td class=' $tdcolor '> " ;
if ( $ultimo_contacto == " 0000-00-00 00:00:00 " )
echo $lang_label [ " never " ];
else {
$ultima = strtotime ( $ultimo_contacto );
$ahora = strtotime ( " now " );
$diferencia = $ahora - $ultima ;
if ( $biginterval > 0 ){
$percentil = round ( $diferencia / (( $biginterval * 2 ) / 100 ));
} else {
echo " N/A " ;
}
echo " <a href='#' class='info2'><img src='reporting/fgraph.php?tipo=progress&percent= " . $percentil . " &height=15&width=80' border='0'>
< span > $ultimo_contacto </ span ></ a > " ;
// echo $ultimo_contacto;
}
} // If pertenece/belongs to group
2006-03-27 05:37:27 +02:00
}
echo " <tr><td colspan='8'><div class='raya'></div></td></tr> " ;
echo " </table><br> " ;
2006-12-03 03:07:36 +01:00
echo " <table cellpadding='3' cellspacing='3'> " ;
2006-03-27 05:37:27 +02:00
echo " <tr><td class='f9i'> " ;
echo " <img src='images/b_green.gif'> - " . $lang_label [ " green_light " ] . " </td> " ;
echo " <td class='f9i'> " ;
echo " <img src='images/b_red.gif'> - " . $lang_label [ " red_light " ] . " </td> " ;
echo " <td class='f9i'> " ;
echo " <img src='images/b_yellow.gif'> - " . $lang_label [ " yellow_light " ] . " </td> " ;
echo " <tr><td class='f9i'> " ;
echo " <img src='images/b_white.gif'> - " . $lang_label [ " no_light " ] . " </td> " ;
echo " <td class='f9i'> " ;
echo " <img src='images/b_blue.gif'> - " . $lang_label [ " blue_light " ] . " </td> " ;
echo " <td class='f9i'> " ;
echo " <img src='images/b_down.gif'> - " . $lang_label [ " broken_light " ] . " </td> " ;
echo " </table> " ;
}
else {
2006-12-03 03:07:36 +01:00
echo '</table><br><div class="nf">' . $lang_label [ " no_agent " ] . '</div>' ;
2006-03-27 05:37:27 +02:00
}
} else {
audit_db ( $id_user , $REMOTE_ADDR , " ACL Violation " , " Trying to access Agent view " );
require ( " general/noaccess.php " );
}
}
?>