Partager via


Start-WebApplicationMonitoring

Applies To: System Center 2012 R2 Operations Manager

Start-WebApplicationMonitoring

Starts monitoring an Internet Information Services (IIS) web application.

Syntax

Parameter Set: Default
Start-WebApplicationMonitoring [-Name] <String> [-Mode] <MonitoringMode> {Custom | Monitor | Trace} [-OutputPath] <String> [[-MaximumFileSizeInMegabytes] <UInt32> ] [-CollectionPlan <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Start-WebApplicationMonitoring cmdlet starts monitoring an IIS web application and writes application events and traces to a Visual Studio IntelliTrace file.

Start-WebApplicationMonitoring supports multiple levels of monitoring, controlled by the Mode parameter. Enable lightweight collection of exception and performance events by setting the value of Mode to monitor. Enable deeper tracing by setting the value of Mode to trace. Enable custom settings by setting the value of Mode to custom and setting the CollectionPlan parameter to point to a custom collection plan file.

After monitoring has started, use the Checkpoint-WebApplicationMonitoring cmdlet or the Stop-WebApplicationMonitoring cmdlet to create an IntelliTrace file in the specified output directory.

Start-WebApplicationMonitoring must be run with sufficient permissions to recycle the application pool that runs the web application. By default, this requires administrator permissions.

Parameters

-CollectionPlan<String>

Specifies the path and file name of the custom collection plan to use for monitoring. The path to the collection plan can be relative or absolute.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MaximumFileSizeInMegabytes<UInt32>

Specifies, in megabytes (MB), the maximum size allowed for each IntelliTrace file. When the maximum file size is reached, the oldest data are overwritten.

Aliases

none

Required?

false

Position?

4

Default Value

250

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Mode<MonitoringMode>

Specifies the mode to use for monitoring. Valid values are:

-- Monitor. Set this value to Monitor for lightweight monitoring of exceptions and performance.

-- Trace. Set this value to Trace for function-level application tracing.

-- Custom. Set this value to Custom to specify a custom collection plan. When Custom is specified, the CollectionPlan parameter is required.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the web application to start monitoring. This name is listed in IIS Manager. Valid values for this parameter are:

-- A web application name. A web application name must be specified as <website name>/<web application name>. For example, "Default Web Site/WebApp1".

-- An IIS path. For example, "IIS:\sites\Default Web Site\WebApp1".

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OutputPath<String>

Specifies the directory in which to store IntelliTrace files that are created by using the Checkpoint-WebApplicationMonitoring or Stop-WebApplicationMonitoring cmdlets. The directory must exist prior to running Start-WebApplicationMonitoring. When the Mode parameter is set to Trace, the application pool identity must have read/write permissions to the specified directory.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Object

    You may pipe any object that has public "Name", "Mode", and "OutputPath" properties.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Start monitoring for exception and performance events for a web application

This command starts monitoring for exception and performance events for the web application named WebApp1 in the website named Default Web Site. The application pool that contains WebApp1 is recycled to enable monitoring. The IntelliTrace file that is written when Checkpoint-WebApplicationMonitoring or Stop-WebApplicationMonitoring is run is saved to C:\outputfolder.

C:\PS>Start-WebApplicationMonitoring -Name "Default Web Site/WebApp1" -Mode Monitor -OutputPath C:\outputfolder

Example 2: Start function-level application tracing for a web application

This command starts function-level application tracing for the web application named WebApp1 in the website named Default Web Site. The application pool that contains WebApp1 is recycled to enable monitoring. The IntelliTrace file that is written when Checkpoint-WebApplicationMonitoring or Stop-WebApplicationMonitoring is run is saved to C:\outputfolder.

C:\PS>Start-WebApplicationMonitoring -Name "Default Web Site/WebApp1" -Mode Trace -OutputPath C:\outputfolder

Example 3: Start custom monitoring of a web application

This command starts monitoring the application named WebApp1 in the website named Default Web Site, by using the IIS path syntax, based on the collection plan stored at C:\temp\collectionplan.xml. The application pool that contains WebApp1 is recycled to enable monitoring. The IntelliTrace file that is written when Checkpoint-WebApplicationMonitoring or Stop-WebApplicationMonitoring is run is saved to C:\outputfolder.

C:\PS>Start-WebApplicationMonitoring -Name "IIS:\sites\Default Web Site\WebApp1" -Mode Custom -CollectionPlan C:\temp\collectionplan.xml -OutputPath C:\outputfolder

Get-WebApplicationMonitoringStatus

Checkpoint-WebApplicationMonitoring

Stop-WebApplicationMonitoring