Changes

Jump to: navigation, search

OPS435 Assignment 1 A

6 bytes added, 07:46, 7 June 2018
Header
In this assignment, your task is to create a python program to produce daily, weekly, and monthly usage reports by user or by remote host based on the information obtained from the 'last' command or given files which contain similar information as the 'last' command.
== Resource for useful modules ==
* the <b>argparse</b> module
** [https://docs.python.org/3/howto/argparse.html Argparse Tutorial] - should read this first.
** [https://docs.python.org/3/library/argparse.html Argparse API reference information page]
* the <b>time</b> module
** [https://www.tutorialspoint.com/python3/python_date_time.htm Time module Tutorial]
** [https://docs.python.org/3/library/time.html Time module API reference page]
== Instructions ==
=== Program Name and valid command line arguments ===
Name your Python3 program as <code>ur.py</code>. The program should accept one or more "file name" as its command line parametersand other optional parameters as shown below. Your ur.py script should produce the following usage when run with the --help option:
<pre>
[rchan@centos7 a1]$ python3 ./ur.py -h
All your Python codes for this program must be placed in a <font color='red'><b><u>single source file</u></b></font>. Please include the following declaration by <b><u>you</u></b> as comment in your Python source code file (replace "Student Name" with your own name):
<source>OPS435 Assignment 1 - Winter Summer 2018Program: usage_reportur.py
Author: "Student Name"
The python code in this file (usage_reportur.py) is original work written by
"Student Name". No code in this file is copied from any other source
including any person, textbook, or on-line resource. I have not shared
The following is a sample Daily Usage Report for user1 on host.cty.senecacollege.ca:
<pre>
Daily Usage Report for user1 on host.cty.senecacollege.ca=========================================================Date Usage in Minutesseconds2018-02-14 602018-02-07 452018-02-01 5
Total 110
<pre>
Daily Usage Report from 10.94.10.25 on host.cty.senecacollege.ca================================================================Date Usage in Minutesseconds2018-02-14 302018-02-07 412018-02-01 9
Total 80
==== Weekly Usage Report by User ====
<source>
Weekly Usage Report - by User
=============================
The following is a sample Weekly Usage Report for user1 on host.cty.senecacollege.ca:
<pre>
Weekly Usage Report for user1 on host.cty.senecacollege.ca=========================================================Week # Usage in MinutesSeconds1 2017 01 1602 2017 02 453 2017 03 54 2017 04 20
Total 220
==== Weekly Usage Report by Remote Host ====
<source>
Weekly Usage Report - by Remote Host
===================================
The following is a sample Weekly Usage Report from the remote host 10.94.10.25 on host.cty.senecacollege.ca:
<pre>
Daily Weekly Usage Report from 10.94.10.25 on host.cty.senecacollege.ca================================================================Week # Usage in MinutesSeconds1 2017 01 303 2017 03 415 2017 05 96 2017 06 11
Total 91
</pre>
The following is a sample Monthly Usage Report for user1 on host.cty.senecacollege.ca:
<pre>
Monthly Usage Report for user1 on host.cty.senecacollege.ca===========================================================Month Usage in MinutesSecondsJanuary 2017 01 160February 2017 02 45
Total 205
<pre>
Monthly Usage Report from 10.94.10.25 on host.cty.senecacollege.ca================================================================Week # Month Usage in MinutesSecondsJanuary 2017 01 30February 2017 02 41
Total 71
</pre>
1,760
edits

Navigation menu