mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-04-20 06:02:24 +00:00
11 lines
226 B
Python
11 lines
226 B
Python
![]() |
import psutil
|
||
|
|
||
|
# Get the overall CPU usage percentage
|
||
|
cpu_usage = psutil.cpu_percent(interval=1)
|
||
|
print(cpu_usage)
|
||
|
# Check CPU usage threshold
|
||
|
if cpu_usage >= 75: # Adjust the threshold as needed
|
||
|
exit(1)
|
||
|
else:
|
||
|
exit(0)
|