Hello everyone, running debian i have a few processes which tend to crash occasionally (game servers), which end up using 100% cpu. I'm looking for a program or script to check the cpu usage of a list of processes by name and if they are at 100% for more than X time, say 30 seconds, kill them. I tried ps-watcher but wasn't able to determine how to accomplish this. Just killing the process at 100% usage wont work as it will hit that for brief periods during normal operation. I've also found this script which seems to do what i want, however it is limited to one process: http://pastebin.com/m1c814cb4
Any help is greatly appreciated!