LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to automate detection & killing of long running ssh2 processes? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-automate-detection-and-killing-of-long-running-ssh2-processes-595388/)

yeo_harry 10-29-2007 02:42 AM

How to automate detection & killing of long running ssh2 processes?
 
Hi,

I keep having long running ssh2 (more than 3 days) processes that uses a high percebtage of my CPU resources on my SUSE linux server.

Currently, I will log into the system, do a 'top', identify the process and perform a 'kill -9 nnnnn'.

Is there a way to automate the detection & killing of this processes?

Disillusionist 10-29-2007 03:28 AM

Try starting with:
Code:

ps -C ssh2 -o pid=,stime=
This will list all process id's from command ssh2 and their start time

From there you should be able to decide if you want to kill the process or not.

My testing was searching for bash instead of ssh but the concept is the same.


All times are GMT -5. The time now is 09:39 AM.