Tag Archives: SCOM 2012 Service Monitoring

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…

 

UnitMonitor

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

createaunitmonitor

4.  Name your Management Pack – Next

ops-custommonitors

5. Click Create

create

6. Windows Services – Basic Service Monitor – Next

BasicServiceMonitor2

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.)

1ops

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.

Servicedetails

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.

default2

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

service

11. Next

State2

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

Winmgmt2

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

ops-

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

override

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

selectobject2

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

enabled2

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.

Tagged , , , , ,