Example: Creating a WMI Performance Dynamic Application

Download this manual as a PDF file

In this example, we will create a WMI Dynamic Application. Our Dynamic Application will collect the following information from a network interface running on a Windows computer: Total bytes, current bandwidth, name, packets per second, outbound errors, and received errors.

NOTE: This example Dynamic Application is included in the "Microsoft Base Pack" PowerPack, version 1.5 and later.

Defining the WMI Request

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 Actions button, and then select Create New Dynamic Application. The Dynamic Applications Create New Application page appears.

  • Supply values in the following fields:
  • Application Name. Enter Windows Interface in this field.
  • Application Type. Select WMI Performance.
  • Poll Frequency. Select Every 5 Minutes.

  • For this example, you can leave the remaining fields at their default value. Select the Save button to save the Dynamic Application.

Adding the WMI Request

In SL1, each WMI Dynamic Application must include at least one WMI or WBEM request.

WMI objects are populated when the Dynamic Application executes a WMI request. WMI requests use WQL (WMI Query Language) to query WMI classes (tables) to retrieve data. A single WMI request can populate multiple WMI objects by querying for multiple class properties (table columns).

WMI objects are aligned with properties (column). The definition of each object specifies the WMI request that will populate the object and the property name to align with the object. The retrieved values of the property will populate the object.

For more details on WMI requests, see the WMI Requests section.

To create the WMI request for this Dynamic Application:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • Select the wrench icon () for the Windows Interface Dynamic Application. The Dynamic Applications Properties Editor page appears.
  • Select the WMI Requests tab. The WMI Request Editor & Registry page appears.
  • Supply values in the following fields:
  • WMI Request Name. We named our WMI Request "Win32_PerfFormattedData_Tcpip_NetworkInterface"
  • WMI Request Type. Select WMI.
  • WMI Object Key. The unique key for each instance (row) returned by the request. This unique key must be a property (column) name, and the request must include that property (column) and return values from that property name (column).The selected property (column) must return the same values over all polling periods. The "Name" property (column) meets these criteria. Enter "Name" in this field.
  • Active State. Select Enabled.
  • WMI Request Query. This Dynamic Application is getting values from the Win32_PerfFormattedData_Tcpip_NetworkInterface class (table), and will collect the following values: Interface name, total bytes, current bandwidth, name, outbound errors, and received errors. We entered the following in the WMI Request Query:

Select Name,BytesTotalPerSec,PacketsPerSec,CurrentBandwidth,PacketsOutboundErrors,PacketsReceivedErrors From Win32_PerfFormattedData_Tcpip_NetworkInterface

  • Select the Save As button to save the WMI Request.

Adding the Collection Objects

Our example Dynamic Application has six collection objects:

  • Total Bytes per second
  • Current Bandwidth
  • Interface Name
  • Packets per second
  • Outbound errors
  • Received errors

To create these collection objects, perform the following steps:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • Select the wrench icon () for the Windows Interface Dynamic Application. The Dynamic Applications Properties Editor page appears.
  • Select the Collections tab. The Dynamic Applications | Collections Objects page appears.
  • To create the collection object for Total Bytes, supply values in the following fields:
  • Object Name. We named our collection object "Network Interface\Bytes Total/sec"
  • WMI Request Argument. In this field, you must specify the name of the property (table column) to associate with this object. Enter "BytesTotalPersec" in this field.
  • Class Type. Total bytes per second is a number that can go up or down between polls. Select 4 Performance Gauge in this field.
  • WMI Request. Name of the WMI request associated with this object. Select Win32_PerfFormattedData_Tcpip_NetworkInterface.
  • Group Number. Select Group 1. For performance Dynamic Applications, SL1 uses the Group Number setting to associate performance values with the appropriate labels. For the performance graph for this example to display labels correctly, all the collection objects must be in the same group.
  • 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 Save button.
  • Select the Reset button to clear the form fields.
  • To create the following Collection Objects for Current Bandwidth, Packets Per Second, Outbound Errors, and Received Errors collection objects, repeat step 4, using the following values in the WMI Request Argument field. These values match the properties defined in the WMI Request for this Dynamic Application.

