From e2f27f8b12dcc4bfaf98a7263d639d9c751da60a Mon Sep 17 00:00:00 2001 From: raulmateos Date: Thu, 29 Jun 2006 22:28:49 +0000 Subject: [PATCH] - New icon for unknown agent status, and single data (not monitor data). Fixed width in group view and finished code for detailed info in hint. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@66 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/images/dot_down.gif | Bin 0 -> 172 bytes pandora_console/images/dot_white.gif | Bin 219 -> 196 bytes .../operation/agentes/estado_grupo.php | 81 +++++++----------- 3 files changed, 30 insertions(+), 51 deletions(-) create mode 100644 pandora_console/images/dot_down.gif diff --git a/pandora_console/images/dot_down.gif b/pandora_console/images/dot_down.gif new file mode 100644 index 0000000000000000000000000000000000000000..1ac77f133c4cf0f1b9ba541b318f41860af86cce GIT binary patch literal 172 zcmV;d08{@*Nk%w1VF~~W0E8a^|0gH=F){m2PUc-)`Bzr@SXld6S^QdB>tkZuZEW9% zh4zAi)sc|*gM!nOk@$my=aiK0oSV_DtJAQr@295Kx32mm|zzE)-c literal 0 HcmV?d00001 diff --git a/pandora_console/images/dot_white.gif b/pandora_console/images/dot_white.gif index 1de30710b8bed78d6df52800d53649ac646d7f19..2632d652c9e4fd5c93d6f13a833cbbb0e155527b 100644 GIT binary patch delta 135 zcmcc3c!aUu-P6s&GLegci=jo5;n0ztM~>|}dFsH~b4SjdKX(4Y@r##EUb=kx`i+Y> zZ(X`|`||DESMT1te*eME2M=yNe01m0>Cb?cX`->`J!rsdmrtlPP3!@)y44;|ip?D)Q`*Dn0W h1{D7ZI~S!UrsOLm=jSPeWTYyvx_kNtFigx12LKQwP~iXo diff --git a/pandora_console/operation/agentes/estado_grupo.php b/pandora_console/operation/agentes/estado_grupo.php index e630b6ae52..45bcbb9ac7 100644 --- a/pandora_console/operation/agentes/estado_grupo.php +++ b/pandora_console/operation/agentes/estado_grupo.php @@ -1,20 +1,10 @@ , 2003-2006 +// Raúl Mateos , 2005-2006 // Load global vars require("include/config.php"); @@ -22,21 +12,8 @@ if (comprueba_login() == 0) if (give_acl($id_user, 0, "AR")==1) { echo "

".$lang_label["ag_title"]."

"; echo "

".$lang_label["group_view"]."

"; - // Check for Network FLAG change request - if (isset($_GET["update_netgroup"])){ - if (give_acl($id_user, $_GET["update_netgroup"], "AW")==1){ - $sql = "SELECT * FROM tagente where id_grupo = ".$_GET["update_netgroup"]; - $result=mysql_query($sql); - while ($row=mysql_fetch_array($result)){ - $id_agente = $row["id_agente"]; - $query2 ="UPDATE tagente_modulo SET flag=1 WHERE id_agente = ".$id_agente; - $res=mysql_query($query2); - } - echo "

".$lang_label["network_module_refresh_exec"]."

"; - } - } $iduser_temp=$_SESSION['id_usuario']; - // $mis_grupos - Define array mis_grupos to put here all groups with Agent Read permission + $sql1='SELECT * FROM tgrupo'; $result2=mysql_query($sql1); while ($row=mysql_fetch_array($result2)){ @@ -49,7 +26,7 @@ if (comprueba_login() == 0) $array_index = 0; $estado_grupo_ok =0; $estado_grupo_down =0; - $estado_grupo_bad =0; + $estado_grupo_bad =0; // Recorro cada grupo para ver el estado de todos los modulos foreach ($mis_grupos as $migrupo) if ($migrupo != "") { @@ -57,6 +34,7 @@ if (comprueba_login() == 0) $grupo[$array_index]["ok"]=0; $grupo[$array_index]["down"]=0; $grupo[$array_index]["bad"]=0; + $grupo[$array_index]["data"]=0; $grupo[$array_index]["icon"]=dame_grupo_icono($migrupo); $grupo[$array_index]["id_grupo"]=$migrupo; $existen_agentes =0; @@ -83,7 +61,7 @@ if (comprueba_login() == 0) $grupo[$array_index]["group"]=dame_nombre_grupo($migrupo); $contador_agente++; // Estado grupo, agent if ($down ==0){ - $sql2="SELECT * FROM tagente_modulo WHERE (id_tipo_modulo = 2 OR id_tipo_modulo = 6 OR id_tipo_modulo = 9 OR id_tipo_modulo = 12 OR id_tipo_modulo = 18) AND id_agente =".$row1["id_agente"]; + $sql2="SELECT * FROM tagente_modulo WHERE (id_tipo_modulo = 2 OR id_tipo_modulo = 6 OR id_tipo_modulo = 10) AND id_agente =".$row1["id_agente"]; $result2=mysql_query($sql2); while ($row2 = mysql_fetch_array($result2)){ $sql3="SELECT * FROM tagente_estado WHERE id_agente_modulo = ".$row2["id_agente_modulo"]; @@ -98,7 +76,17 @@ if (comprueba_login() == 0) $grupo[$array_index]["bad"]++; // Estado grupo, agent BAD } } - $grupo[$array_index]["ok"]; + $sql2="SELECT * FROM tagente_modulo WHERE (id_tipo_modulo != 2 OR id_tipo_modulo != 6 OR id_tipo_modulo != 10) AND id_agente =".$row1["id_agente"]; + $result2=mysql_query($sql2); + while ($row2 = mysql_fetch_array($result2)){ + $sql3="SELECT * FROM tagente_estado WHERE id_agente_modulo = ".$row2["id_agente_modulo"]; + $result3=mysql_query($sql3); + $row3 = mysql_fetch_array($result3); + if ($row3["datos"] !=0){ + $estado_grupo_ok++; + $grupo[$array_index]["data"]++; // Data module + } + } } } if ($existen_agentes == 1){ @@ -117,7 +105,7 @@ if (comprueba_login() == 0) $icono_grupo = $grupo[$real_count]["icon"]; $icono_type=""; if ($grupo[$real_count]["down"]>0) { - $icono_type=""; + $icono_type=""; } if ($grupo[$real_count]["bad"]>0) { $icono_type=$icono_type.""; @@ -125,12 +113,14 @@ if (comprueba_login() == 0) if ($grupo[$real_count]["ok"]>0) { $icono_type=$icono_type.""; } - // Icon with tooltip table inside (Raul) - $celda = " "; - $celda = $celda." + if ($grupo[$real_count]["data"]>0) { + $icono_type=$icono_type.""; + } + $celda = "
+
".$lang_label["agents"].":
".$grupo[$real_count]["agent"]."
- +
@@ -140,18 +130,7 @@ if (comprueba_login() == 0) if (give_acl($id_user, $grupo[$real_count]["id_grupo"], "AW")==1){ $celda = $celda . ""; } - $celda = ""; + $celda = $celda . "

".$icono_type."

".$group_name.""; echo $celda; } $real_count++; @@ -161,7 +140,7 @@ if (comprueba_login() == 0) echo "
".ucfirst($lang_label["monitors"]).":
".$lang_label["ok"].": ".$grupo[$real_count]["ok"]."
".$lang_label["down"].": ".$grupo[$real_count]["down"]."
".$celda."

".$icono_type."

".$group_name.""; - - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda.""; - $celda = $celda."
".$lang_label["agents"].":
".$grupo[$real_count]["agent"].""; - $celda = $celda."
".ucfirst($lang_label["monitors"]).":
".$lang_label["ok"].": ".$grupo[$real_count]["ok"]."
".$lang_label["down"].": ".$grupo[$real_count]["down"]."
".$lang_label["fail"].": ".$grupo[$real_count]["bad"]."
"; - $celda = $celda."
"; } else { - audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent viewi (Grouped)"); + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view (Grouped)"); require ("general/noaccess.php"); } ?> \ No newline at end of file