currently running scom 2019
a few of the servers we are monitoring have the odd memory spike which generates an alert. Can scom actually report the process/s and their memory consumption at the time of the alert or in general?
currently running scom 2019
a few of the servers we are monitoring have the odd memory spike which generates an alert. Can scom actually report the process/s and their memory consumption at the time of the alert or in general?
@NP-8916, For our request, I have an idea. We can write a script to query the process and memory. when the top 3 process has used most of the memory, we can consider to generate an alert and put the process information into a share file. Here is the script and steps for the reference:
Script:
Note: please modify the script to adjust our request:
$process=Get-Process | Sort-Object PM -desc | Select -first 3| Select ProcessName,ID,PM,Description
$usedmem= ($process | Measure-Object -sum PM).sum
$mem=(get-wmiobject -class "win32_physicalmemory" -namespace "root\CIMV2").Capacity
$perc=($usedmem / $mem[0])*100
If ($perc -gt 80)
{
$process | Out-File -FilePath C:\test\memory.txt -append
}
After that, we can create a script monitor to generate alert:
1.Create a script monitoring in SCOM. Open SCOM
2.Click on Authoring, Click on "Monitors"
3.Right-click and select "Create a monitor" -> "Unit monitor"
4.Expand: "Scripting"->"Generic"->"Timed Script Two State Monitor"
5.Put the script and add the first and last two lines commands into the script.
6.Configure Unhealthy and healthy expression. 
7.Choose Generate rule.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
SCOM monitor, Total CPU Utilization Percentage, has a Diagnostic task List Top CPU Consuming processes.
Whenever this monitor changes to Critical state, the Diagnostic task will run automatically and list the top CPU consuming processes and the result can be viewed under State Change Events tab of the Health Explorer for the Server.
For details, you may refer to
https://social.technet.microsoft.com/Forums/security/en-US/22e555c7-3876-4b63-8c54-b02cd01629fc/how-to-determine-which-services-or-processes-use-the-most-cpu-time-on-a-specific-server-via-scom?forum=operationsmanagergeneral
Roger
5 people are following this question.