Collection Object WMI Request Argument
Network Interface/Current Bandwidth

Current Bandwidth

Network Interface/Packets/sec

PacketsPerSec

Network Interface/Outbound Errors

PacketsOutbandErrors

Network Interface/Received Errors PacketsReceivedErrors

  • To create the Interface Name collection object, which will be the label for the performance report, supply the following values in the Dynamic Applications | Collections Objects page:
  • Object Name. We named this collection object "Network Interface\Name".
  • WMI Request Argument. In this field, you must specify the name of the property (table column) to associate with this object. Enter "Name" in this field.
  • Class Type. Select Label (Always Polled) in this field. In performance Dynamic Applications, collection objects that use this class type are string values that SL1 uses to label the lines on a performance graph.
  • WMI Request. Name of the WMI request associated with this object. Select Win32_PerfFormattedData_Tcpip_NetworkInterface.
  • Group Number. Select Group 1. For performance Dynamic Applications, SL1 uses the Group Number setting to associate performance values with the appropriate labels. For the performance graph for this example to display labels correctly, all the collection objects must be in the same group.
  • 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 Save button.

Creating the Presentation Objects

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 remove these presentation objects and create new presentation objects for each collection object defined above.

To create the presentation objects:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • Select the wrench icon () for the Windows Interface Dynamic Application.
  • Select the Presentations tab. The Dynamic Applications Presentation Objects page appears.
  • In the Dynamic Applications Presentation Objects page, each collection object created in the Adding the Collection Objects section has been created by default. Select each presentation object's delete icon () to delete them.
  • Select the Reset button. To create the presentation object that displays Total Bytes Per Second, enter values in the following fields:
  • Report Name. Enter "Bytes Total per Second" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Bytes/Second" into this field.
  • Abbreviation / Suffix. Enter "Bps" into this field.
  • Show as Percent. Select No. The graph will not display percent values.
  • 'Formula Editor. In this field, enter the object ID for the Total Bytes Per Second collection object, surrounded by parentheses.
  • For this example, you can leave the remaining fields set to their default values.
  • Select the Save button to save the presentation object.
  • Select the Reset button. For the Current Bandwidth presentation object, enter the following values in the Dynamic Applications Presentation Objects page:
  • Report Name. Enter "CurrentBandwidth" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Bytes per second" into this field.
  • Abbreviation / Suffix. Enter "Bps" into this field.
  • Show as Percent. Select No. The graph will not display percent values.
  • Vitals Link. Select Disabled.
  • Formula Editor. In this field, enter the object ID for the Current Bandwidth collection object, surrounded by parentheses.
  • For this example, you can leave the remaining fields set to their default values. Select the Save button to save the presentation object.
  • Select the Reset button. For the Interface Utilization presentation object, enter the following values in the Dynamic Applications Presentation Objects page:
  • Report Name. Enter "Interface Utilization" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Percent" into this field.
  • Abbreviation / Suffix. Enter "%" into this field.
  • Show as Percent. Select Yes. The graph will display percent values.
  • Formula Editor. In this field, enter the following formula:

((<object ID for Current Bandwidth> > 0) ? ((8 * <object ID for Bytes Total/sec>) / <object ID for Current Bandwidth>) : 0)

For example, if the object ID for Current Bandwidth is o_7034 and the object ID for Bytes Total/sec is o_7031, enter:

( (o_7034 > 0) ? ( (8 * o_7031) / o_7034) : 0)

