Answered detect and kill process

  • Friday, October 12, 2012 8:57 PM
     
     

    Hello,

    is it possible to detect a process that uses all avalilable processor (on a monitored windows 2003) and if it does that more than ....let say a minute, then kill the process ?

    Thanks.

All Replies

  • Saturday, October 13, 2012 6:47 AM
    Moderator
     
     

    Hi,

    Check the 'Process monitoring' feature. http://blogs.msdn.com/b/steverac/archive/2009/07/17/understanding-the-r2-process-monitoring-management-pack-templates.aspx

    Then you can use a custom recovery (f.e. script-based) to kill the process.


    http://OpsMgr.ru/

  • Saturday, October 13, 2012 7:38 AM
     
     

    seems to be ok for what i need, but:

    - can a wildchar be used for the process name ? (some explain for this: i need to run this on a terminal server where often some random user process consume all available processor leaving all other users without resources; so although at the moment i have the name of some processes that used to generate such problems i was hoping to be able to use some general rule that will work no matter the process name)

    - after the treshold is detected and the script from custom recovery is lunched - should the script detect the process or the monitor can pass the process id to the script as an argument ?

    thanks for the help.


    • Edited by octavmarius Saturday, October 13, 2012 7:39 AM typo
    •  
  • Saturday, October 13, 2012 8:17 AM
    Moderator
     
     Answered

    First of all you may want to check the Fair Share Scheduling feature: http://blogs.msdn.com/b/rds/archive/2009/05/29/using-wsrm-to-control-rds-dynamic-fair-share-scheduling.aspx . It could help you because killing a user process isn't very good for a user's experience.

    - You can discover a process using a wildcard, but you should be aware that in a terminal server environment you'll have to run a discovery very often. It's VERY bad for a server performance and overall management group performance as well. I recomment to use a script-based monitor for that. Script that will not discover a processes but only check a CPU usage and do some recovery work.

    - monitor can pass a  process ID, but to acheve that you have to create your own custom class and fill this property with a discovery rule. Again, I don't recommend to do that for a user processes because of the fact that user processes doesn't 'live a long life' on a server and you'll get a high volume of instance creation\deletion and config recalculations.


    http://OpsMgr.ru/

    • Marked As Answer by octavmarius Saturday, October 13, 2012 6:25 PM
    •  
  • Saturday, October 13, 2012 6:27 PM
     
     

    thanks;

    i will try to find a different sollution to my problem since scom cannot help me to much;