Get-ServiceFabricNodeHealth
Gets the health state of a Service Fabric node.
Syntax
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.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Accepted values: | Default, None, Ok, Warning, Error, All |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NodeName
Specifies the name of a Service Fabric node. The cmdlet gets health for the node that you specify.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TimeoutSec
Specifies the time-out period, in seconds, for the operation.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
System.String
Outputs
System.Object