The Get-ServiceFabricClusterHealth cmdlet gets health information for a Service Fabric cluster.
Service Fabric reports the following health states:
OK.
The entity meets health guidelines.
Error.
The entity does not meet health guidelines.
Warning.
The entity meets health guidelines but experienced some issue.
The aggregated health state of the cluster takes into consideration all health reports on the cluster as well as the aggregated health state of all children, recursively.
The health evaluation uses the cluster health policy and the application health policy of each application in the cluster.
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 the health of the cluster and filter returned children
This command queries the health of the cluster.
It specifies filters to return only nodes with health state Error and applications with health state Warning or Error.
Example 2: Get the health of the cluster using custom health policies
This command queries the health of the cluster and passes in an application type health policy map.
The application type CriticalAppType does not tolerate any failures.
The remaining applications are evaluated using 20% maximum percent unhealthy.
Example 4: Get the health of the cluster without health events and without health statistics
This command queries the health of the cluster.
The health statistics returned as part of the cluster health contain the fabric:/System application statistics, in addition to the user applications statistics.
Parameters
-ApplicationHealthPolicyMap
Specifies the ApplicationHealthPolicyMap object that includes custom health policies for some or all of the applications.
If you do not specify this parameter, the health evaluation uses the application health policies defined in the application manifest or the default health policy.
Parameter properties
Type:
ApplicationHealthPolicyMap
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
-ApplicationsFilter
Specifies the filter for ApplicationHealthState children based on health state.
The value can be obtained from members or bitwise operations on members of HealthStateFilter.
Only children that match the filter are returned.
All children is used to evaluate the entity 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
-ApplicationsHealthStateFilter
This parameter has been deprecated.
Specify the ApplicationsFilter 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
-ApplicationTypeHealthPolicyMap
Specifies the map that defines the maximum percentage of unhealthy applications that are allowed per application type.
Application types in this map are evaluated using specific percentages rather than the global MaxPercentUnhealthyApplications percentage.
For example, if some applications of a type are critical, the cluster administrator can add an entry to the map for that application type and assign it a value of 0% (that is, do not tolerate any failures).
All other applications can be evaluated with MaxPercentUnhealthyApplications set to 20% to tolerate some failures out of the thousands of application instances.
The application type health policy map is used only if the cluster manifest enables application type health evaluation using the configuration entry for HealthManager/EnableApplicationTypeHealthEvaluation.
Parameter properties
Type:
ApplicationTypeHealthPolicyMap
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
-ConsiderWarningAsError
Indicates whether to treat a warning health report as error during health evaluation.
This value is used for evaluation of nodes and cluster health reports.
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 cluster 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 aggregated health state of the cluster.
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
-ExcludeHealthStatistics
Indicates whether the health statistics should be included in the query result. If specified, the health statistics are not returned as part of the query result. Otherwise, the query result includes the cluster health statistics, which contain information about how many entities are in Ok, Warning, and Error states.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ExcludeStats
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-IncludeSystemApplicationHealthStatistics
Indicates whether the health statistics should include information for the fabric:/System application. If specified, the application, service, partition, replica, deployed application, and deployed service package counts include the System entities.
If not specified, the health statistics return health state counts only for user applications.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
IncludeStats
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-MaxPercentUnhealthyApplications
Specifies the maximum tolerated percentage of unhealthy applications.
If there are more applications with aggregated health state of error than tolerated, the health state of the cluster is error.
If you do not specify this parameter, the health evaluation uses the value provided in the cluster manifest.
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
-MaxPercentUnhealthyNodes
Specifies the maximum tolerated percentage of unhealthy nodes.
If there are more nodes with aggregated health state of error than tolerated, the cluster is evaluated as error.
If you do not specify this parameter, the health evaluation uses the value provided in the cluster manifest.
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
-NodesFilter
Specifies the filter for NodeHealthState children based on health state.
The value can be obtained from members or bitwise operations on members of HealthStateFilter.
Only children that match the filter are returned.
All children are used to evaluate the entity 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
-NodesHealthStateFilter
This parameter has been deprecated.
Specify the NodesFilter 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
-NodeTypeHealthPolicyMap
Defines a map with max percentages unhealthy nodes for specific node types.
The node type health policy map can be used during cluster health evaluation to describe special node types. The node types included in the map are evaluated against the percentage included in the map, and also with the global (see System.Fabric.Health.ClusterHealthPolicy.MaxPercentUnhealthyNodes). The nodes of node types specified in the map are also counted against the global pool of nodes; they are independent checks.
Parameter properties
Type:
NodeTypeHealthPolicyMap
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
-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.