Changes

Jump to: navigation, search

OPS435 Python Assignment 1 2017 - 3

144 bytes added, 07:00, 21 February 2018
Instructions
'''Due Date''': Ask your professor for exact date.
'''Late penalty''': 10% per school day (including weekends), and note the assignment must be completed satisfactorily in order to pass the course no matter what grade you get.
== Overview ==
Often, system administrators need to analyze log files. This can be done using a paginator such as <code>less</code> when your system has just been set up and/or you're the only user. On a production system it is not unusual to have thousands of legitimate users per month accessing the server's services, plus thousands more bots looking for unpatched vulnerabilities, brute-forcing username/password pairs, or just downloading every available file on your web server.
In this assignment you will create a program that will help you as a Apache server administrator to answer questions about the status, load, and security of your web server. You will not need to set up a mail web server for this assignment, though you're welcome to use the one you've set up in OPS335 as a practice machine.
== Instructions ==
* For example: you only need basic programming skills to create the menus and implement menu navigation. Do that now, so that later you don't have to worry about it.
<!--* Your program should catch all reasonably-exptected exceptions (e.g. file not found, regular expression search failed, zero results) and print an error message that makes sense to an average user. If I have to debug your program for you - I may fix it or I may ask you to resubmit it.-->
* You may use any coding style you choose - but make sure it is consistent throughout the program. Coding style is important - not least because I have to read it. "Style" includes adding a comment at the top of every function explaining what it does. You won't lose marks for too many comments, you will lose marks for too few.
* If your assignemnt doesn't work or has major problems - you will be asked to resubmit it, which will likely cost you more than a late penalty.
<source>OPS435 Assignment 1 - Fall 2017
check_apache_logcheck_apache_log_yourmysenecaid.py
Author: Andrew Smith
The source code in this file (check_apache_logcheck_apache_log_yourmysenecaid.py) is original work written
by Andrew Smith and has not been copied from any other source including any
person, textbook, or online resource. I have not shared this work with anyone
<source>109.86.167.47 - - [29/Aug/2017:10:22:49 -0400] "GET /isomaster/releases/isomaster-1.3.13.tar.bz2 HTTP/1.1" 200 245085 "http://littlesvr.ca/isomaster/download/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0"</source>
You should use the Python <b>re</b> module, look [https://docs.python.org/3/library/re.html here] for documentation, you should probably use [https://docs.python.org/3/library/re.html#re.match.group match() and group()]. You may use the following regular expression to extract the components from each line:
<source>([(\d\.)]+) - - \[(.*?)\] "(.*?)" (\d+) ((\d+) "(.*?|-)" "(.*?)"</source>
The questions are self-explanatory, provide answers formatted as you see fit.
After testing your program - submit the .py file via Blackboard.
 
[[Category:OPS435-Python]]

Navigation menu