Add-ClusterVMMonitoredItem

Configures monitoring for a service or an Event Tracing for Windows (ETW) event so that it is monitored on a virtual machine.

Syntax

Add-ClusterVMMonitoredItem
   [-Service <StringCollection>]
   [-EventLog <String>]
   [-EventSource <String>]
   [-EventId <Int32>]
   [-OverrideServiceRecoveryActions]
   [[-VirtualMachine] <String>]
   [-Wait <Int32>]
   [-Cluster <String>]
   [<CommonParameters>]
Add-ClusterVMMonitoredItem
   [-Service <StringCollection>]
   [-EventLog <String>]
   [-EventSource <String>]
   [-EventId <Int32>]
   [-OverrideServiceRecoveryActions]
   [-VMId <Guid>]
   [-Wait <Int32>]
   [-Cluster <String>]
   [<CommonParameters>]
Add-ClusterVMMonitoredItem
   [-Service <StringCollection>]
   [-EventLog <String>]
   [-EventSource <String>]
   [-EventId <Int32>]
   [-OverrideServiceRecoveryActions]
   [-Wait <Int32>]
   [-InputObject <PSObject>]
   [-Cluster <String>]
   [<CommonParameters>]

Description

The Add-ClusterVMMonitoredItem cmdlet configures monitoring for a service or an Event Tracing for Windows (ETW) event so that it is monitored on a virtual machine. If the service fails or the event occurs, then the system responds by taking an action based on the failover configuration for the virtual machine resource. For example, the configuration might specify that the virtual machine be restarted.

Examples

Example 1

PS C:\> Add-ClusterVMMonitoredItem -VirtualMachine test-VM11 -EventLog "Microsoft-Windows-FailoverClustering-Manager/Admin" -EventSource "Microsoft-Windows-FailoverClustering-Manager" -EventId 4708
Name 
---- 
Microsoft-Windows-FailoverClustering-Manager+Admin,Microsoft-Windows-FailoverClustering-Manager,4708

This example adds monitoring for the ETW event ID 4708.

Example 2

PS C:\> Add-ClusterVMMonitoredItem -VirtualMachine test-VM11 -Service spooler
Name 
---- 
Spooler

This example configures monitoring for the print spooler service.

Optional Parameters

-Cluster

Specifies the name of the cluster on which to run this cmdlet. If the input for this parameter is . or it is omitted, then the cmdlet runs on the local cluster.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventId

Specifies the event identifier (ID) of the event to be monitored.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventLog

Specifies the event log of the event to be monitored.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventSource

Specifies the event source of the event to be monitored.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies the cluster on which to run the cmdlet, the clustered virtual machine on which to configure monitoring, and the cluster virtual machine monitored item object to monitor.

Type:PSObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-OverrideServiceRecoveryActions

Specifies that the cluster service will fix, by overriding, the service recovery actions in the event that it is not properly configured for monitoring. To be configured for monitoring the following conditions need to be met:

  • None of the service recovery actions are set to Restart the computer.

AND

  • At least one of the service recovery actions are set to Take no action.
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Service

Specifies the name of a service to be monitored. This must be the short name, not the long name, of the service. For example, specify clussvc instead of Failover Cluster service.

Type:StringCollection
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMId
Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VirtualMachine
Type:String
Aliases:VM
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Wait
Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.FailoverClusters.PowerShell.Cluster

Inputs

Microsoft.FailoverClusters.PowerShell.ClusterGroup

Inputs

Microsoft.FailoverClusters.PowerShell.ClusterResource

Inputs

Microsoft.FailoverClusters.PowerShell.ClusterVMMonitoredItem

Outputs

None