2006-12-03 Raul Mateos <raulofpandora@gmail.com>

* include/styles/pandora.css: new style for not found items.
	
	* operation/events/events.php: Add filter to events by group. Changed
	style for not found items.
	
	* operation/agentes/estado_agente.php, status_monitor.php,
	estado_alertas.php: Add name to filter combo. Changed style for not
	found items.

	* operation/incidents/incident.php: Changed style for not found items.
	
	* images/cancel.gif: Changed image to one with smaller size.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@296 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2006-12-03 02:07:36 +00:00
parent 2dec99848b
commit 19ce3869d7
8 changed files with 145 additions and 66 deletions

View File

@ -1,3 +1,18 @@
2006-12-03 Raul Mateos <raulofpandora@gmail.com>
* include/styles/pandora.css: new style for not found items.
* operation/events/events.php: Add filter to events by group. Changed
style for not found items.
* operation/agentes/estado_agente.php, status_monitor.php,
estado_alertas.php: Add name to filter combo. Changed style for not
found items.
* operation/incidents/incident.php: Changed style for not found items.
* images/cancel.gif: Changed image to one with smaller size.
2006-11-27 Raul Mateos <raulofpandora@gmail.com>
* general/footer.php: Add variable $time to get time from server which

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 517 B

View File

@ -410,3 +410,7 @@ div.imgr>img {
top: 0;
right: 1;
}
div.nf {
margin-left: 7px;
color: red;
}

View File

@ -47,7 +47,9 @@ if (comprueba_login() == 0) {
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60'>";
}
echo "<table border='0'><tr><td valign='middle'>";
echo "<table cellpadding='3' cellspacing='3'><tr>";
echo "<td>".$lang_label["group"]."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();' class='w130'>";
if ( $ag_group > 1 ){
@ -69,7 +71,7 @@ if (comprueba_login() == 0) {
}
}
echo "</select>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'></noscript></form>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'></noscript></td></form>";
// Show only selected groups
if ($ag_group > 1)
@ -192,7 +194,7 @@ if (comprueba_login() == 0) {
echo "<td class='$tdcolor'><font color='green'>".$biginterval."</font>";
else
echo "<td class='$tdcolor'>".$intervalo;
echo '<td class="'.$tdcolor.'"><img src="images/g_'.$iconindex_g[$id_grupo].'.gif" border="0"> ( '.dame_grupo($id_grupo).' )';
echo '<td class="'.$tdcolor.'"><img src="images/g_'.$iconindex_g[$id_grupo].'.gif"> ( '.dame_grupo($id_grupo).' )';
echo "<td class='$tdcolor'> ".$numero_modulos." <b>/</b> ".$numero_monitor;
if ($monitor_bad <> 0)
echo " <b>/</b> <font class='red'>".$monitor_bad."</font>";
@ -244,7 +246,7 @@ if (comprueba_login() == 0) {
}
echo "<tr><td colspan='8'><div class='raya'></div></td></tr>";
echo "</table><br>";
echo "<table>";
echo "<table cellpadding='3' cellspacing='3'>";
echo "<tr><td class='f9i'>";
echo "<img src='images/b_green.gif'> - ".$lang_label["green_light"]."</td>";
echo "<td class='f9i'>";
@ -260,7 +262,7 @@ if (comprueba_login() == 0) {
echo "</table>";
}
else {
echo '<tr><td></td></tr><tr><td class="red">'.$lang_label["no_agent"].'</td></tr></table>';
echo '</table><br><div class="nf">'.$lang_label["no_agent"].'</div>';
}
} else {

View File

@ -24,7 +24,7 @@ if (comprueba_login() == 0) {
if (isset($_GET["id_agente"])){
echo "<h3>".$lang_label["alert_listing"]."<a href='help/".$help_code."/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';
$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 "<table cellpadding='3' cellspacing='3' width=750 border=0>";
@ -59,7 +59,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 "<div class='nf'>".$lang_label["no_alerts"]."</div>";
}
else
{
@ -82,7 +82,9 @@ if (comprueba_login() == 0) {
} else {
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60'>";
}
echo "<table><tr><td valign='middle'>";
echo "<table cellpadding='3' cellspacing='3'><tr>";
echo "<td>".$lang_label["group"]."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();' class='w130'>";
if ( $ag_group > 1 ){
@ -102,8 +104,8 @@ if (comprueba_login() == 0) {
}
}
}
echo "</select>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'></noscript></form>";
echo "</select></td>";
echo "<td valign='middle'><noscript><input name='uptbutton' type='submit' class='sub' value='".$lang_label["show"]."'></noscript></td></form>";
// Show only selected groups
if ($ag_group > 1)
@ -168,9 +170,9 @@ if (comprueba_login() == 0) {
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_alert"]."</font></td></tr></table>";
echo "</table><br><div class='nf'>".$lang_label["no_alert"]."</div>";
}
} else echo "<tr><td></td></tr><tr><td><font class='red'>". $lang_label["no_agent"].$lang_label["no_agent_alert"]."</td></tr></table>";
} else echo "</table><br><div class='nf'>". $lang_label["no_agent"].$lang_label["no_agent_alert"]."</div>";
}
} //end acl
} //end login

