2008-07-08 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Basic support for async modules. General stats (tactical), do not shown async modules as uknown anymore. * operation/agentes/estado_agente.php, operation/agentes/estado_ultimopaquete.php: Support for async modules. * godmode/agentes/modificar_agente.php: Fixed stupid bug in search field in last commit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@943 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a32ee9329e
commit
34b15e6a90
|
@ -1,5 +1,14 @@
|
|||
2008-07-08 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/functions_reporting.php: Basic support for async modules.
|
||||
General stats (tactical), do not shown async modules as uknown anymore.
|
||||
|
||||
* operation/agentes/estado_agente.php,
|
||||
operation/agentes/estado_ultimopaquete.php: Support for async modules.
|
||||
|
||||
* godmode/agentes/modificar_agente.php: Fixed stupid bug in search
|
||||
field in last commit.
|
||||
|
||||
* operation/reporting/graph_viewer.php: Added controls to view in the
|
||||
new combined graphic mode (lines), and to change size to three pre-
|
||||
defined sizes.
|
||||
|
|
|
@ -158,7 +158,7 @@ echo "</form>";
|
|||
echo "</td></table>";
|
||||
|
||||
if ($search != ""){
|
||||
$search_sql = " AND nombre LIKE '%$search%' ";
|
||||
$search_sql = " nombre LIKE '%$search%' ";
|
||||
} else {
|
||||
$search_sql = " 1 = 1";
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ function general_stats ($id_user, $id_group = 0) {
|
|||
$existen_agentes = 1;
|
||||
|
||||
// SQL Join to get monitor status for agents belong this group
|
||||
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo FROM tagente, tagente_estado, tagente_modulo WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 ";
|
||||
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo, tagente_modulo.id_tipo_modulo FROM tagente, tagente_estado, tagente_modulo WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 ";
|
||||
if ($result1 = mysql_query ($sql1)){
|
||||
while ($row1 = mysql_fetch_array ($result1)) {
|
||||
$id_agente = $row1[0];
|
||||
|
@ -145,6 +145,11 @@ function general_stats ($id_user, $id_group = 0) {
|
|||
$utimestamp = $row1[4];
|
||||
$seconds = $ahora_sec - $utimestamp;
|
||||
$id_agente_modulo = $row1[5];
|
||||
$module_type = $row1[6];
|
||||
if (($module_type < 21) OR ($module_type == 100))
|
||||
$async = 0;
|
||||
else
|
||||
$async = 1;
|
||||
if ($estado != 100){
|
||||
// Monitor check
|
||||
$monitor_checks++;
|
||||
|
@ -172,7 +177,7 @@ function general_stats ($id_user, $id_group = 0) {
|
|||
// Data check
|
||||
if ($utimestamp == 0)
|
||||
$data_not_init++;
|
||||
elseif ($seconds >= ($module_interval*2))
|
||||
elseif (($seconds >= ($module_interval*2)) AND ($async == 0))
|
||||
$data_unknown++;
|
||||
$data_checks++;
|
||||
// Alert
|
||||
|
|
|
@ -184,6 +184,8 @@ if (mysql_num_rows($result)){
|
|||
$est_modulo = $row_t["estado"];
|
||||
$ultimo_contacto_modulo = $row_t["timestamp"];
|
||||
$module_interval = $row_t["module_interval"];
|
||||
$module_type = $row_t["id_tipo_modulo"];
|
||||
|
||||
if ($module_interval > $biginterval)
|
||||
$biginterval = $module_interval;
|
||||
if ($module_interval !=0)
|
||||
|
@ -194,12 +196,17 @@ if (mysql_num_rows($result)){
|
|||
$seconds = strtotime($ahora) - strtotime($ultimo_contacto_modulo);
|
||||
else
|
||||
$seconds = -1;
|
||||
|
||||
if (($module_type < 21) OR ($module_type == 100)){
|
||||
$async = 0;
|
||||
} else {
|
||||
$async = 1;
|
||||
}
|
||||
# Defines if Agent is down (interval x 2 > time last contact
|
||||
if ($seconds >= ($intervalo_comp*2)){ // If (intervalx2) secs. ago we don't get anything, show alert
|
||||
if ($est_modulo != 100)
|
||||
$numero_monitor++;
|
||||
$monitor_down++;
|
||||
if ($async == 0)
|
||||
$monitor_down++;
|
||||
}
|
||||
elseif ($est_modulo != 100) { // estado=100 are data modules
|
||||
$estado_general = $estado_general + $est_modulo;
|
||||
|
|
|
@ -189,12 +189,16 @@ if (mysql_num_rows ($result3)) {
|
|||
echo $lang_label["never"];
|
||||
} else {
|
||||
$ahora = time();
|
||||
if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) {
|
||||
echo "<font color='red'>";
|
||||
echo human_time_comparation($row3["timestamp"]);
|
||||
echo "</font>";
|
||||
} else
|
||||
echo human_time_comparation($row3["timestamp"]);
|
||||
if (($row3["id_tipo_modulo"] > 20) AND ($row3["id_tipo_modulo"] < 100)){
|
||||
echo human_time_comparation($row3["timestamp"]);
|
||||
} else {
|
||||
if ( ($ahora - $row3["utimestamp"]) > ($real_interval*2)) {
|
||||
echo "<font color='red'>";
|
||||
echo human_time_comparation($row3["timestamp"]);
|
||||
echo "</font>";
|
||||
} else
|
||||
echo human_time_comparation($row3["timestamp"]);
|
||||
}
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue