Get-ServiceFabricApplicationHealth
Gets the health of a Service Fabric application.
Syntax
Get-ServiceFabricApplicationHealth
[-ApplicationName] <Uri>
[-ConsiderWarningAsError <Boolean>]
[-MaxPercentUnhealthyDeployedApplications <Byte>]
[-MaxPercentUnhealthyServices <Byte>]
[-MaxPercentUnhealthyPartitionsPerService <Byte>]
[-MaxPercentUnhealthyReplicasPerPartition <Byte>]
[-EventsHealthStateFilter <Int64>]
[-EventsFilter <HealthStateFilter>]
[-ServicesHealthStateFilter <Int64>]
[-ServicesFilter <HealthStateFilter>]
[-DeployedApplicationsHealthStateFilter <Int64>]
[-DeployedApplicationsFilter <HealthStateFilter>]
[-ExcludeHealthStatistics]
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
The Get-ServiceFabricApplicationHealth cmdlet gets the health state of a Service Fabric application. 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.
If the entity is not found 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 the health of an application
PS C:\> Get-ServiceFabricApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist
This command queries the health of the named application.
Example 2: Get the health of an application using custom health policy and return filters
PS C:\> Get-ServiceFabricApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -ConsiderWarningAsError $True -EventsFilter Error -ServicesFilter 'Error,Warning' -DeployedApplicationsFilter 'Warning,Error'
This command queries the health of the named application. The command specifies values for health policy and it uses filters to return only Error events, and children with Error or Warning health states.
Example 3: Get the health of an application and exclude the health statistics
PS C:\> Get-ServiceFabricApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -ExcludeHealthStatistics
This command queries the health of the named application. The returned application health doesn't include the health statistics.
Parameters
-ApplicationName
Specifies the Uniform Resource Identifier (URI) of a Service Fabric application. The cmdlet gets health information for the application that has the URI that you specify.
Type: | Uri |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ConsiderWarningAsError
Indicates whether this cmdlet considers a warning health report as an error during health evaluation.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeployedApplicationsFilter
Specifies the filter for DeployedApplicationHealthState children based on health state. The value is 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 application 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 |
-DeployedApplicationsHealthStateFilter
This parameter has been deprecated. Specify the DeployedApplicationsFilter parameter instead.
Type: | Int64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EventsFilter
Specifies the filter for the collection of HealthEvent objects reported on the application 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 application 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 |
-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 application health statistics, which contain information about how many services, partitions and replicas of this application are in Ok, Warning and Error states.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxPercentUnhealthyDeployedApplications
Specifies the maximum tolerated percentage of unhealthy application instances deployed on the nodes in the cluster. If there are more deployed applications with health state error than tolerated, the health state of the application is error. If you do not specify this parameter, the health evaluation uses the value provided in the application manifest.
Type: | Byte |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxPercentUnhealthyPartitionsPerService
Specifies the maximum tolerated percentage of unhealthy service partitions. If there are more partitions with health state error than tolerated, the health state of the services is error. If you do not specify this parameter, the health evaluation uses the value provided in the application manifest.
Type: | Byte |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxPercentUnhealthyReplicasPerPartition
Specifies the maximum tolerated percentage of unhealthy partition replicas. If there are more replicas with health state error than tolerated, the health state of the partition is error. If you do not specify this parameter, the health evaluation uses the value provided in the application manifest.
Type: | Byte |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxPercentUnhealthyServices
Specifies the maximum tolerated percentage of unhealthy services in an application. If there are more services with health state error than tolerated, the health state of the application is error. If you do not specify this parameter, the health evaluation uses the value provided in the application manifest.
Type: | Byte |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServicesFilter
Specifies the filter for ServiceHealthState 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 application 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 |
-ServicesHealthStateFilter
This parameter has been deprecated. Specify the ServicesFilter parameter instead.
Type: | Int64 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
System.Uri
Outputs
System.Object