In this post I will create a Process monitor in the Authoring Console. There are some pitfalls, for example the instance Count variable and to use lower-case in the process name.
1. Create an MP and a class in the Authoring console.
2. Create a discovery for your class. In my case i’ll check the registry if the spooler service is installed.
3. Now, create a reference to the process class. In Options add a reference by browsing to the folder containing Microsoft.SystemCenter.ProcessMonitoring.Library.mp.
4. Next it’s time to create to monitor. Open the Health Model tab and create a new custom monitor.
5. Set a Name and Target for the previously created class.
6. Click Browse for type in the Configurations tab.
7. Choose 1 of the 4 available types from the library referenced to. In this example I’ll pick ProcessInstanceCountMonitorType.
8. Fill in ProcessName, Frekvency, Max, Min and OutOfRangeTimeThreshold. Note, the process name must be written in lower-case or the monitor will not work.
9. Set the Health of the monitor.
10. Activate alerting. To obtain the Instance count you have to get the data from the variable $Data[Default=’0′]/Context/DataItem/Item0Context/DataItem/ProcessInformations/ProcessInformation[./ProcessName =’notepad.exe’]/ActiveInstanceCount$
11. Import the MP in the SCOM Console under the Administration tab.
12. In the Monitoring tab, check that the class has been discovered.
13. When the class is instanced with the correct server(s), kill the process to test the monitor.
14. An alert will show up.
In the next blog post about process monitoring I will create a custom Monitor Type that will let you override the Min-/Max-InstanceCount thresholds.
Hi Markus, thanks for the post.
Do you have any idea how to schedule the process monitor? We only need alerts if the process fails Monday to Friday.
Hello!
Instead of using the System.SimpleScheduler in your Data Source use the System.SchedulerFilter to be able to set the dates when the data should be processed.
Hello Marcus,
Do you know how to monitor specific instance of process only, I mean I have 3 processes running with the same name, but I’m only interested in particular one, run by specific user. Thanks for help!
Hello Sebastian!
You would have to create a custom monitor based on a script to accomplish that. To specify a process name and user in a PS script, you could use something like:
@(gwmi win32_process | where {$_.getowner().user -eq "Markus" -and $_.name -eq "notepad.exe"}).count