Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to kill runaway processes

Status
Not open for further replies.

backoftheworm

IS-IT--Management
Oct 11, 2002
12
0
0
US
I occasionally have runaway processes on my Openserver 5.0.6 server. They are non-root processes. At night and over the weekends, these processes can consume all of the cpu power. Are there any scripts that can automatically recognize and kill these runaway processes?
 
Something like:

[tt]ps -eo pid,comm,pcpu | nawk '$3 > 98 { print $1}' | xargs kill[/tt]

...would do it. Maybe kill -9 if they don't respond to that. You'd want to be sure that no other processes go over 98% CPU usage though! Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top