View File

@ -50,8 +50,8 @@ if (comprueba_login() == 0) {
} else {
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60'>";
}
echo "<table cellspacing=3 cellpadding=3>";
echo "<tr><td valign='middle'>".$lang_label["group_name"]."</td>";
echo "<table cellspacing='3' cellpadding='3'>";
echo "<tr><td valign='middle'>".$lang_label["group"]."</td>";
echo "<td valign='middle'>";
echo "<select name='ag_group' onChange='javascript:this.form.submit();' class='w130'>";
@ -60,7 +60,7 @@ if (comprueba_login() == 0) {
}
echo "<option value=1>".dame_nombre_grupo(1);
$mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission
$sql='SELECT * FROM tgrupo';
$sql='SELECT id_grupo FROM tgrupo';
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
if ($row["id_grupo"] != 1){
@ -166,10 +166,10 @@ if (comprueba_login() == 0) {
echo "<tr><td colspan='8'><div class='raya'></div></td></tr></table>";
}
else {
echo "<font class='red'>".$lang_label["no_monitors_g"]."</font>";
echo "<div class='nf'>".$lang_label["no_monitors_g"]."</div>";
}
} else {
echo "<font class='red'>".$lang_label["no_agent"]."</font>";
echo "<div class='nf'>".$lang_label["no_agent"]."</div>";
}
} //end acl

View File

