PartialMonitoringObject Class

Updated: April 16, 2012

Represents a monitoring object that is a partial instance of a monitoring class. Namespace: Microsoft.EnterpriseManagement.Monitoring
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)Dim instance As PartialMonitoringObject <SerializableAttribute> _ Public Class PartialMonitoringObject Inherits PartialMonitoringObjectBase Implements IEnterpriseManagementObjectCreatable(Of PartialMonitoringObject)[SerializableAttribute] public class PartialMonitoringObject : PartialMonitoringObjectBase, IEnterpriseManagementObjectCreatable<PartialMonitoringObject>[SerializableAttribute] public ref class PartialMonitoringObject : public PartialMonitoringObjectBase, IEnterpriseManagementObjectCreatable<PartialMonitoringObject^>/** @attribute SerializableAttribute() */ public class PartialMonitoringObject extends PartialMonitoringObjectBase implements IEnterpriseManagementObjectCreatable<PartialMonitoringObject>SerializableAttribute public class PartialMonitoringObject extends PartialMonitoringObjectBase implements IEnterpriseManagementObjectCreatable<PartialMonitoringObject>

The following example shows how to get the computers that are running Windows operating systems in a management group and how to display the health state and number of alerts for each computer.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Common;
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)
		{
		
			ManagementGroup managementGroup = new ManagementGroup("localhost");
			ManagementPackClass windowsComputerClass = managementGroup.EntityTypes.GetClass(SystemMonitoringClass.WindowsComputer);

			IObjectReader<PartialMonitoringObject> reader = managementGroup.EntityObjects.GetObjectReader<PartialMonitoringObject>(windowsComputerClass, ObjectQueryOptions.Default);
			List<PartialMonitoringObject> windowsComputerObjects = new List<PartialMonitoringObject>();
			windowsComputerObjects.AddRange(reader);

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

				alerts = windowsComputerObject.GetMonitoringAlerts();

				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);
			}
		}		
	}	
}
}

The PartialMonitoringObject class is the base class for the MonitoringObject class and the PartialMonitoringObjectGroup class.

A partial monitoring object is an object for which only the standard set of monitoring object properties is defined. Any custom properties of the object's class are omitted. Because the Operations Manager database omits custom property values when responding to the query, using partial monitoring objects decreases the load on the database and improves query performance.

For more information about this class, see Monitoring Object and Partial Monitoring Object Comparison.



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

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms