".__('Event successfully deleted')."";} } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to delete event ID".$id_trap); } } // Check Event (only incident write access). if (isset($_GET["check"])){ $id_trap = $_GET["check"]; if (give_acl ($config['id_user'], 0, "IW")) { $sql2="UPDATE ttrap set status=1, id_usuario = '".$config['id_user']."' WHERE id_trap = ".$id_trap; $result2=mysql_query($sql2); if ($result2) { echo "

".__('Event successfully validated')."

";} } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to checkout SNMP Trap ID".$id_trap); } } // Mass-process DELETE if (isset($_POST["deletebt"])){ $count=0; if (give_acl ($config['id_user'], 0, "IW")) { while ($count <= $config["block_size"]) { if (isset($_POST["snmptrapid".$count])){ $trap_id = $_POST["snmptrapid".$count]; mysql_query("DELETE FROM ttrap WHERE id_trap =".$trap_id); } $count++; } } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to mass-delete SNMP Trap ID"); } } // Mass-process UPDATE if (isset($_POST["updatebt"])){ $count=0; if (give_acl ($config['id_user'], 0, "IW")) { while ($count <= $config["block_size"]){ if (isset($_POST["snmptrapid".$count])){ $id_trap = $_POST["snmptrapid".$count]; $sql2="UPDATE ttrap SET status=1, id_usuario = '".$config['id_user']."' WHERE status = 0 and id_trap = ".$id_trap; $result2=mysql_query($sql2); } $count++; } } else { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to mass-validate SNMP Trap ID"); } } echo "

Pandora SNMP > "; echo __('SNMP console')."

"; $offset = get_parameter ('offset'); $sql2="SELECT * FROM ttrap ORDER BY timestamp DESC"; $result2=mysql_query($sql2); if (mysql_num_rows ($result2) == 0) { echo "
".__('There are no SNMP traps in database')."
"; return; } echo ""; echo ""; echo ""; echo "
"; echo " - ".__('Validated event'); echo "
"; echo " - ".__('Not validated event'); //echo "
"; //echo " - ".__('Alert'); echo "
"; echo " - ".__('Validate event'); echo "
"; echo " - ".__('Delete event'); echo "
"; echo "
"; // Prepare index for pagination $trap_list[]=""; while ($row2=mysql_fetch_array($result2)){ // Jump offset records $trap_list[]=$row2["id_trap"]; } $total_traps = count ($trap_list); pagination ($total_traps, "index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view", $offset); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "'; echo ""; $id_trap = 0; $color = 0; if ($offset != 0) $offset_limit = $offset + 1; else $offset_limit = $offset; // Skip offset records for ($a=$offset_limit;$a < ($config["block_size"] + $offset + 1);$a++){ if (isset($trap_list[$a])){ $id_trap = $trap_list[$a]; $sql="SELECT * FROM ttrap WHERE id_trap = $id_trap"; if ($result=mysql_query($sql)){ $trap=mysql_fetch_array($result); if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } $offset_counter++; echo ""; echo ""; // Agent ID $agent = get_db_row ('tagente', 'direccion', $trap['source']); if ($agent) { echo ""; } else { echo ""; } // OID echo ""; // CUSTOM $custom = substr ($trap["value_custom"], 0, 15); if (strlen ($trap["value_custom"]) > 15) $custom .= "..."; echo ""; // User echo ""; // Timestamp echo ""; // Alerted ? echo ""; // Delete and ACK echo ""; echo ""; } } } echo "
".__('Status')."".__('SNMP Agent')."".__('OID')."".__('Value')."".__('Custom')."".__('User ID')."".__('Timestamp')."".__('Alert')."".__('Action').""; echo ""; echo '
"; if ($trap["status"] == 0){ echo ""; } else { echo ""; } echo " ".$agent['nombre']."".$trap["source"]."".$trap["oid"]; // Value $value = substr ($trap["value"], 0, 15); if (strlen ($trap["value"]) > 15) $value .= "..."; echo "".$value."".$custom.""; if ($trap["status"]) echo " ".dame_nombre_real($trap["id_usuario"])."".substr($trap["id_usuario"],0,8).""; echo "".$trap["timestamp"].""; if ($trap["alerted"]) echo ""; echo ""; if ($trap["status"] == 0 && give_acl ($config['id_user'],"0","IW")) echo ""; if (give_acl ($config['id_user'], "0", "IM")) echo ""; echo ""; echo ""; echo "
"; $offset_counter = 0; echo "
"; echo " "; if (give_acl ($config['id_user'], 0, "IM")) { echo ""; } echo "
"; ?>