How do I: Monitor a service and automatically restart it if it stops (SCOM 2012)

1. Go to Authoring – Management Pack Objects – Monitors

SCOM Monitor 001

2. Right Click Monitors – Create Monitor – Unit Monitor…



3. As always do no save anything to the Default Management Pack, if you have a custom management pack where you want to save the monitor if now click New


4.  Name your Management Pack – Next


5. Click Create


6. Windows Services – Basic Service Monitor – Next


7. a. Name your Monitor (I recommend the naming convention: unique prefix which should be a part of every custom rule/monitor/group-Servername-ServiceName)

b. Select a Monitor Target (Monitor Target Scope must apply to the server that contains the service you want to monitor. If you target Server 2003 and the Server that contains the service you want to monitor is Server 2008 you monitor won’t work)

c. Uncheck Monitor is enabled (You do not want to leave the this checked. If you do SCOM will try to monitor for this service on all Servers based on the monitor target even if they don’t contain the service you are trying to monitor. You will narrow the scope further and enable the monitor via an override once you are finished building it.)


8.  If you know the name the of the Service you can just type it in, but I recommend clicking the …selection button to point the monitor to the exact name of the service you want to monitor to avoid troubleshooting later on.


9. By default it will pull the available services from the management server you are running the console to see services from a different server click the … button and browse to your desired server.


10. For this example I am selecting the WMI Winmgmt service


11. Next


12. Generate alerts for this monitor – Automatically resolve the alert when the monitor returns to a healthy state – Create


13. Find your newly created monitor by searching for your custom prefix: ops-


14. Right click your new monitor – Overrides – Overide the Monitor – For a specific object of class: Windows Server 2008 R2 Full Operating System


15. Select the specific server that you want to monitor:


16. Enabled – Override Value – True (This will activate this service monitor for the associated server) – Apply – Show Monitor Properties


17. Configure recovery tasks – Add

Diagnostic and Recovery tasks2

18. Add – Recovery for critical health state

add recovery task

19. Run Command

run command

21. Name Recovery – Run recovery automatically – Recalculate monitor state after recovery finished

Start Service

22.  Enter the following items Parameter will vary based on the name of the service you are trying to recover automatically.


23. Once your Override and recovery are in place schedule a time when it is ok to stop the service you are trying to monitor/recover so that you can observe the behavior to insure you made no errors as well as to see if you want to tweak the timeout.

Leave a Reply

Your email address will not be published. Required fields are marked *

The contents of this site are provided “AS IS” with no warranties, or rights conferred. Example code could harm your environment, and is not intended for production use. Content represents point in time snapshots of information and may no longer be accurate. (I work @ MSFT. Thoughts and opinions are my own.)