none
Want to monitor top 10 processes when cpu goes high

    Question

  • Hi Fellas,

    How to monitor top 10 processes of windows server when cpu utilization goes above 95%?

    i want to know what are the processes that is raising cpu utilization so high also send them across email notification.

    Thanks in advance.

    Tuesday, June 12, 2018 6:59 AM

All replies

  • Hello!

    As far as I know SCOM doesn't offer a a feature to find the top processes of the CPU usage.

    What you could do is to use PowerShell as follows:

    Powershell.exe -Command "Get-Process | Sort-Object CPU -Descending | select -First 5 ; (Get-Date).DateTime" >> C:\Temp\Top5CPU.txt

    You can also send e-mail notifications with PowerShell, have a look at the Send-MailMessage cmdlet below:

    https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-5.1

    Best regards,
    Leon



    Blog: https://thesystemcenterblog.com  LinkedIn:   

    Tuesday, June 12, 2018 7:05 AM
  • i don't see any output on this command
    Tuesday, June 12, 2018 12:58 PM
  • Note that I have placed the output to a file called Top5CPU.txt.

    I have tested this command and it should work.


    Blog: https://thesystemcenterblog.com  LinkedIn:   

    Tuesday, June 12, 2018 12:59 PM
  • yes but neither the output file is creating nor it is giving me anything on window itself, i am using scom 2012 sp1, is it compatible?
    Tuesday, June 12, 2018 1:03 PM
  • This is just a normal PowerShell script, it has nothing to do with SCOM :)

    Try running the script in a PowerShell as an administrator.


    Blog: https://thesystemcenterblog.com  LinkedIn:   

    Tuesday, June 12, 2018 1:06 PM
  • Hi,

    This is a Windows Powershell cmd, not really dependent on the SCOM version.

    Open the Powershell windows as an admin. and run this:

    Get-Process | Sort-Object CPU -Descending | select -First 5 ; (Get-Date).DateTime" | out-gridview

    If you see any errors, please post it here.

    Hope this helps

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

    Tuesday, June 12, 2018 1:07 PM
  • i think i am not able to make my question clear,

    it is like how can i get the list of top 10 processes on all the windows computer that are being monitored in my scom environment which is having cpu utilization over 95%?

    so on all those server where cpu goes above the threshold i mentioned ,i want to know which processes are causing it so high

    Tuesday, June 12, 2018 1:26 PM
  • Hello,

    We understand your question and as Leon mentioned, there's no way built-in in SCOM for that.

    What you can do alternatively is to run a script on the servers where the usage is high. You can also do this with an agent task.

    SCOM Agent Tasks “A hidden gem”

    Or, you could write a diagnostic task for the CPU usage monitor (in VBscript) which should give you this data. You can also write a Powershell script as a diagnostic task, you can also do it by importing SquaredUp's Powershell MP (which is free and awesome, btw). 

    Hope this helps. Please write back if you still have concerns.

    Cheers


    Sam (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" wherever applicable. Thanks!) Blog:AnalyticOps Insights Twitter:Sameer Mhaisekar

    • Proposed as answer by Leon Laude Tuesday, June 12, 2018 1:41 PM
    Tuesday, June 12, 2018 1:34 PM