- Update agents files with options for not showing tables if there aren't monitor/alerts/data (an old wanted feature) (Pandora Console)
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@89 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
17466d83fd
commit
a527aa3e03
|
@ -11,11 +11,11 @@ if (comprueba_login() == 0) {
|
|||
if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) {
|
||||
|
||||
if (isset($_GET["id_agente"])){
|
||||
echo "<h3>".$lang_label["alert_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3324' target='_help' class='help'><span>".$lang_label["help"]."</span></a></h3>";
|
||||
$id_agente = $_GET["id_agente"];
|
||||
$query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, 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 order by tagente_modulo.nombre';
|
||||
$result_gen=mysql_query($query_gen);
|
||||
if (mysql_num_rows ($result_gen)) {
|
||||
echo "<h3>".$lang_label["alert_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3324' target='_help' class='help'><span>".$lang_label["help"]."</span></a></h3>";
|
||||
echo "<table cellpadding='3' cellspacing='3' width=750 border=0>";
|
||||
echo "<tr><th>".$lang_label["type"]."<th>".$lang_label["name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["min_max"]."</th><th>".$lang_label["time_threshold"]."</th><th>".$lang_label["last_fired"]."</th><th>".$lang_label["times_fired"]."</th><th>".$lang_label["status"]."</th>";
|
||||
$color=1;
|
||||
|
@ -43,7 +43,7 @@ if (comprueba_login() == 0) {
|
|||
}
|
||||
echo '<tr><td colspan="9"><div class="raya"></div></td></tr></table>';
|
||||
}
|
||||
else echo "- <font class='red'>".$lang_label["no_alerts"]."</font>";
|
||||
else echo "<font class='red'>".$lang_label["no_alerts"]."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -97,15 +97,7 @@ if (comprueba_login() == 0) {
|
|||
|
||||
$result=mysql_query($sql);
|
||||
if (mysql_num_rows($result)){
|
||||
echo "<td class='f9l30'>";
|
||||
echo "<img src='images/dot_red.gif'> - ".$lang_label["fired"];
|
||||
echo " </td>";
|
||||
echo "<td class='f9'>";
|
||||
echo "<img src='images/dot_green.gif'> - ".$lang_label["not_fired"];
|
||||
echo "</td></tr></table>";
|
||||
echo "<br>";
|
||||
echo "<table cellpadding='3' cellspacing='3'>";
|
||||
echo "<tr><th>ID</th><th>".$lang_label["type"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["last_fired"]."</th><th>".$lang_label["times_fired"]."</th><th>".$lang_label["status"]."</th>";
|
||||
$string='';
|
||||
$color=1;
|
||||
while ($row=mysql_fetch_array($result)){ //while there are agents
|
||||
if ($row["disabled"] == 0) {
|
||||
|
@ -123,21 +115,39 @@ if (comprueba_login() == 0) {
|
|||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
echo "<tr><td class='".$tdcolor."'><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'><b>".$nombre_agente."</b>";
|
||||
echo "<td class='".$tdcolor."'>".dame_nombre_alerta($data["id_alerta"]);
|
||||
echo "<td class='".$tdcolor."'>".$data["descripcion"];
|
||||
echo "<td class='".$tdcolor."'>".$data["last_fired"];
|
||||
echo "<td class='".$tdcolor."'>".$data["times_fired"];
|
||||
if (!isset($string)) {$string='';}
|
||||
$string=$string."<tr><td class='".$tdcolor."'><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'><b>".$nombre_agente."</b>";
|
||||
$string=$string."<td class='".$tdcolor."'>".dame_nombre_alerta($data["id_alerta"]);
|
||||
$string=$string."<td class='".$tdcolor."'>".$data["descripcion"];
|
||||
$string=$string."<td class='".$tdcolor."'>".$data["last_fired"];
|
||||
$string=$string."<td class='".$tdcolor."'>".$data["times_fired"];
|
||||
if ($data["times_fired"] <> 0)
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/dot_red.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/dot_red.gif'>";
|
||||
else
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/dot_green.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/dot_green.gif'>";
|
||||
}
|
||||
} //end result
|
||||
} else if($ag_group>1) {unset($string);} //end result
|
||||
|
||||
} //end disabled=0
|
||||
|
||||
} //end while
|
||||
if (isset($string)) {
|
||||
echo "<td class='f9l30'>";
|
||||
echo "<img src='images/dot_red.gif'> - ".$lang_label["fired"];
|
||||
echo " </td>";
|
||||
echo "<td class='f9'>";
|
||||
echo "<img src='images/dot_green.gif'> - ".$lang_label["not_fired"];
|
||||
echo "</td></tr></table>";
|
||||
echo "<br>";
|
||||
echo "<table cellpadding='3' cellspacing='3'>";
|
||||
echo "<tr><th>ID</th><th>".$lang_label["type"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["last_fired"]."</th><th>".$lang_label["times_fired"]."</th><th>".$lang_label["status"]."</th>";
|
||||
echo $string; //built table of alerts
|
||||
echo "<tr><td colspan='6'><div class='raya'></div></td></tr></table>";
|
||||
} else echo "<tr><td></td></tr><tr><td><font class='red'>". $lang_label["no_agent"].$lang_label["no_agent_alert"]."</table>";
|
||||
}
|
||||
else {
|
||||
echo "<tr><td></td></tr><tr><td><font class='red'>".$lang_label["no_alert"]."</font></td></tr></table>";
|
||||
}
|
||||
} else echo "<tr><td></td></tr><tr><td><font class='red'>". $lang_label["no_agent"].$lang_label["no_agent_alert"]."</td></tr></table>";
|
||||
}
|
||||
} //end acl
|
||||
} //end login
|
||||
|
|
|
@ -16,6 +16,7 @@ if (comprueba_login() == 0)
|
|||
|
||||
$sql1='SELECT * FROM tgrupo';
|
||||
$result2=mysql_query($sql1);
|
||||
if (mysql_num_rows($result2)){
|
||||
while ($row=mysql_fetch_array($result2)){
|
||||
if ($row["id_grupo"]!=1)
|
||||
if (give_acl($iduser_temp,$row["id_grupo"], "AR") == 1)
|
||||
|
@ -54,6 +55,7 @@ if (comprueba_login() == 0)
|
|||
$existen_agentes =0;
|
||||
$sql1="SELECT * FROM tagente WHERE disabled=0 AND id_grupo =".$migrupo;
|
||||
if ($result1=mysql_query($sql1))
|
||||
|
||||
while ($row1 = mysql_fetch_array($result1)){
|
||||
$existen_agentes =1;
|
||||
$id_agente=$row1["id_agente"];
|
||||
|
@ -164,6 +166,10 @@ if (comprueba_login() == 0)
|
|||
}
|
||||
echo "</table>";
|
||||
}
|
||||
else {
|
||||
echo '<tr><td></td></tr><tr><td class="red">'.$lang_label["no_agent"].'</td></tr></table>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view (Grouped)");
|
||||
require ("general/noaccess.php");
|
||||
|
|
|
@ -13,15 +13,13 @@ if (comprueba_login() == 0) {
|
|||
if (isset($_GET["id_agente"])){
|
||||
$id_agente = $_GET["id_agente"];
|
||||
}
|
||||
|
||||
echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3323' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
||||
// Get all module from agent
|
||||
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' order by tagente_modulo.nombre';
|
||||
$result_t=mysql_query($sql_t);
|
||||
if (mysql_num_rows ($result_t)) {
|
||||
echo "<h3>".$lang_label["monitor_listing"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3323' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
||||
echo "<table width='750' cellpadding=3 cellspacing=3>";
|
||||
echo "<tr><th>".$lang_label["type"]."<th>".$lang_label["module_name"]."<th>".$lang_label["description"]."<th>".$lang_label["status"]."<th>".$lang_label["interval"]."<th>".$lang_label["last_contact"];
|
||||
$color=0;
|
||||
$string='';
|
||||
while ($row_t=mysql_fetch_array($result_t)){
|
||||
# For evey module in the status table
|
||||
$est_modulo = $row_t["nombre"];
|
||||
|
@ -55,33 +53,39 @@ if (comprueba_login() == 0) {
|
|||
else
|
||||
$agent_down = 0;
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td class='".$tdcolor."'>".$est_tipo;
|
||||
echo "<td class='".$tdcolor."'>".$est_modulo;
|
||||
echo "<td class='".$tdcolor."f9'>".substr($est_description,0,32);
|
||||
if (!isset($string)) {$string='';}
|
||||
$string=$string."<tr><td class='".$tdcolor."'>".$est_tipo;
|
||||
$string=$string."<td class='".$tdcolor."'>".$est_modulo;
|
||||
$string=$string."<td class='".$tdcolor."f9'>".substr($est_description,0,32);
|
||||
// echo "<td class='datos'>".$row3["datos"];
|
||||
if ($agent_down == 1)
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/b_down.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/b_down.gif'>";
|
||||
else
|
||||
if ($est_estado == 1)
|
||||
if ($est_cambio ==1)
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/b_yellow.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/b_yellow.gif'>";
|
||||
else
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/b_red.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/b_red.gif'>";
|
||||
else
|
||||
echo "<td class='".$tdcolor."' align='center'><img src='images/b_green.gif'>";
|
||||
echo "<td class='".$tdcolor."'>";
|
||||
echo $temp_interval;
|
||||
echo "<td class='".$tdcolor."f9'>";
|
||||
$string=$string."<td class='".$tdcolor."' align='center'><img src='images/b_green.gif'>";
|
||||
$string=$string."<td class='".$tdcolor."'>".$temp_interval;
|
||||
$string=$string."<td class='".$tdcolor."f9'>";
|
||||
if ($agent_down == 1) // Si el agente esta down, lo mostramos en negrita y en rojo
|
||||
echo "<b><font color='red'>";
|
||||
|
||||
echo $row_t["timestamp"];
|
||||
$string=$string."<b><font color='red'>";
|
||||
$string=$string.$row_t["timestamp"]."</font></b>";
|
||||
}
|
||||
else unset($string);
|
||||
}
|
||||
if (isset($string)) {
|
||||
echo "<table width='750' cellpadding=3 cellspacing=3><tr></th><th>".$lang_label["type"]."<th>".$lang_label["module_name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["status"]."</th><th>".$lang_label["interval"]."</th><th>".$lang_label["last_contact"]."</th></tr>";
|
||||
echo $string;
|
||||
echo '<tr><td colspan="7"><div class="raya"></div></td></tr></table>';
|
||||
}
|
||||
else {
|
||||
echo "<font class='red'>".$lang_label["no_monitors"]."</font>";
|
||||
}
|
||||
}
|
||||
else
|
||||
echo "- <font class='red'>".$lang_label["no_monitors"]."</font>";
|
||||
echo "<font class='red'>".$lang_label["no_monitors"]."</font>";
|
||||
}
|
||||
?>
|
|
@ -72,9 +72,9 @@ if (comprueba_login() == 0) {
|
|||
//$sql3='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente.' order by id_module_group';
|
||||
$label_group=0;
|
||||
$last_label = "";
|
||||
echo "<h3>".$lang_label["last_data_chunk"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3322' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
||||
$result3=mysql_query($sql3);
|
||||
if (mysql_num_rows ($result3)) {
|
||||
echo "<h3>".$lang_label["last_data_chunk"]."<a href='help/".substr($language_code,0,2)."/chap3.php#3322' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";
|
||||
echo "<table width='750' cellpadding='3' cellspacing='3'><th>X<th>".$lang_label["module_name"];
|
||||
echo "<th>".$lang_label["type"]."<th>".$lang_label["int"]."<th>".$lang_label["description"]."<th>".$lang_label["data"]."<th>".$lang_label["graph"]."<th>".$lang_label["raw_data"]."<th>".$lang_label["timestamp"];
|
||||
$texto='';
|
||||
|
@ -176,6 +176,6 @@ if (comprueba_login() == 0) {
|
|||
}
|
||||
echo '<tr><td colspan="9"><div class="raya"></div></td></tr></table>';
|
||||
}
|
||||
else echo "- <font class='red'>".$lang_label["no_modules"]."</font>";
|
||||
else echo "<font class='red'>".$lang_label["no_modules"]."</font>";
|
||||
}
|
||||
?>
|
|
@ -91,11 +91,10 @@ if (comprueba_login() == 0) {
|
|||
|
||||
echo "</table>";
|
||||
echo "<br>";
|
||||
|
||||
$color =1;
|
||||
$result=mysql_query($sql);
|
||||
if (mysql_num_rows($result)){
|
||||
echo "<table cellpadding='3' cellspacing='3' width='750'>";
|
||||
echo "<tr><th>".$lang_label["agent"]."</th><th>".$lang_label["type"]."</th><th>".$lang_label["name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["max_min"]."</th><th>".$lang_label["interval"]."</th><th>".$lang_label["status"]."</th><th>".$lang_label["timestamp"]."</th>";
|
||||
$string='';
|
||||
while ($row=mysql_fetch_array($result)){ //while there are agents
|
||||
if ($row["disabled"] == 0) {
|
||||
if ((isset($ag_modulename)) && ($ag_modulename != "---"))
|
||||
|
@ -105,33 +104,45 @@ if (comprueba_login() == 0) {
|
|||
$result_gen=mysql_query($query_gen);
|
||||
if (mysql_num_rows ($result_gen)) {
|
||||
while ($data=mysql_fetch_array($result_gen)){
|
||||
echo "<tr>";
|
||||
echo "<td class='datos'><b><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data["id_agente"]."'>".dame_nombre_agente($data["id_agente"])."</A></B>";
|
||||
echo "<td class='datos'>";
|
||||
echo "<img src='images/".$iconindex[$data["id_tipo_modulo"]]."' border=0>";
|
||||
echo "<td class='datos'>".$data["nombre"];
|
||||
echo "<td class='datosf9'>".substr($data["descripcion"],0,30);
|
||||
echo "<td class='datos' width=25>".$data["max"]."/".$data["min"];
|
||||
echo "<td class='datos' width=25>";
|
||||
if ($data["module_interval"] == 0){
|
||||
echo give_agentinterval($data["id_agente"]);
|
||||
if ($color == 1){
|
||||
$tdcolor="datos";
|
||||
$color =0;
|
||||
} else {
|
||||
echo $data["module_interval"];
|
||||
$tdcolor="datos2";
|
||||
$color =1;
|
||||
}
|
||||
if (!isset($string)) {$string='';}
|
||||
$string=$string."<tr><td class='$tdcolor'><b>";
|
||||
$string=$string."<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data["id_agente"]."'>".dame_nombre_agente($data["id_agente"])."</a></b>";
|
||||
$string=$string."<td class='$tdcolor'>";
|
||||
$string=$string."<img src='images/".$iconindex[$data["id_tipo_modulo"]]."' border=0>";
|
||||
$string=$string."<td class='$tdcolor'>".$data["nombre"];
|
||||
$string=$string."<td class='".$tdcolor."f9'>".substr($data["descripcion"],0,30);
|
||||
$string=$string."<td class='$tdcolor' width=25>".$data["max"]."/".$data["min"];
|
||||
$string=$string."<td class='$tdcolor' width=25>";
|
||||
if ($data["module_interval"] == 0){
|
||||
$string=$string.give_agentinterval($data["id_agente"]);
|
||||
} else {
|
||||
$string=$string.$data["module_interval"];
|
||||
}
|
||||
$query_gen2='SELECT * FROM tagente_estado WHERE id_agente_modulo = '.$data["id_agente_modulo"];
|
||||
$result_gen2=mysql_query($query_gen2);
|
||||
$data2=mysql_fetch_array($result_gen2);
|
||||
echo "<td class='datos' align='center' width=20>";
|
||||
$string=$string."<td class='$tdcolor' align='center' width=20>";
|
||||
if ($data2["datos"] > 0){
|
||||
echo "<img src='images/b_green.gif'>";
|
||||
$string=$string."<img src='images/b_green.gif'>";
|
||||
} else {
|
||||
echo "<img src='images/b_red.gif'>";
|
||||
$string=$string."<img src='images/b_red.gif'>";
|
||||
}
|
||||
echo "<td class='datosf9' width='140'>".$data2["timestamp"];
|
||||
$string=$string."<td class='".$tdcolor."f9' width='140'>".$data2["timestamp"]."</td></tr>";
|
||||
}
|
||||
}
|
||||
else unset($string);
|
||||
}
|
||||
}
|
||||
if (isset($string)) {
|
||||
echo "<table cellpadding='3' cellspacing='3' width='750'><tr><th>".$lang_label["agent"]."</th><th>".$lang_label["type"]."</th><th>".$lang_label["name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["max_min"]."</th><th>".$lang_label["interval"]."</th><th>".$lang_label["status"]."</th><th>".$lang_label["timestamp"]."</th>";
|
||||
echo $string; //the built table of monitors
|
||||
echo "<tr><td colspan='8'><div class='raya'></div></td></tr></table>";
|
||||
echo "<br><table>";
|
||||
echo "<tr><td class='f9i'>";
|
||||
|
@ -139,6 +150,10 @@ if (comprueba_login() == 0) {
|
|||
echo "<td class='f9i'>";
|
||||
echo "<img src='images/b_red.gif'> - ".$lang_label["red_light"]."</td>";
|
||||
echo "</table>";
|
||||
}
|
||||
else {
|
||||
echo "<font class='red'>".$lang_label["no_monitors_g"]."</font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font class='red'>".$lang_label["no_agent"]."</font>";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue