Get-​Service​Fabric​Node​Health

Gets the health state of a Service Fabric node.

Syntax

Get-ServiceFabricNodeHealth
   [-NodeName] <String>
   [-ConsiderWarningAsError <Boolean>]
   [-EventsFilter <HealthStateFilter>]
   [-EventsHealthStateFilter <Int64>]
   [-MaxPercentUnhealthyNodes <Byte>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

The Get-ServiceFabricNodeHealth cmdlet gets the health of a Service Fabric node. If the node that you specify by name does not exist in the health store, this cmdlet returns an error.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Examples

Example 1: Get health of a cluster node

PS C:\> Get-ServiceFabricNodeHealth -NodeName "Node01"

This command gets the health events reported for the node named Node01.

Example 2: Get the health of a cluster node using custom health policy and return filters

PS C:\> Get-ServiceFabricNodeHealth -NodeName "Node01" -ConsiderWarningAsError $True -EventsFilter Error

This command queries the health of the cluster node named Node01. It specifies values for health policy. It uses filters to return only Error events.

Required Parameters

-NodeName

Specifies the name of a Service Fabric node. The cmdlet gets health for the node that you specify.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ConsiderWarningAsError

Indicates whether to treat a warning health report as error during health evaluation.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsFilter

Specifies the filter for the collection of HealthEvents reported on the node based on health state. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only events that match the filter are returned. All events are used to evaluate the node aggregated health state. If not specified, all entries are returned.

Type:HealthStateFilter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EventsHealthStateFilter

This parameter has been deprecated. Specify the EventsFilter parameter instead.

Type:Int64
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxPercentUnhealthyNodes

Specifies the maximum tolerated percentage of unhealthy nodes. If there are more nodes with health state error than tolerated, the cluster is evaluated as error.

Do not specify this parameter.

Type:Byte
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

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

Inputs

String

This cmdlet accepts the name of a Service Fabric node.

Outputs

System.Fabric.Health.NodeHealth

This cmdlet returns a NodeHealth object that represents the health of a Service Fabric node.