1,760
edits
Changes
→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
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==