@ -122,51 +122,40 @@ if (comprueba_login() == 0) {
}
}
echo "<h2>".$lang_label["events"]."</h2>";
echo "<h3>".$lang_label["event_main_view"]."<a href='help/".$help_code."/chap5.php#5' target='_help' class='help'>&nbsp;<span>".$lang_label["help"]."</span></a></h3>";
echo "<table><tr>";
echo "<td>";
echo "<table cellpadding='3' cellspacing='3'><tr>";
if (isset($_POST["ev_group"])) {
$ev_group = $_POST["ev_group"];
} else {
$ev_group = -1;
}
echo "<form method='post' action='index.php?sec=eventos&sec2=operation/events/events&refr=60'>";
echo "<select name='event' onChange='javascript:this.form.submit();' class='w155'>";
echo "<td>".$lang_label["group"]."</td>";
echo "<td>";
echo "<select name='ev_group' onChange='javascript:this.form.submit();' class='w130'>";
// Prepare index for pagination
$event_list[]="";
if (isset($_POST["event"])){
$event = entrada_limpia($_POST["event"]);
if ($event=="All")
{
$sql2="SELECT * FROM tevento ORDER BY timestamp DESC";
} else {
$sql2="SELECT * FROM tevento WHERE evento = '$event' ORDER BY timestamp DESC";
echo "<option value='".$event."'>".$event;
if ( $ev_group > 1 ){
echo "<option value='".$ev_group."'>".dame_nombre_grupo($ev_group);
}
} else {
$sql2="SELECT * FROM tevento ORDER BY timestamp DESC";
}
echo "<option value='All'>".$lang_label["all"];
$result2=mysql_query($sql2);
if (mysql_num_rows($result2)){
while ($row2=mysql_fetch_array($result2)){ // Jump offset records
$id_grupo = $row2["id_grupo"];
if (give_acl($id_usuario, $id_grupo, "IR") == 1) // Only incident read access to view data !
$event_list[]=$row2["id_evento"];
}
if (isset($_GET["offset"]))
$offset=$_GET["offset"];
else
$offset=0;
$offset_counter=0;
$sql='SELECT DISTINCT evento FROM tevento';
echo "<option value=1>".dame_nombre_grupo(1)."</option>";
$mis_grupos[]=""; // Define array mis_grupos to put here all groups with Agent Read permission
$iconindex_g[]="";
$sql='SELECT id_grupo, icon FROM tgrupo';
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["evento"]."'>".$row["evento"];
$iconindex_g[$row["id_grupo"]] = $row["icon"];
if ($row["id_grupo"] != 1){
if (give_acl($id_usuario,$row["id_grupo"], "AR") == 1){
echo "<option value='".$row["id_grupo"]."'>".dame_nombre_grupo($row["id_grupo"]);
$mis_grupos[]=$row["id_grupo"]; //Put in an array all the groups the user belongs
}
}
}
echo "</select>";
echo "</form>";
echo "<td valign='middle'><noscript><input type='submit' class='sub' value='".$lang_label["show"]."' border='0'></noscript>";
echo "<td class='f9l30w17t'>";
echo "<img src='images/dot_green.gif'> - ".$lang_label["validated_event"];
echo "<br>";
@ -177,7 +166,63 @@ if (comprueba_login() == 0) {
echo "<br>";
echo "<img src='images/cancel.gif'> - ".$lang_label["delete_event"];
echo "</td>";
echo "</tr></table>";
echo "<tr><td valign='middle'>".$lang_label["events"]."</td>";
echo "<td><form method='post' action='index.php?sec=eventos&sec2=operation/events/events&refr=60'>";
echo "<select name='event' onChange='javascript:this.form.submit();' class='w155'>";
// Prepare index for pagination
$event_list[]="";
if (isset($_POST["event"])){
$event = entrada_limpia($_POST["event"]);
if ($event=="All")
{
if (isset($ev_group) && ($ev_group > 1)) {
$sql2="SELECT * FROM tevento WHERE id_grupo = '$ev_group' ORDER BY timestamp DESC";
} else {
$sql2="SELECT * FROM tevento ORDER BY timestamp DESC";
}
} else {
if (isset($ev_group) && ($ev_group > 1)) {
$sql2="SELECT * FROM tevento WHERE evento = '$event' AND id_grupo = '$ev_group' ORDER BY timestamp DESC";
} else {
$sql2="SELECT * FROM tevento WHERE evento = '$event' ORDER BY timestamp DESC";
}
echo "<option value='".$event."'>".$event."</option>";
}
} else {
$sql2="SELECT * FROM tevento ORDER BY timestamp DESC";
}
echo "<option value='All'>".$lang_label["all"]."</option>";
$result2=mysql_query($sql2);
if (mysql_num_rows($result2)){
while ($row2=mysql_fetch_array($result2)){ // Jump offset records
$id_grupo = $row2["id_grupo"];
if (give_acl($id_usuario, $id_grupo, "IR") == 1) // Only incident read access to view data !
$event_list[]=$row2["id_evento"];
}
if (isset($_GET["offset"]))
$offset=$_GET["offset"];
else
$offset=0;
$offset_counter=0;
if (isset($ev_group) && ($ev_group > 1)) {
$sql="SELECT DISTINCT evento FROM tevento WHERE id_grupo = '$ev_group'";
} else {
$sql="SELECT DISTINCT evento FROM tevento";
}
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result)){
echo "<option value='".$row["evento"]."'>".$row["evento"]."</option>";
}
echo "</select>";
echo "</form>";
echo "<td valign='middle'>";
echo "<noscript><input type='submit' class='sub' value='".$lang_label["show"]."'></noscript>";
echo "</td></tr>";
echo "</table>";
echo "<br>";
//pagination
@ -191,12 +236,12 @@ if (comprueba_login() == 0) {
}
echo "<br>";
echo "<table border='0' cellpadding='3' cellspacing='3' width='775'>";
echo "<table cellpadding='3' cellspacing='3' width='775'>";
echo "<tr>";
echo "<th>".$lang_label["status"];
echo "<th>".$lang_label["event_name"];
echo "<th>".$lang_label["agent_name"];
echo "<th>".$lang_label["group_name"];
echo "<th>".$lang_label["group"];
echo "<th>".$lang_label["id_user"];
echo "<th class='w130'>".$lang_label["timestamp"];
echo "<th>".$lang_label["action"];
@ -215,13 +260,24 @@ if (comprueba_login() == 0) {
if (isset($event_list[$a])) {
$id_evento = $event_list[$a];
if ($id_evento != ""){
if (isset($_POST["event"])){
if (isset($_POST["event"])) {
$event = entrada_limpia($_POST["event"]);
if ($event=="All") {
$sql="SELECT * FROM tevento WHERE id_evento = $id_evento";
if (isset($ev_group) && ($ev_group > 1)) {
$sql="SELECT * FROM tevento WHERE id_evento = '$id_evento' AND id_grupo = '$ev_group'";
} else {
$sql="SELECT * FROM tevento WHERE evento= '$event' AND id_evento = $id_evento";
$sql="SELECT * FROM tevento WHERE id_evento = '$id_evento'";
}
} else {
if (isset($ev_group) && ($ev_group > 1)) {
$sql="SELECT * FROM tevento WHERE evento= '$event' AND id_evento = '$id_evento' AND id_grupo = '$ev_group'";
} else {
$sql="SELECT * FROM tevento WHERE evento= '$event' AND id_evento = '$id_evento'";
}
}
} else {
$sql="SELECT * FROM tevento WHERE id_evento = $id_evento";
}
@ -246,7 +302,7 @@ if (comprueba_login() == 0) {
echo "<td class='$tdcolor'>".$row["evento"];
if ($row["id_agente"] > 0){
echo "<td class='$tdcolor'><a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row["id_agente"]."'><b>".dame_nombre_agente($row["id_agente"])."</b></a>";
echo "<td class='$tdcolor'>".dame_nombre_grupo($row["id_grupo"]);
echo "<td class='$tdcolor'><img src='images/g_".$iconindex_g[$id_group].".gif'> ( ".dame_grupo($id_group)." )</td>";
echo "<td class='$tdcolor'>";
} else { // for SNMP generated alerts
echo "<td class='$tdcolor' colspan='2'>".$lang_label["alert"]." / SNMP";
@ -277,7 +333,7 @@ if (comprueba_login() == 0) {
}
echo "</form></table>";
}
else {echo "<font class='red'>".$lang_label["no_event"]."</font>";}
else {echo "</select></form></td></tr></table><br><div class='nf'>".$lang_label["no_event"]."</div>";}
}
else {
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access event viewer");

View File

@ -248,7 +248,7 @@ if (isset($_POST['operacion'])){
$result2=mysql_query($sql1);
if (!mysql_num_rows($result2)) {
echo '<div style="margin-left: 7px; color: red">'.$lang_label["no_incidents"].'</div><br><table>';}
echo '<div class="nf">'.$lang_label["no_incidents"].'</div><br><table>';}
else {
while ($row2=mysql_fetch_array($result2)){ // Jump offset records
$id_group = $row2["id_grupo"];
@ -279,7 +279,7 @@ if (isset($_POST['operacion'])){
pagination ($total_incidentes, $url, $offset);
echo '<br>';
// Show headers
echo "<table cellpadding=3 cellspacing=3 width=770>";
echo "<table cellpadding='3' cellspacing='3' width='770'>";
echo "<tr>";
echo "<th width='43'>ID";
echo "<th>".$lang_label["status"];