".$lang_label["agent_conf"]." > ".$lang_label["alerts"]."";
// ==========================
// Create module/type combo
// ==========================
echo '
";
// ==========================
// Simple alerts view
// ==========================
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = "'.$id_agente.'"';
$result=mysql_query($sql1);
if ($row=mysql_num_rows($result)){
echo "".lang_string ("Simple alerts")."
";
$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;
$string .= show_alert_row_edit ($row3, $tdcolor, $row["id_tipo_modulo"],0);
$string = $string." | ";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){
$string = $string."
";
$string = $string."
";
}
$string = $string." | ";
}
}
if (isset($string) & $string!='') {
echo "
".$lang_label["name"]." |
".$lang_label["type"]." |
".$lang_label["alert"]." |
".$lang_label["threshold"]." |
".$lang_label["min."]." |
".$lang_label["max."]." |
".$lang_label["time"]." |
".$lang_label["description"]." |
".lang_string ("info")." |
".$lang_label["action"]." |
";
echo $string;
echo "
";
} else {
echo "".$lang_label["no_alerts"]."
";
}
} else {
echo "".$lang_label["no_modules"]."
";
}
// ==========================
// Combined alerts view
// ==========================
echo "".lang_string("combined alerts")."
";
$sql1='SELECT * FROM talerta_agente_modulo WHERE id_agent = '.$id_agente;
$result=mysql_query($sql1);
if (mysql_num_rows($result) == 0){
echo "".$lang_label["no_modules"]."
";
} else {
$color = 1;
$string = "";
while ($row=mysql_fetch_array($result)){
// Show data for this combined alert
$string .= "
";
$string .= lang_string("Combined")." #".$row["id_aam"];
$string .= show_alert_row_edit ($row, "datos3", 0, 1);
$string .= ' | '; // action
if (give_acl($id_user, $id_grupo, "LW")==1){
$string .= " ";
$string .= "
";
}
$id_aam = $row["id_aam"];
$sql2 = "SELECT * FROM tcompound_alert, talerta_agente_modulo WHERE tcompound_alert.id = $id_aam AND talerta_agente_modulo.id_aam = tcompound_alert.id_aam";
$result2=mysql_query($sql2);
while ($row2=mysql_fetch_array($result2)){
// Show data for each component of this combined alert
if ($color == 1){
$tdcolor="datos";
$color =0;
} else {
$tdcolor="datos2";
$color =1;
}
$module = get_db_row ("tagente_modulo", "id_agente_modulo", $row2["id_agente_modulo"]);
$description = $row2["descripcion"];
$alert_mode = $row2["operation"];
$id_agente_name = get_db_value ("nombre", "tagente", "id_agente", $module["id_agente"]);
$string .= " |
".$id_agente_name." - ".substr($module["nombre"],0,15)."";
$string .= show_alert_row_edit ($row2, $tdcolor, $module["id_tipo_modulo"],1);
$string .= " | ";
$id_grupo = dame_id_grupo($id_agente);
if (give_acl($id_user, $id_grupo, "LW")==1){
$string .= " ";
$string .= "
";
}
$string .= " | ";
}
}
if (isset($string) & $string != "") {
echo "
".$lang_label["name"]." |
".$lang_label["type"]." |
".lang_string ("Oper")." |
".$lang_label["threshold"]." |
".$lang_label["min."]." |
".$lang_label["max."]." |
".$lang_label["time"]." |
".$lang_label["description"]." |
".lang_string ("info")." |
".$lang_label["action"]." |
";
echo $string;
echo "
";
} else {
echo "".$lang_label["no_alerts"]."
";
}
}
?>