Changes

Jump to: navigation, search

OPS435 Online Assignment 2

1,542 bytes added, 23:08, 19 July 2020
Sample Outputs
</pre>
==== Weekly Monthly Usage Report by Remote Host ====The following is a Weekly Monthly Usage Report created for the remote host 10.40.105.130 by the command:
<pre>
[eric@centos7 a2]$ ./a2.py -r 10.40.105.130 -t weekly monthly usage_data_file
</pre>
As discussed before, this command should also accept the <code>--seconds</code> option.
 
==== List Users With Verbose ====
Calling any of the previous commands with the <code>--verbose</code> option should cause the script to output more information:
<pre>
[eric@centos7 a2]$ ./a2.py -l user usage_data_file -v
</pre>
Files to be processed: ['usage_data_file']
Type of args for files <class 'list'>
User list for usage_data_file
=============================
asmith
cwsmith
rchan
tsliu2
</pre>
 
<pre>
[eric@centos7 a2]$ ./a2.py -r 10.40.105.130 -t monthly usage_data_file -v
</pre>
 
<pre>
Files to be processed: ['usage_data_file']
Type of args for files <class 'list'>
usage report for remote host: 10.40.105.130
usage report type: monthly
Monthly Usage Report for 10.40.105.130
======================================
Date Usage
02/2018 05:15:00
Total 05:15:00
</pre>
 
==== Daily Report From Online ====
Running the script with "online" as a file argument should call a subprocess.Popen object and run the command <code>last -Fiw</code>.
<pre>
[eric@mtrx-node06pd ~]$ ./a2.py -l user online
</pre>
 
(Example Output from Matrix):
<pre>
User list for last_output
=========================
aabbas28
aaddae1
aali309
aaljajah
aalves-staffa
aanees1
aarham
aassankanov
abalandin
abhaseen
abholay
acamuzcu
acchikoti
adas20
adeel.javed
...
</pre>
 
<pre>
[eric@mtrx-node06pd ~]$ ./a2.py -u adas20 -t daily online
</pre>
 
<pre>
Daily Usage Report for abholay
==============================
Date Usage
16/07/2020 00:13:09
17/07/2020 00:08:59
Total 00:22:08
 
</pre>
=== Detail Algorithm Document ===

Navigation menu