// Additions to Pandora FMS 1.2 graph code and new XML reporting template management // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // 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; 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. // ==================================================================================== // VIEW ALERTS // ====================================================================================
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"'; $result=mysql_query($sql1); if ($row=mysql_num_rows($result)){ echo "

".$lang_label["assigned_alerts"]." ".$lang_label["help"]."

"; $color=1; $string=''; while ($row=mysql_fetch_array($result)){ // All modules of this agent $id_tipo = $row["id_tipo_modulo"]; $nombre_modulo =$row["nombre"]; $sql2='SELECT * FROM ttipo_modulo WHERE id_tipo = "'.$id_tipo.'"'; $result2=mysql_query($sql2); $row2=mysql_fetch_array($result2); //module type modulo is $row2["nombre"]; $sql3='SELECT id_aam, id_alerta, time_threshold, dis_min, dis_max, descripcion FROM talerta_agente_modulo WHERE id_agente_modulo = '.$row["id_agente_modulo"]; // From all the alerts give me which are from my agent $result3=mysql_query($sql3); while ($row3=mysql_fetch_array($result3)){ if ($color == 1){ $tdcolor="datos"; $color =0; } else { $tdcolor="datos2"; $color =1; } $sql4='SELECT nombre FROM talerta WHERE id_alerta = '.$row3["id_alerta"]; $result4=mysql_query($sql4); $row4=mysql_fetch_array($result4); // Alert name defined by $row4["nombre"]; $tipo_modulo = $row2["nombre"]; $nombre_alerta = $row4["nombre"]; $string = $string."".$nombre_modulo."/".$tipo_modulo; $string = $string."".$nombre_alerta; $string = $string."".$row3["time_threshold"]; $string = $string."".$row3["dis_min"]."/".$row3["dis_max"]; $string = $string."".salida_limpia($row3["descripcion"]); $string = $string.""; $id_grupo = dame_id_grupo($id_agente); if (give_acl($id_user, $id_grupo, "LW")==1){ $string = $string." ".$lang_label["delete"]."   "; $string = $string." ".$lang_label["update"].""; } $string = $string.""; } } if (isset($string) & $string!='') { echo ""; echo $string; echo "
".$lang_label["name_type"]." ".$lang_label["alert"]." ".$lang_label["time_threshold"]." ".$lang_label["min_max"]." ".$lang_label["description"]." ".$lang_label["action"]."
"; } else { echo "
".$lang_label["no_alerts"]."
"; } } else { echo "
".$lang_label["no_modules"]."
"; } ?>

 

'; if (! isset($update_alert)) $update_alert = -1; if ($update_alert != 1) { echo ''; } else { echo ''; echo ' '; echo '
   
   
   
'; $sql2='SELECT id_agente_modulo, id_tipo_modulo, nombre FROM tagente_modulo WHERE id_agente = '.$id_agente; $result2=mysql_query($sql2); while ($row2=mysql_fetch_array($result2)){ if ($row2["id_tipo_modulo"] != -1) { $sql1='SELECT nombre FROM ttipo_modulo WHERE id_tipo = '.$row2["id_tipo_modulo"]; $result=mysql_query($sql1); while ($row=mysql_fetch_array($result)){ echo ""; } echo ""; } else { echo "".$lang_label["no_change_field"].""; } // End block only if $creacion_agente != 1; echo '
'; if ($update_alert== "1"){ echo ''; } else { echo ''; } echo ''; echo "
"; echo '
';