Share via


Get-ServiceFabricDeployedApplicationHealth

Gets the health of a Service Fabric application on a node.

Syntax

Default (Default)

Get-ServiceFabricDeployedApplicationHealth
    [-NodeName] <String>
    [-ApplicationName] <Uri>
    [-ConsiderWarningAsError <Boolean>]
    [-EventsHealthStateFilter <Int64>]
    [-EventsFilter <HealthStateFilter>]
    [-DeployedServicePackagesHealthStateFilter <Int64>]
    [-DeployedServicePackagesFilter <HealthStateFilter>]
    [-ExcludeHealthStatistics]
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Get-ServiceFabricDeployedApplicationHealth cmdlet gets the health of Service Fabric applications deployed on a node in a 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.

If the application is not deployed on the specified node, 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 a deployed application

PS C:\> Get-ServiceFabricDeployedApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01"

This command queries the health of the named application deployed on node named Node01.

Example 2: Get the health of a deployed application using custom health policy and return filters

PS C:\> Get-ServiceFabricDeployedApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01" -ConsiderWarningAsError $True -EventsFilter Error -DeployedServicePackagesFilter 'Warning,Error'

This command queries the health of the named application deployed on node Node01. It specifies values for health policy. It uses filters to return only Error events, and children with Error or Warning health states.

Example 3: Get the health of a deployed application and exclude health statistics and health events

PS C:\> Get-ServiceFabricDeployedApplicationHealth -ApplicationName fabric:/myapp/persistenttodolist -NodeName "Node01" -ExcludeHealthStatistics -EventsFilter None

This command queries the health of the named application deployed on node named Node01. The returned deployed application health doesn't include the health statistics, nor the health events.

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.

Parameter properties

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

Parameter sets

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

-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

-DeployedServicePackagesFilter

Specifies the filter for DeployedServicePackageHealthState 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

-DeployedServicePackagesHealthStateFilter

This parameter has been deprecated. Specify the DeployedServicePackagesFilter 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

-EventsFilter

Specifies the filter for the collection of HealthEvent reported on the entity 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. 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 deployed application health statistics, which contain information about how many deployed service packages children are in Ok, Warning, and Error states.

Parameter properties

Type:SwitchParameter
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 information for the application deployed to 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

System.Uri

Outputs

System.Object