0
  1. I trigger an event from a custom tool and I have 4 linux servers where I need to monitor logs and grep for a particular event ID.
  2. The event ID could occur in any ONE of the 4 servers.
  3. I wrote a method that will make a ssh session checks for the grep pattern. Since there could be many servers added, I used a threading module to look concurrently in all the servers a specified time.
  4. If the match is found in one server, I want other threads to die. Is there a way I can inform to other threads to stop searching if the pattern is found in one? Is it safe?

I have many of these kind of functionality to be verified in many servers. So, I do not want to waste any time doing it in serially and want to save memory by stopping other threads.

ASANT
  • 411
  • 1
  • 6
  • 18
  • related: [Is there any way to kill a Thread in Python?](http://stackoverflow.com/q/323972/4279) – jfs Mar 07 '14 at 21:31
  • How are you invoking ssh? Are you using a library like `paramiko`? Showing the relevant part of your code would be helpful. – Alp Mar 08 '14 at 05:21
  • Why not fork and use subprocesses? Then you can kill the subprocesses. – Nathan Binkert Mar 14 '14 at 05:05

0 Answers0