Export (0) Print
Expand All
Expand Minimize

Creating Monitors--an Example

This section provides an example to illustrate creating a monitor. The example shows how to create, and then link together, a data group, data collector, threshold, and action. Then, the example queries the WMI store for the Application Center event 5037 "Replication Session General Success" and logs the instance completion to a log file on the hard disk.

Action

The first step in creating a new monitoring process is to create the action because before you can add an action to a data collector, the action must exist. You can also associate an existing action to the collector.

To create an action that is logged to a text file

  1. In the Health Monitor snap-in, expand the Health Monitor node, expand the All Monitored Computers node, and then expand the cluster node.

  2. Right-click the Actions node, on the pop-up menu, click New, and then click Text Log Action.

  3. On the Details tab, under Log file, either enter the path to TestDeploy01.log or click Browse to locate it.

  4. On the General tab, in the Name box, enter Log to TestDeploy01.log

    Bb687452.note(en-us,TechNet.10).gif Note   Use a different log file for each data collector and action.

  5. On the Schedule tab, configure the action to run when the threshold is triggered.

  6. Click OK.

To create an action that sends an e-mail message

This action will send an e-mail notification when the event fires. You can also send e-mail notifications for any event or condition that is monitored by Health Monitor.

  1. In the Health Monitor snap-in, expand the Health Monitor node, expand the All Monitored Computers node, and then expand the cluster node.

  2. Right-click the Actions node, on the pop-up menu, click New, and then click E-mail Action.

  3. On the Details tab, enter the name for the SMTP server and other relevant information.

  4. In the Subject text box, either enter the subject to use for the e-mail message or click the right-angle bracket (>), and then in the insertions string list, chose items to include in the subject.

  5. On the General tab, in the Name box, enter the action name, E-mail Notification.

  6. Click OK.

Data Group

In this step, you will create a new data group for the monitor. This is done to illustrate the process because all of the monitors in the Synchronized Monitors data group are synchronized automatically across the cluster.

To create a data group

  1. Choose the member on which to add the data group.

    By default the data group is added to the member that you are logged on to.

  2. Right-click the cluster member node, on the pop-up menu, click New, and then click Data Group.

  3. In the Data Group Properties dialog box, on the General tab, in the Name box, enter the group name Replication Session Monitors.

  4. Click OK.

    This creates the data group without any actions associated with it.

Data Collectors

Now you can create the data collector under the data group. The collector will run a WMI event query looking for instances of Application Center event 5037, "Replication Session General Success".

To create a data collector

  1. Right-click the Replication Session Monitors data group.

  2. Click New, click Data Collector, and then click WMI Event Query.

  3. In the WMI Event Query dialog box, on the General tab, in the Name box, enter Deployment Test01 Completed.

  4. On the Details tab, next to the Namespace box, click Browse, locate root\MicrosoftApplicationCenter, and then click OK.

  5. Next to the Class box, click Browse, locate Replication Session General Success, and then click OK.

    The list is in alphabetical order.

  6. In the Properties box, select EventId, ReplicationId, ReplicationJobId, Status, StatusMessage, and LocalTimeFormatted.

  7. Click Apply.

To associate an action to a data collector

  1. On the Action tab, click New Action Association (the asterisk [*]).

  2. In the Execute Action Properties dialog box, under Action to execute, click Log to TestDeploy01.log.

  3. Under Execution condition, clear the Critical check box, click Warning, and then click OK.

  4. On the Message tab, under When status changes to Critical or Warning, at the end of the message string, click the cursor, and then type a period (.).

  5. Click the right-angle bracket (>), in the list, click EventId, and then type a comma (,).

  6. Click the right-angle bracket (>), in the list, click ReplicationId, and then type a comma (,).

  7. Click the right-angle bracket (>), and then in the list, click LocalTimeFormatted.

  8. Click OK.

This creates a data collector that sends an e-mail message to the administrator, which is defined in the e-mail action with the following parameters:

  • % name %—the name of the data collector.

  • % state %—the status of the data collector (Warning).

  • WMI Status: % CollectionErrorCode % % CollectionErrorDescription %—information about the WMI status.

  • % EmbeddedCollectedInstance.EventId %—Application Center event 5037.

  • % EmbeddedCollectedInstance.ReplicationID %—the replication identifier for the session (for this example, TestDeploy01).

  • % EmbeddedCollectedInstance.LocalTimeFormatted %—the local time when the event fired.

Thresholds

In this step, you create a threshold to test the value for ReplicationID. If this value is TestDeploy01, the status of the Deployment Test01 Completed data collector is changed to Warning. If ReplicationID is any other value, no change is made.

Bb687452.note(en-us,TechNet.10).gif Note   The data collector remains in the Collecting state until it receives an error.

To create the threshold

  1. Right-click the new data collector, on the pop-up menu, click New, and then click Threshold.

  2. In the Threshold Properties dialog box, under If this condition is true, in the second box, click ReplicationId.

  3. In the lower-left box, click Is equal to, and then in the lower-right box, enter TestDeploy01

  4. Under The following will occur, in the list, click The status changes to Warning.

  5. Click OK

Testing the Monitor

To verify that the new monitor works correctly, deploy an application named TestDeploy01 and an application with the default name (the current time and date). This demonstrates that the threshold is triggered when ReplicationID is TestDeploy01.

To test the monitor

  1. In the Application Center snap-in, right click the cluster node, and then click New Deployment.

    The New Deployment Wizard appears.

  2. In the wizard, on the second page, in the Deployment name box, enter TestDeploy01

    This value appears as the ReplicationID property.

  3. To complete the wizard, click a cluster node or cluster member node to deploy to and an application to deploy, such as Default Web Site.

    The deployment should complete and the status for the data collector should be Deployment Test01 Completed.

  4. Do another deployment, this time accepting the default deployment name (the current time and date).

    The status for the data collector should change to Warning. If you open the log file, you will notice that a new entry, TestDeploy01, was made for the first deployment but not for the second deployment because the threshold triggered the status change only when ReplicationID was TestDeploy01.

Did you find this information useful? Please send your suggestions and comments about the documentation to acdocs@microsoft.com

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft