Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Visual Basic |
---|
Dim instance As PartialMonitoringObject |
Syntax
Visual Basic |
---|
<SerializableAttribute> _ Public Class PartialMonitoringObject Inherits PartialMonitoringObjectBase |
C# |
---|
[SerializableAttribute] public class PartialMonitoringObject : PartialMonitoringObjectBase |
C++ |
---|
[SerializableAttribute] public ref class PartialMonitoringObject : public PartialMonitoringObjectBase |
J# |
---|
/** @attribute SerializableAttribute() */ public class PartialMonitoringObject extends PartialMonitoringObjectBase |
JScript |
---|
SerializableAttribute public class PartialMonitoringObject extends PartialMonitoringObjectBase |
Example
The following example shows how to get the computers that are running Windows in a Management Group and how to 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(); 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 PartialMonitoringObject class is the base class for the MonitoringObject and the PartialMonitoringObjectGroup classes.
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.
Inheritance Hierarchy
Microsoft.EnterpriseManagement.Common.MonitoringBase
Microsoft.EnterpriseManagement.Common.MonitoringBaseWithId
Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObjectBase
Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject
Microsoft.EnterpriseManagement.Monitoring.MonitoringObject
Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObjectGroup