Question: while not DONE: ps = [proc.cpu_percent() < args.LIMIT for proc in psutil.process_iter() if args.NAME in proc.name()] if ps: procNameSearch = procName.split(,) if not all(ps) and
while not DONE: ps = [proc.cpu_percent() < args.LIMIT for proc in psutil.process_iter() if args.NAME in proc.name()] if ps: procNameSearch = procName.split(",") if not all(ps) and PREV < 100 * INTERVAL: PREV = 100 * INTERVAL print('ALERT! %(N)s is going over %(L)d percent CPU usage!' % {"N": args.NAME, "L": args.LIMIT}) else: PREV = 0 if PREV <= 0 else PREV - 1 time.sleep(INTERVAL) else: DONE = True procNameSearch = procName.split(",") AttributeError: 'function' object has no attribute 'split' Any help for how i fix it?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
