Create a Service Monitor and Custom Alert in SCOM 2007 R2

baasopchoppySecurity

Nov 5, 2013 (3 years and 9 months ago)

107 views

Create a
Service
Monitor and Custom Alert in SCOM 2007 R2

Monitors provide the basic functionality of monitor in SCOM. Monitors are stateful

allowing you to
set the state on a components b
ased on conditional changes. This

example demonstrates how to
create a monitor and create a alert when the state of the ASP.NET State Service changes. This post
can be applied to any windows service. I
n

this example I have used the ASP.NET State Service.

To create a monitor and to create a custom alert this post is broken down into the following
sections:



Create a Unit Monitor



Create a recovery task for a critical health state



Create a Custom Alert



T
est the Monitor and Custom Alert



View the status in Health Explorer

Create a Unit Monitor

In a unit monitor you can define a list of states and allows you to detect these states. The unit
monitor to create will be based on the windows services group on a

basic service monitor. Basic
service monitor monitors when a windows service changes state.

To create a unit monitor, navigate to Authoring > Management Pack Objects. Right click Monitors >
Create a Monitor > Unit Monitor… which brings up the ‘Create a un
it Monitor’ dialog.





In the Create a unit Monitor dialog expand Windows Services and select ‘Basic Service Monitor’.
It is
recommended
the default management pack.







Enter the name and description for the monitor being created. Click ‘Select…’ to bring up the ‘Select
Items to Target’ dialog.

A monitor target specifies what managed objects will receive this monitor and be monitored.


Filter and select Windows Computer to allow operation manager Windows Computer objects to
receive this monitor. Click OK to close the dia
log.




The parent monitor can be adjusted. By default for this monitor Availability is selected.


Use the eclipse button to select the windows service to monitor.


Enter the computer name the windows service resides and select the windows service to m
onitor
(this example monitors ASP.NET State Service). Select OK.


Select Next to continue.


The health state of the monitor conditions can be adjusted. In the default setup, a critical state is set
when the windows service is stopped, otherwise it will b
e healthy. Select Next.


Select ‘Generate alerts for this monitor’ checkbox. This will generate an alert when the ASP.NET
State Service is stopped. Create an alert description by selecting the eclipse button, select Target >
DNS Name.


This will create a

more descriptive message within the alert.



Click Create to save the alert.


Refresh the monitor pane and you can drill down to view the newly created unit monitor.


Create a recovery task for a critical health state

To create a recovery task for a critical health state right click the unit monitor and select Properties.


Select the Diagnostic and Recovery tab and in the Configure recovery tasks section select Add… >
Recovery for critical health state.




In the ‘Cre
ate Recovery Task Wizard’ select ‘Run Command’ and click Next.


Enter and Recovery name and description. Ensure both options ‘Run recovery automatically’ and
‘Recalculate monitor state after recovery finishes’ are selected and click Next.


Specify the co
mmand line to execute as:

%windir%
\
system32
\
net.exe

and the start parameters as:

start aspnet_state

In this example I change the timeout to 30 seconds.






Select Create to create and save the recovery task.


Click OK to save changes to the monitor.



Create a Custom Alert

Navigate to Monitoring >
Management Pack Name
, right click and select New > Alert View.


Select the eclipse button to select the management object to create the alert on.



Select the condition of the alert as ‘created by specific

sources’. Next select the ‘specific’ link under
the Criteria description area. In the Alert Source dialog select the monitor created in the previous
steps. Click OK.


Select another alert condition ‘with specific resolution state’ and click the ‘specific
’ link in the
Criteria description area.

In the Resolution State dialog, select the option ‘Select only specific Resolution State’. From the drop
down select ‘Not Equals’ and enter the number 255 (Closed). Click OK.


Click OK to create and save the alert
.



The newly created alert will be visible under your management pack.


Test the Monitor and Custom Alert

To test the monitor and alert open services and stop the ASP.NET State Service.




Navigate back to Operations Manager and view the alert.


The
recovery task automatically states the ASP.NET State Service windows service.


View the status in Health Explorer

The window state change history can be viewed in Health Explorer.