question

NP-8916 avatar image
0 Votes"
NP-8916 asked Crystal-MSFT answered

top memory process

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?

msc-operations-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Crystal-MSFT avatar image
0 Votes"
Crystal-MSFT answered

@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"
101884-image.png
5.Put the script and add the first and last two lines commands into the script.
101902-image.png
6.Configure Unhealthy and healthy expression.
101901-image.png
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.



image.png (61.8 KiB)
image.png (57.5 KiB)
image.png (38.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RogerXue-3369 avatar image
0 Votes"
RogerXue-3369 answered

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 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.