I'm looking for a software that can monitor a process (specified as a partial string/regexp match (e.g. grepping) in its full command-line) in terms of cpu and memory usage. If any of those processes exceed a certain cpu/memory limit for X cycles, the process in question should be killed.
Looking around a bit, I found monit, and ps-watcher.
- Monit can monitor a process and its child processes by matching the process name, but it can't kill the particular process that exceeded the limit. It would rather take the pid of the first match.
- Ps-watcher can match processes by their process-name and can kill the process that exceeded the limit. Bu it can't match processes via their full command-line. (not just the program name/path, but all potential arguments to it as well)
Any other alternatives? I had a simple shell script which did this before, but I didn't implement the cycles logic. There should be a tool which does this, I thought.