This formula includes a collection object as a divisor. To prevent an error from occurring when the divisor returns zero, the formula includes a ternary operator that tests to see if the divisor is zero. If the divisor is zero, the formula returns zero. If the divisor is greater than zero, the formula converts the "Bytes Total/sec collection object in to Bits Total/sec, then divides the total bits/second by the speed of the interface.

  • For this example, you can leave the remaining fields set to their default values. Select the Save button to save the presentation object.
  • Select the Reset button. For the Packets Per Second presentation object, enter the following values in the Dynamic Applications Manager page:
  • Report Name. Enter "Packets per Second" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Packets/Second" into this field.
  • Abbreviation / Suffix. Enter "P/s" into this field.
  • Show as Percent. Select No. The graph will not display percent values.
  • Formula Editor. In this field, enter the object ID for the Packets Per Second collection object, surrounded by parentheses.
  • For this example, you can leave the remaining fields set to their default values. Select the Save button to save the presentation object.
  • Select the Reset button. For the Outbound Errors presentation object, enter the following values in the Dynamic Applications Manager page:
  • Report Name. Enter "PacketsOutboundErrors" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Errors" into this field.
  • Abbreviation / Suffix. Enter "Errors" into this field.
  • Show as Percent. Select No. The graph will not display percent values.
  • Formula Editor. In this field, enter the object ID for the Outbound Errors collection object, surrounded by parentheses.
  • For this example, you can leave the remaining fields set to their default values. Select the Save button to save the presentation object.
  • Select the Reset button. For the Inbound Errors presentation object, enter the following values in the Dynamic Applications Manager page:
  • Report Name. Enter "PacketsInboundErrors" in this field.
  • Active State. Select Enabled. SL1 will generate a report of the presentation object.
  • Data Unit. Enter "Errors" into this field.
  • Abbreviation / Suffix. Enter "Errors" into this field.
  • Show as Percent. Select No. The graph will not display percent values.
  • Formula Editor. In this field, enter the object ID for the Inbound Errors collection object, surrounded by parentheses.
  • For this example, you can leave the remaining fields set to their default values. Select the Save button to save the presentation object.

Creating a Credential

To use the Windows Interface Dynamic Application, we must include a Basic/Snippet credential. To create the Basic/Snippet credential:

  • Go to the Credential Management page (System > Manage > Credentials).
  • Select the Create button, and then select Basic/Snippet Credential. The Create New Basic/Snippet Credential page appears.
  • Define values in the following fields:
  • Credential Name. Enter "Windows Interface WMI" in this field.
  • 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.
  • Port. Enter "1521" in this field. This is the default port for WMI.
  • Timeout. Enter "5000" in this field. SL1 will stop trying to communicate with the authenticating server after 5000 seconds.
  • Username. Enter the username for a user account in this field that will provide access to the monitored Windows device.
  • Password. Enter a password for a user account that will provide access to the monitored Windows device
  • Select the Save 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 running WMI. By manually aligning the Dynamic Application to a device, we can immediately view the interface data in the presentation objects 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 the Dynamic Application to. In this example, we are aligning the Dynamic Application to a Windows device running WMI. Select the device's wrench icon ().
  • The Device Properties page appears. Select the Collections tab.
  • In the Dynamic Application Collections page, select the Action button and select Add Dynamic Application. The Dynamic Application Alignment page appears.
  • Select the Windows Interface Dynamic Application in the Dynamic Applications pane, and select Windows Interface WMI in the Credentials pane.
  • Select the Save button to add the Dynamic Application.

Viewing the Performance Reports

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 Windows Interface Dynamic Application aligned to it:

  • From the Dynamic Application Collections page, select the Reset button to update the page with the latest information.
  • Locate the Windows Interface 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 Windows Interface Dynamic Application to. Select the device's graph icon ().
  • The Device Summary page appears. Select the Performance tab.
  • In the left NavBar, select any of the presentation objects you created in the section Creating the Presentation Objects. In this example, we selected Bytes Total per Second.
  • The Windows Interface | Bytes Total per Second report is displayed.
  • The report displays the collected values from the collection object Network Interface\Bytes Total/sec.
  • You can mouse over different data points on the report, and the report will display the total bytes moving through the interface at the time selected on the graph.
  • The amount of bytes is shown to the left of the report.
  • The values for each label object are displayed in the graph key at the bottom of the page.