// 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 "
";
$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 ($id_tipo > 0) {
$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."
';
$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 "";
}
} else // for -1, is a special module, keep alive monitor !!
echo "";
}
echo "";
} else {
echo "".$lang_label["no_change_field"]."";
}
// End block only if $creacion_agente != 1;
echo "