Share via


Get-ServiceFabricNodeHealth

Gets the health state of a Service Fabric node.

Syntax

Default (Default)

Get-ServiceFabricNodeHealth
    [-NodeName] <String>
    [-ConsiderWarningAsError <Boolean>]
    [-MaxPercentUnhealthyNodes <Byte>]
    [-EventsHealthStateFilter <Int64>]
    [-EventsFilter <HealthStateFilter>]
    [-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.

Parameters

-ConsiderWarningAsError

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

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:HealthStateFilter
Default value:None
Accepted values:Default, None, Ok, Warning, Error, All
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EventsHealthStateFilter

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

Parameter properties

Type:Int64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NodeName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TimeoutSec

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

Outputs

System.Object