1. Checks for the existence of any process(es) that has run longer than XX seconds at greater than XX% CPU usage.
2. If found process is not on the ignore list, then kill the process, write the event to a log file, and optionally send an email to specified address.
The script should accept a config file input switch. For example:
scriptname /path/to/file.cfg
Config file should look like this:
$seconds = xx; #The number of seconds the process must have been running before action is taken $cpu = xx; #The % of CPU that the process must be using before action is taken $send_email = x; #If 0, do not send notification email; if 1, send email$email = email@addy.com #The email address to receive notification email$logfile = /path/to/log/file;$ignore_list = process1,process2,process3,etc; #List of processes to ignore
The script should:
- be executable via cron
- be able to run every 1 or 2 minutes without killing the box
- try to "nicely" kill the process first, then kill it the "hard" way if necessary.
- be self-documenting (ie: please use comments)
- have any other appropriate features you think would be nice
Please contact me via Private Message with your price if you can do this.
Thanks!
