Open main menu

CDOT Wiki β

Changes

OPS435 Assignment 1 A

83 bytes added, 05:42, 20 February 2018
Header
<font color='red'>'''DRAFT - Under Construction'''</font>
=Assignment 1 - Usage Report=
'''Weight:''' 2015% of the overall grade
'''Due Date:''' Ask your professor for exact date
==Overview==
Most system administrators would like to know the utilization of their systems by their users. On a Linux system, each user's login records are normally stored in the binary file /var/log/wtmp. The login record in this binary file can not be viewed or edited directly using normal Linux text commands like 'less', 'cat', etc. The 'last' command is often used to display the login records stored in this file in a human readable form. Please check the man page of the 'last' command for available options. The following listing is a sample output of the 'last' commandwith the '-F' flag on:
<pre>
$ last -F
</pre>
In this assignment, your task is to create a python program with well designed functions 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.
== Instructions ==
* <b><code>python3 usage_report.py</code></b>, or
* <b><code>python3 usage_report.py filename</code></b>, or
* <b><code>python3 usage_report.py filename1 filename2 </code></b> etc ... - any number of filenames file names from 1 to as many as the command-line supports.
If there is no command line argument, your python program should get the login records from the 'last' command with the appropriate flags.
If there is one filename file name provided at the command line, gets read the login records from the contents of the given file. The format of each line in the file should be the same as the output of 'last -FFiw'.
If there is more than one filename file name provided, merges all the files together with the first one at the top and the last one at the bottom. Read and process the file contents in that order in your program.
=== Header ===
All your Python codes for this program must be placed in a <font color='red'>single source file</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 2018
1,760
edits