Open main menu

CDOT Wiki β

Changes

OPS435 Online Assignment 2S

629 bytes removed, 07:28, 19 November 2020
Suggested work-flow for this assignment
Follow the standard computation procedure: input - process - ouput when creating the algorithm document for this assignment.
==== input ====
* get what data (command line arguments/options) from the user using the functions provided by the argparse module* according to the arguments/options given at the command line, take appropriate processing action. do you need for each system administration operation
==== processing ====
* based on the file(s) specified, read the contents of each file what commands and use appropriate objects to store it* based on the command line arguments/options, process the data accordingly, which includes** data preprocessing (split a multi-day record into single day record)** record processing (preform required computation)in what order they should be executed
==== output ====
* output the required report based on the processed data==== identify and select appropriate python objects and functions ====The following python functions (to what information should be created, you may have more) are useful in handling the following sub-tasks:* reads login records from files and filters out unwanted records* convert login records into proper python object type so that it can be processed using as much built-in functions as possible * create function which generates daily usage reports by user and/or by remote host* create function which generates weekly usage reports by user and/display or by remote hostreturn
To help you with this assignment, you ==== identify and select appropriate fabric API for each task ====You can use the ur_template.py in following as the sample ops435-a2 repository as a starting point in designing template for your own Python Usage Report scriptfabric file:<pre>from fabric.api import *<font color='blue'><b>If you don't have enough time to create all the functions for the data processing steps, you should study the functions OPS435 Assignment 2S - Fall 2020Program: a2r_[seneca_id].pyAuthor: Student Name"The python code in the ur_funcsthis file a2s_[seneca_id].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 except those provided by your teacher), pick and use the one course instructor. I have not shared this python file with anyoneor anything except for submission for grading. I understand that may helpthe Academic Honesty Policy will be enforced and violators will be reported and appropriate action will be taken. </b></font>'''
env.user ="student" def addUser(name): '''add a user with given user name to remote system''' ... def listUser(): '''return a list of shell user on a remote system''' ... def listSysUser(): '''return a list of system (non-shell) user''' ... def findUser(name): '''find user with a given user name''' ... </pre> == Python script = fabric file coding and debugging ===For each function, identify what type of objects should be passed to the function, and what type of objects should be returned to the caller.Once you have finished coding a functiontask, you should start a Python3 interactive shell, import your functions and manually test each function run it on matrix and verify its correctness.
=== Final Test===
Once you have all the individual function task tested and that each is working properly, perform the final test and compare with test data provided by your professor the sample tests and verify that your script produces fabric tasks produce the correct results before submitting your python program it on Blackboard. Upload all the files for this assignment 2 to your vm in myvmlab and perform the final test.
== Sample login/logout records file and sample test run results==
1,760
edits