cpu_status loop added
This commit is contained in:
@@ -40,6 +40,7 @@ def main():
|
|||||||
|
|
||||||
status = 0
|
status = 0
|
||||||
status_str = "OK"
|
status_str = "OK"
|
||||||
|
for percent_used in cpu:
|
||||||
if percent_used >= args.critical:
|
if percent_used >= args.critical:
|
||||||
status = 2
|
status = 2
|
||||||
status_str = "CRITICAL"
|
status_str = "CRITICAL"
|
||||||
@@ -53,7 +54,7 @@ def main():
|
|||||||
f" total={total_mb:.1f}MiB"
|
f" total={total_mb:.1f}MiB"
|
||||||
)
|
)
|
||||||
|
|
||||||
print(f"MEMORY {status_str} - {used_mb:.1f}MiB used of {total_mb:.1f}MiB ({percent_used:.1f}%) | {perf}")
|
print(f"CPU {status_str} - {used_mb:.1f}MiB used of {total_mb:.1f}MiB ({percent_used:.1f}%) | {perf}")
|
||||||
sys.exit(status)
|
sys.exit(status)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user