// 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 // ==================================================================================== echo "

".$lang_label["agent_conf"]." > ".$lang_label["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 = substr($row["nombre"],0,21); //module type modulo is $row2["nombre"]; $sql3='SELECT * 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"]; $nombre_alerta = $row4["nombre"]; $string = $string."".$nombre_modulo; if ($row3["disable"] == 1){ $string .= "".$lang_label["disabled"].""; } else { if ($id_tipo > 0) { $string .= ""; } else $string .= ""; } $string = $string."".$nombre_alerta; $string = $string."".human_time_description($row3["time_threshold"]); $mytempdata = fmod($row3["dis_min"], 1); if ($mytempdata == 0) $mymin = intval($row3["dis_min"]); else $mymin = $row3["dis_min"]; $mymin = format_for_graph($mymin ); $mytempdata = fmod($row3["dis_max"], 1); if ($mytempdata == 0) $mymax = intval($row3["dis_max"]); else $mymax = $row3["dis_max"]; $mymax = format_for_graph($mymax ); // We have alert text ? if ($row3["alert_text"] != "") $string = $string."".$lang_label["text"]; else { $string = $string."".$mymin; $string = $string."".$mymax; } $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"]." ".$lang_label["type"]." ".$lang_label["alert"]." ".$lang_label["threshold"]." ".$lang_label["min."]." ".$lang_label["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 ""; echo $lang_label["alert_status"]; echo ""; echo '"; echo '
'.$lang_label["min_value"]; echo " ";echo $lang_label["min_valid_value_help"].""; echo ''; echo ""; echo $lang_label["max_value"]; echo " "; echo $lang_label["max_valid_value_help"]; echo ""; echo ""; echo ""; // echo '
'.$lang_label["alert_text"]." Regular Expression Supported "; echo ''; echo '
'.$lang_label["description"]; echo ''; ?>
Macros:
_agent_
_timestamp_
_data_
Macros:
_agent_
_timestamp_
_data_
Macros:
_agent_
_timestamp_
_data_
     ".$lang_label["min_alerts"]; echo ''; echo ''; echo ''; echo $lang_label["max_alerts"]; echo ''; echo ''; ?>
'; $sql2 = "SELECT id_agente_modulo, id_tipo_modulo, nombre FROM tagente_modulo WHERE id_agente = $id_agente ORDER BY nombre"; $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 ""; } } else // for -1, is a special module, keep alive monitor !! echo ""; } echo ""; } else { $agentmodule_name = give_db_value ("nombre", "tagente_modulo", "id_agente_modulo", $alerta_id_agentemodulo); echo $agentmodule_name; } // End block only if $creacion_agente != 1; echo "
"; echo ''; echo '
'; if ($update_alert== "1"){ echo ''; } else { echo ''; } echo ''; echo '
';