-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (21 loc) · 793 Bytes
/
Copy pathmain.py
File metadata and controls
33 lines (21 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from monitor import generate_report, save_report
def print_report(report):
# Print formatted system report to the console
print("System Health Report")
print("-" * 30)
print(f"Timestamp: {report['timestamp']}")
print(f"CPU Usage: {report['cpu_usage_percent']}%")
print(f"Memory Usage: {report['memory_usage_percent']}%")
print(f"Disk Usage: {report['disk_usage_percent']}%")
print("\nTop Processes:")
for proc in report["top_processes"]:
print(f"{proc['name']} - {proc['cpu_percent']}%")
def main():
# Generate system report data
report = generate_report()
print_report(report)
# Save report to JSON file
filepath = save_report(report)
print(f"\nReport saved to: {filepath}")
if __name__ == "__main__":
main()