In this example, we will create a PowerShell Dynamic Application. Our Dynamic Application will collect the Processor Queue Length from a Windows computer.
NOTE: This example Dynamic Application is included in the "Microsoft: Windows Server" PowerPack, version 1.0 and later. This example describes how to create only one of the requests, collection objects, and presentation objects that are included in the "Microsoft: Windows Server" PowerPack version of this Dynamic Application.
Creating the Dynamic Application
To create the Dynamic Application and define the general properties for this Dynamic Application, perform the following steps:
- Go to the Dynamic Applications Manager page (System > Manage > Applications).
- Select the Create New Dynamic Application. The Dynamic Applications Create New Application page appears. button, and then select
- Supply values in the following fields:
- Application Name. Enter "Microsoft: Windows Server CPU Performance" in this field.
- Application Type. Select PowerShell Performance.
- Polling Frequency. Select Every 5 Minutes.
- For this example, you can leave the remaining fields at their default value. Select the Dynamic Application. button to save the
Adding the PowerShell Command
In SL1, each PowerShell Dynamic Application must include at least one PowerShell Command.
The collection objects in a PowerShell Dynamic Application are populated when SL1 executes a PowerShell Command.
Collection objects in PowerShell Dynamic Applications are aligned with properties (columns). The definition of each object specifies the PowerShell command that will populate the object and the property name to align with the object. The retrieved values of the property will populate the object.
To create the PowerShell command for this Dynamic Application:
- Go to the Dynamic Applications Manager page (System > Manage > Applications).
- Select the wrench icon for the "Microsoft: Windows Server CPU Performance" Dynamic Application. The Dynamic Applications Properties Editor page appears.
- Select the PowerShell Command Editor and Registry page appears. tab. The
- Supply values in the following fields:
- PowerShell Command Name. We named our PowerShell Command "Server CPU Processor Queue-Length".
- Active State. Select Enabled.
- PowerShell Command Query. This Dynamic Application collects the CookedValue property from \System\Processor Queue Length: . We entered the following in the PowerShell Command Query field:
(Get-Counter "\System\Processor Queue Length").CounterSamples | Select-Object CookedValue
- Select the button to save the PowerShell command.
Adding the Collection Object
Our example Dynamic Application has one collection object: Processor Queue Length.
To create the collection object, perform the following steps:
- Go to the Dynamic Applications Manager page (System > Manage > Applications).
- Select the wrench icon (
) for the "Microsoft: Windows Server CPU Performance" Dynamic Application. The Dynamic Applications Properties Editor page appears.
- Select the Dynamic Applications | Collections Objects page appears. tab. The
- To create the collection object for Processor Queue Length, supply values in the following fields:
- Object Name. We named our collection object "Processor Queue Length".
- PowerShell Argument. In this field, you must specify the name of the property to associate with this object. Enter "CookedValue" in this field.
- Class Type. Processor Queue Length is a number that can go up or down between polls. Select 4 Performance Gauge in this field.
- PowerShell Request. Name of the PowerShell request associated with this object. Select Server CPU Processor Queue Length.
- Group Number. Select No Group. For performance Dynamic Applications, SL1 uses the Group Number setting to associate performance values with the appropriate labels.
- Description. A description of the object. This is an optional field. We provided a summary of the object in this field.
- For this example, you can leave the remaining fields set to their default values.
- Select the button.
Creating the Presentation Object
When you create a collection object in a Dynamic Application of type Performance, SL1 automatically creates a presentation object that corresponds to that collection object. In this example, we will edit the presentation object for the Processor Queue Length to create a new presentation object for the Processor Queue Length.
To create the Processor Queue Length presentation object:
- Go to the Dynamic Applications Manager page (System > Manage > Applications).
- Select the wrench icon (
) for the "Microsoft: Windows Server CPU Performance".
- Select the Dynamic Applications Presentation Objects page appears. tab. The
- In the Dynamic Applications Presentation Objects page, the Processor Queue Length collection object created in the Adding the Collection Objects section has been created by default. Select the Processor Queue Length presentation object's wrench icon (
) to edit it.
- To create the presentation object that displays the Processor Queue Length, supply values in the following fields:
- Report Name. Enter "Processor Queue Length".
- Active State. Select Enabled. SL1 will generate a report of the presentation object.
- Data Unit. Enter "Threads" into this field.
- Abbreviation / Suffix. Enter "Threads" into this field.
- Show as Percent. Select No. The graph will not display percent values.
- For this example, you can leave the remaining fields set to their default values. Select the button to save the presentation object.
Creating a Credential
To use the "Microsoft: Windows Server CPU Performance" Dynamic Application, we must create a PowerShell credential. To create the PowerShell credential:
- Go to the Credential Management page (System > Manage > Credentials).
- Select PowerShell Credential. The Create New PowerShell Credential page appears. button, and then select
- Supply values in the following fields:
- Profile Name. Enter a credential name in this field. We entered "PowerShell 2k12R2 [AD]" in this example.
- Account Type. Select the account type of the user that will provide access to the monitored Windows device.
- Hostname/IP. Enter "%D" in this field. SL1 will replace the variable with the IP address of the device that is currently using the credential.
- Timeout (ms). Enter "3000" in this field. SL1 will stop trying to communicate with the authenticated server after 3000 ms.
- Username. Enter the username for a user that will provide access to the monitored Windows device.
- Password. Enter the password for the user account you entered in the Username field.
- Encrypted. Select whether encryption is configured on the monitored Windows device.
- Port. The port should be automatically selected after selecting a value in the Encrypted field.
- PowerShell Proxy Hostname./IP. Do not enter a value this field unless you have configured a Windows device to serve as an intermediary proxy to retrieve PowerShell data from the target Windows device.
- Active Directory Hostname/IP. If you are using an active directory user account, enter the Hostname or IP address of the managed device’s corresponding domain controller from the active directory forest.
- Domain. Enter your Active Directory Domain.
- Select the button to save the credential.
Manually Aligning the Dynamic Application to a Device
In this example we will align the Dynamic Application to a Windows device that is configured for monitoring via PowerShell. By manually aligning the Dynamic Application to a device, we can immediately view the performance data in the presentation object we defined.
To manually align the Dynamic Application to a device:
- Go to the Device Manager page (Devices > Classic Devices, or Registry > Devices > Device Manager in the classic SL1 user interface).
- In the Device Manager page, find the device you want to align with the Dynamic Application. In this example, we are aligning the Dynamic Application to a Windows device that is configured for monitoring via PowerShell. Select the wrench icon for the device (
).
- The Device Properties page appears. Select the tab.
- In the Dynamic Application Collections page, select the button and select Add Dynamic Application. The Dynamic Application Alignment page appears:
- Select the "Microsoft: Windows Server CPU Performance" Dynamic Application in the Dynamic Applications field, and select the appropriate PowerShell credential in the Credentials field.
- Select the Dynamic Application. button to add the
Viewing the Performance Report
After the Dynamic Application has collected the data specified in the collection objects, you can view the performance report for the device. To view the performance report for the device with the "Microsoft: Windows Server CPU Performance" Dynamic Application aligned to it:
- From the Dynamic Application Collections page, select the button to update the page with the latest information.
- Locate the "Microsoft: Windows Server CPU Performance" Dynamic Application. If the graph icon is colored, the performance report is available. Select the graph icon (
) for the presentation object you want to view.
Or:
- Go to the Device Manager page (Devices > Classic Devices, or Registry > Devices > Device Manager in the classic SL1 user interface).
- In the Device Manager page, find the test device you aligned the "Microsoft: Windows Server CPU Performance" Dynamic Application. Select the device's graph icon.
- The Device Summary page appears. Select the tab.
- In the left NavBar, select the presentation object you created in the section Creating the Presentation Objects:
- The Microsoft: Windows Server CPU Performance | Processor Queue Length report is displayed.
- The report displays the collected values from the collection object Processor Queue Length.
- You can mouse over different data points on the report, and the report will display the queue length value at the time selected on the graph.
- The values for the Processor Queue Length label object are displayed in the graph key at the bottom of the page.
To learn more about performance reports,