How to monitor a web page in OpsMgr 2007 and configure recovery task.
It's fairly simple to monitor a web page in OpsMgr 2007 by using the web application monitoring feature. In this post I'll show you how it's done and how to configure a recovery task to execute a command or a script when the monitor status becomes critical.
Create Web Application using the following procedure (taken from http://sharepointnotes.wordpress.com/2008/03/17/web-application-monitoring-with-system-center-operations-manager/, If credentials are needed read the original post) :
-
Log on to the computer with an account that is a member of the Operations Manager Authors role for the Operations Manager 2007 Management Group
-
In the Operations Console, click the Authoring button
-
Expand Management Pack Templates and right-click Web Application. Select Add monitoring wizard
-
Select Web Application and click Next
-
Enter Name and Description and click Next
-
Enter and test the URL and click Next
The test will fail in the web site requires credentials but they can be provided later
-
Select the node that will act as the watcher node and enter time time interval at which the test will run. Click Next
The Watcher Node must be an agent managed computer and have access to the web site
-
Click Create
After the Web Application Monitor is created do as follows in order to configure a recovery task:
1. Open Web Applications under the authoring pane, Open the monitors screen:

2. Right Click the monitor under Entity Health > Availability and choose properties:

3. Switch to the diagnostics and recovery pane and choose Add in the recovery section, click the recovery for critical state option:

4. Follow the wizard, it allows you to configure a command or a script that will be executed when the monitor state becomes critical.
If you need to restart a service, You can create a batch file that uses the "Sc Stop" and "Sc Start" commands to restart the service on the remote computer (Use sc /? to get more info). Don't forget to configure the monitor recovery task to use it :-)