".__('Pandora Agents')." > ".__('Full list of Alerts').""; } $query_gen='SELECT talerta_agente_modulo.* FROM talerta_agente_modulo, tagente_modulo WHERE talerta_agente_modulo.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente ='.$id_agente; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { if (!isset($_GET["tab"])) { echo "

".__('Full list of Alerts')."

"; } echo ""; echo ""; $color=1; while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo ""; show_alert_show_view ($data, $tdcolor, 0); } // Show combined alerts for this agent $result_com = mysql_query("SELECT * FROM talerta_agente_modulo WHERE id_agent = $id_agente"); if (mysql_num_rows ($result_com)) { echo ""; show_alert_show_view ($data_com, $tdcolor, 1); } echo '
".__('Type')."".__('Name')." ".__('Description')." ".__('Info')." ".__('Min.')." ".__('Max.')." ".__('Time threshold')." ".__('Last fired')." ".__('Times Fired')." ".__('Status')." ".__('Validate')."
".__('Combined alerts')."
"; } while ($data_com=mysql_fetch_array($result_com)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo "
'; } else { echo "
".__('This agent doesn\'t have any alert')."
"; } // Show alert for no defined agent } else { // ------------------------------- // SHOW ALL ALERTS (GENERAL PAGE) // ------------------------------- echo "

".__('Pandora Agents')." > "; echo __('Full list of Alerts')."

"; $iduser_temp=$_SESSION['id_usuario']; $ag_group = get_parameter ("ag_group", -1); if ($ag_group != -1) echo "
"; else echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // Display single alerts if ($ag_group > 1) $sql='SELECT id_agente, nombre, disabled FROM tagente WHERE id_grupo='.$ag_group.' ORDER BY nombre'; else $sql='SELECT id_agente, nombre, disabled FROM tagente ORDER BY id_grupo, nombre'; $sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 "; // Agent group selector if ($ag_group > 1) $sql .=" AND tagente.id_grupo = ".$ag_group; else { // User has explicit permission on group 1 ? $all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1"); if ($all_group == 0) $sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')"; } $color=1; $string = ''; $result=mysql_query($sql); if ($result) while ($row=mysql_fetch_array($result)) { //while there are agents $id_agente = $row['id_agente']; $nombre_agente = strtoupper($row["nombre"]); $query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.disable = 0 '; $result_gen=mysql_query($query_gen); while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } $string .= ""; $string=$string.""; if ($data["last_fired"] == "0000-00-00 00:00:00") { $string=$string.""; } else { $string=$string.""; } $string=$string.""; } } //end while // Display combined alerts // ======================= $sql = "SELECT id_agente, nombre, disabled FROM tagente WHERE tagente.disabled = 0 "; // Agent group selector if ($ag_group > 1) $sql .=" AND tagente.id_grupo = ".$ag_group; else { // User has explicit permission on group 1 ? $all_group = get_db_sql ("SELECT COUNT(id_grupo) FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."' AND id_grupo = 1"); if ($all_group == 0) $sql .=" AND tagente.id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='".$config["id_user"]."')"; } $result=mysql_query($sql); $color=1; if ($result) while ($row=mysql_fetch_array($result)){ //while there are agents $id_agente = $row['id_agente']; $nombre_agente = strtoupper($row["nombre"]); $query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, talerta_agente_modulo.id_agent FROM talerta_agente_modulo WHERE talerta_agente_modulo.id_agent = '.$id_agente.' AND talerta_agente_modulo.disable = 0 '; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } if (!isset($string)) { $string=''; } $string = $string.""; $string=$string.""; if ($data["last_fired"] == "0000-00-00 00:00:00") { $string=$string.""; } else { $string=$string.""; } $string=$string.""; } } } //end while if ($string != "") { echo ""; echo "
".__('Group').""; echo "
".$nombre_agente.""; $string .= ""; if ($data["times_fired"] <> 0) $string .= ""; else $string .= ""; $string = $string."" .dame_nombre_alerta($data["id_alerta"])."". $data["descripcion"]."". __('Never')."". human_time_comparation($data["last_fired"])."". $data["times_fired"]."
".$nombre_agente." (*)"; $string .= ""; if ($data["times_fired"] <> 0) $string .= ""; else $string .= ""; $string = $string."" .dame_nombre_alerta($data["id_alerta"])."". $data["descripcion"]."". __('Never')."". human_time_comparation($data["last_fired"])."". $data["times_fired"].""; echo " ".__('Alert fired').""; echo " ".__('Alert not fired'); echo "(*) ".__('Combined alert')."
"; echo "
"; echo ""; echo ""; echo $string; //built table of alerts echo "
".__('Agent')." ".__('Status')." ".__('Type')." ".__('Description')." ".__('Last fired')." ".__('Times Fired')."
"; } else { echo "
". __('No agent included in this group has any assigned alert')."
"; } } // Main alert view ?>