March 2010
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  

★ HostATree – Celeron-L Conroe 1.6 Blow Out Sale! Only $49 a month!

I need a script that does the following for linux:

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:

Code:
$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!

Random Posts

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>