Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python, write a script that determines all users that have processes running and the percentage of CPU time each user is occupying. Your script
Using Python, write a script that determines all users that have processes running and the percentage of CPU time each user is occupying.
Your script should accept arguments:
Total amount of time to collect for
Time between samples
Output file
Your output file should include:
Users this includes the System users with running tasks.
A marker indicating if the user is currently logged on
Average percentage of processor time across all samples.
The user may have multiple programs running for a sample. The user's total utilization for the sample is the sum of all of the programs.
The average here, is the average of each samples total.
Apply the secure coding principles we have talked about.
Input validation.
Input Canonicalization
Input Sanitization
Secure Error Handling & Exception Handling
Principle of Least Privilege.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started