Represents an Operations Manager monitoring alert. In Operations Manager, an alert is an item that indicates that a predefined situation has occurred on a monitored object. Alerts are defined by rules. Namespace: Microsoft.EnterpriseManagement.Monitoring
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)

Usage

Visual Basic
Dim instance As MonitoringAlert

Syntax

Visual Basic
<SerializableAttribute> _
Public Class MonitoringAlert
		Inherits OperationalDataObject
C#
[SerializableAttribute] 
public class MonitoringAlert : OperationalDataObject
C++
[SerializableAttribute] 
public ref class MonitoringAlert : public OperationalDataObject
J#
/** @attribute SerializableAttribute() */ 
public class MonitoringAlert extends OperationalDataObject
JScript
SerializableAttribute 
public class MonitoringAlert extends OperationalDataObject

Example

The following example shows how to get the Windows computers in a Management Group and display the health state and number of alerts for each computer.

C#  Copy Code
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Monitoring;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Xml;
using Microsoft.EnterpriseManagement.Monitoring.Security;

namespace SDKSamples
{
	class Program
	{
		static void Main(string[] args)
		{
			ReadOnlyCollection<PartialMonitoringObject> windowsComputerObjects;
			ManagementGroup managementGroup;
			MonitoringClass windowsComputerClass;

			managementGroup = new ManagementGroup("localhost");

			windowsComputerClass = managementGroup.GetMonitoringClass(
				SystemMonitoringClass.WindowsComputer);

			windowsComputerObjects = 
				managementGroup.GetPartialMonitoringObjects(windowsComputerClass);

			foreach (PartialMonitoringObject windowsComputerObject in windowsComputerObjects)
			{
				ReadOnlyCollection<MonitoringAlert> alerts;

				alerts = windowsComputerObject.GetMonitoringAlerts(
					Microsoft.EnterpriseManagement.Common.TraversalDepth.Recursive);

				Console.WriteLine("{0} - State: {1} - Number of alerts: {2}",
								windowsComputerObject.DisplayName,
								windowsComputerObject.HealthState.ToString(),
								alerts.Count);

				foreach (MonitoringAlert alert in alerts)
				{
					Console.WriteLine("{0}", alert.Name);
			}
		}
	}
}
}

Remarks

The MonitoringAlert class contains information about an alert in Operations Manager. Alerts are used to notify operators of problems. Alerts are driven by event processing rules or scripts. An alert tells you when something significant happened in one of your systems. You can monitor alerts to determine the significance of an alert and the corrective action to be taken.


Inheritance Hierarchy

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP

Target Platforms

Windows Server 2008,Windows Server 2003,Windows Vista,Windows XP

See Also