Dynamic Component Mapping & Caching with XSLT

Download this manual as a PDF file

The following sample describes the development of three XSLT Dynamic Applications. The Dynamic Applications in this example demonstrate:

  • How to create Dynamic Applications to discover component devices using Dynamic Component Mapping.
  • How to use caching to associate performance data with component devices.

The Dynamic Applications in this example collect component device information from a hypothetical management system. For simplicity, the management system used in this example does not require some features that would typically be used in XSLT Dynamic Applications:

  • The management system reports all the necessary data in a single static XML document. This allows the Dynamic Applications to make only one request.
  • The management system returns the XML document in response to a GET request. This means that the Dynamic Applications do not require XSLT Request code. This simplification also means you can try the Dynamic Applications described in this example by configuring a Web Server to act as the management system.

The XML document returned by the management system looks like this:

<xml>

<component>

<name>component-one</name>

<id>00001</id>

<cpu>80</cpu>

<memory>80</memory>

</component>

<component>

<name>component-two</name>

<id>00002</id>

<cpu>60</cpu>

<memory>60</memory>

</component>

<component>

<name>component-three</name>

<id>00003</id>

<cpu>70</cpu>

<memory>70</memory>

</component>

<component>

<name>component-four</name>

<id>00004</id>

<cpu>55</cpu>

<memory>55</memory>

</component>

<component>

<name>component-five</name>

<id>00005</id>

<cpu>20</cpu>

<memory>20</memory>

</component>

</xml>

Using this XML document, the Dynamic Applications in this example:

  • Cache the returned XML document, so that the Dynamic Applications must make only a single request to the management system during a polling period.
  • Retrieves the name and id values for each component to model each component as a separate device in SL1.
  • Use the cpu and memory values to create performance graphs for each component device. The Dynamic Application that collects the CPU and Memory data will be aligned with each component device separately; the performance graph for each component device will show the CPU and Memory statistics for that component device only.

Because the XML document used in this example is static, the values on the CPU and Memory graphs for each component device will be constant.

Design

This example uses three Dynamic Applications:

  • Example Dynamic Component Mapping General. This Dynamic Application:
    • Requests and caches the XML page from the management system.
    • Contains a discovery object so that SL1 can automatically align the Dynamic Application with the management system during discovery.
    • Contains no other collection objects. Remember that a Dynamic Application that caches responses cannot include collection objects that need to be collected at regular intervals.

  • Example Dynamic Component Mapping Discovery. This Dynamic Application:
    • Contains a discovery object so that SL1 can automatically align the Dynamic Application with the management system during discovery.
    • Uses the cached response collected by the Example Dynamic Component Mapping General Dynamic Application to collect the Name and ID values from the XML document.
    • Uses the Name and ID values to model the component devices. The Name value populates the Device Name component identifier, and the ID value populates the Unique Identifier component identifier.
    • Is associated with a Device Class. SL1 assigns that device class to each component device that is created.
    • Automatically aligns the Example Component Performance Dynamic Application to each component device that is created.

    The Example Dynamic Component Mapping Discovery meets the minimum requirements for creating component devices by including a Device Name component identifier, a Unique Identifier component identifier, and an associated device class.

  • Example Component Performance. This Dynamic Application:
    • Is automatically aligned to component devices by the Example Dynamic Component Mapping Discovery Dynamic Application.
    • Uses the cached response collected by the Example Dynamic Component Mapping General Dynamic Application to collect the CPU and Memory values from the XML document.
    • The XSLT Parser Code specified in this Dynamic Application uses the %U substitution (the Unique Identifier component identifier) to collect only the CPU and Memory values that are associated with the current component device.
    • Contains Presentation Objects to display the collected CPU and Memory values in a graph.

Creating the "Example Dynamic Component Mapping General" Dynamic Application

Defining the Dynamic Application Properties

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, then select Create New Dynamic Application. The Dynamic Applications Create New Application page appears.
  • Supply values in the following fields:
    • Application Name. Enter "Example Dynamic Component Mapping General" in this field.
    • Application Type. This example uses the XSLT protocol. Dynamic Applications of type Performance must include a presentation object to work correctly. Because this Dynamic Application does not include collection objects that can be used in a presentation object, this Dynamic Application is of type Configuration. Select XSLT Config [17] in this field.
    • Poll Frequency. To see data as quickly as possible, select Every 1 Minute in this field.
    • Caching. This Dynamic Application must cache the response from the management system. Select Cache Results in this field.
    • Component Mapping. This Dynamic Application does not include collection objects that are used to create component devices. Leave this checkbox unchecked.
  1. For this example, you can leave the remaining fields set to the default values.
  2. Select the Save button.

Adding the XSLT Request

The XSLT request in this Dynamic Application retrieves the XML document from the management system. The retrieved XML document is cached for use by the other Dynamic Applications in this example.

The XSLT request in this Dynamic Application contains XSLT Parser Code that transforms the XML document to collect the discovery object for this Dynamic Application. The XSLT Parser code applies only to this Dynamic Application. The other Dynamic Applications in this example contain different XSLT Parser code that will perform different transformations on the cached XML document.

To create the XSLT request for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Dynamic Component Mapping General Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Requests tab. The Dynamic Applications Request Editor and Registry page appears.
  4. Supply values in the following fields:
    • Request Name. Enter "Get Full Document" in this field.
    • Execution Sequence. This Dynamic Application contains only one XSLT request. Select 0 in this field.
    • Active State. This XSLT request must be executed to collect data. Select Enabled in this field.
    • XSLT Request Code. Because SL1 performs an HTTP GET request to retrieve the XML document from the management system, we are not required to generate an XML document to POST to the management system. However, SL1 still performs a transformation using the XSLT Request Code before performing the request. Therefore, the XSLT Request Code used in this example performs a transformation that outputs a blank XML document. Enter the following code in this field:
    • <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

      </xsl:stylesheet>

    • XSLT Parser Code. The discovery object in this Dynamic Application determines whether the returned XML document contains at least one "<component>" element that contains a value for the "<name>" element. Therefore, the XSLT Parser Code must transform the returned XML document into an XML document with the following structure:
    • <response>

      <row>

      <name>name value</name>

      </row>

      </response>

      The XSLT Parser Code uses a single xsl:value-of element to select the first component name that appears in the returned XML document. The component name is inserted inside the required structure. Enter the following code in this field:

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

      <xsl:template match="/">

      <response>

      <row>

      <name>

      <xsl:value-of select="xml/component/name"/>

      </name>

      </row>

      </response>

      </xsl:template>

      </xsl:stylesheet>

  1. Select the Save button.

Adding the Discovery Object

This Dynamic Application includes one discovery object that tells SL1 to automatically align the Dynamic Application to the management system. Because a Dynamic Application that caches responses cannot include collection objects that need to be collected at regular intervals, there are no other collection objects in this Dynamic Application. The discovery object in this Dynamic Application will determine whether the returned XML document contains at least one "<component>" element that contains a value for the "<name>" element.

To create the discovery object for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Dynamic Component Mapping Discovery Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Collections tab. The Dynamic Applications | Collections Objects page appears.
  1. Supply values in the following fields:
    • Object Name. Enter "Discovery" in this field.
    • XSLT Tags. The value you enter in this field must correspond with the name of an XML tag in the transformed response. Enter "name" in this field. The XSLT Request that you defined in the previous section returns the following transformed response:
    • <response>

      <row>

      <name></name>

      </row>

      </response>

      This discovery object looks for the presence of a component name in the transformed response.

    • Class Type. Select 100 Discovery in this field. This specifies that the object is a discovery object.
    • XSLT Request. Select the Get Full Document request you created in the previous section.
  2. For this example, you can leave the remaining fields set to the default values.
  3. Select the Save button. After you save the discovery object, the form will change to show additional fields that apply only to discovery objects. These additional fields are not used by this example.

Creating the "Example Dynamic Component Mapping Discovery" Dynamic Application

Defining the Dynamic Application Properties

To create the Dynamic Application and define the general properties for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the Actions button, then select Create New Dynamic Application. The Dynamic Applications Create New Application page appears.
  3. Supply values in the following fields:
    • Application Name. Enter "Example Dynamic Component Mapping Discovery" in this field.
    • Application Type. This example uses the XSLT protocol. The data collected by this Dynamic Application, the component name and ID, are best displayed in tabular format, so this example uses the Configuration type. Select XSLT Config [17] in this field.
    • Poll Frequency. To see data as quickly as possible, select Every 1 Minute in this field.
    • Caching. This Dynamic Application uses the XML document collected by the Example Dynamic Component Mapping General Dynamic Application. Select Consume Cached Results in this field.
    • Component Mapping. This Dynamic Application contains collection objects that SL1 will use to create component devices. Check this checkbox.
  4. For this example, you can leave the remaining fields set to the default values.
  5. Select the Save button.

Adding the XSLT Requests

This Dynamic Application includes two XSLT requests. Each XSLT request contains XSLT Parser Code that transforms the XML document cached by the Example Dynamic Component Mapping General Dynamic Application. The transformed XML document contains:

  • For the first request, the discovery object for this Dynamic Application. The discovery object in this Dynamic Application is the same as the discovery object in the Example Dynamic Component Mapping General Dynamic Application.
  • For the second request, the component name and ID values that SL1 uses to create the component devices.

To create the XSLT requests for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Dynamic Component Mapping Discovery Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Requests tab. The Dynamic Applications Request Editor and Registry page appears.
  4. To create the first request, supply values in the following fields:
    • Request Name. Enter "Discovery" in this field. This request returns the XML document that contains the discovery object for this Dynamic Application.
    • Execution Sequence. This Dynamic Application does not require SL1 to execute the XSLT requests in a specific order; however, the two requests must have unique values for this field. Select 0 in this field.
    • Active State. This XSLT request must be executed to collect data. Select Enabled in this field.
    • Cached XSLT Request. This field specifies the cached XML document to transform. Locate the Example Dynamic Component Mapping Discovery Dynamic Application and select Get Full Document from this list.
    • XSLT Parser Code. This Dynamic Application uses the same discovery object as is used in the Example Dynamic Component Mapping General Dynamic Application. Therefore, this request uses the same XSLT Parser Code as the request in the Example Dynamic Component Mapping General Dynamic Application. Enter the following code in this field:
    • <?xml version="1.0" encoding="ISO-8859-1"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

      <xsl:template match="/">

      <response>

      <row>

      <name>

      <xsl:value-of select="xml/component/name"/>

      </name>

      </row>

      </response>

      </xsl:template>

      </xsl:stylesheet>

  5. Select the Save button.
  6. Select the Reset button to clear the form fields.
  7. To create the second request, supply values in the following fields:
    • Request Name. Enter "Get Components" in this field. This request will return the XML document that contains the name and ID values for the component devices.
    • Execution Sequence. This Dynamic Application does not require SL1 to execute the XSLT requests in a specific order; however, the two requests must have unique values for this field. Select 1 in this field.
    • Active State. This XSLT request must be executed to collect data. Select Enabled in this field.
    • Cached XSLT Request. This field specifies the cached XML document to transform. Locate the Example Dynamic Component Mapping Discovery Dynamic Application and select Get Full Document from this list.
    • XSLT Parser Code. Two collection objects will be parsed from the output of this XSLT request: the component name and the component ID. The XML document returned by the management system might contain information about multiple component devices, so both the name and ID collection objects might be a list of values. The association of component name to component ID must be maintained for each pair of values, that is, they must reside in the same row in the transformed XML document. Therefore, the XSLT Parser Code must transform the returned XML document into an XML document with the following structure:
    • <response>

      <row>

      <name>name value for the first component device in the response</name>

      <id>ID value for the first component device in the response</id>

      </row>

      <row>

      <name>name value for the second component device in the response</name>

      <id>ID value for the second component device in the response</id>

      </row>

      .

      .

      .

      <row>

      <name>name value for the last component device in the response</name>

      <id>ID value for the first component device in the response</id>

      </row>

      </response>

      The XSLT Parser Code uses an xsl:for-each element to iterate through the component devices in the returned XML document, creating a <row> block for each component device. The component name and ID values are inserted inside the required structure. Enter the following code in this field:

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

      <xsl:template match="/">

      <response>

      <xsl:for-each select="xml/component">

      <row>

      <xsl:element name="name">

      <xsl:value-of select="name"/>

      </xsl:element>

      <xsl:element name="id">

      <xsl:value-of select="id"/>

      </xsl:element>

      </row>

      </xsl:for-each>

      </response>

      </xsl:template>

      </xsl:stylesheet>

  8. Select the Save button.

Adding the Collection Objects

This Dynamic Application includes a discovery object that tells SL1 to automatically align the Dynamic Application to the management system. The discovery object in this Dynamic Application determines whether the returned XML document contains at least one "<component>" element that contains a value for the "<name>" element.

To create a component device, a Dynamic Component Mapping Dynamic Application must:

  • Collect an object that maps to the Unique Identifier component identifier. This Dynamic Application includes a collection object that parses the component ID from the XML document. The component ID maps to the Unique Identifier.
  • Collect an object that maps to the Device Name component identifier. This Dynamic Application includes a collection object that parses the component name from the XML document. The component name maps to the Device Name.
  • Be associated with a component device class. The device class for this Dynamic Application is described in the Creating a Device Class for the Component Devices section.

To create the collection objects for this Dynamic Application, perform the following steps:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • Select the wrench icon () for the Example Dynamic Component Mapping Discovery Dynamic Application. The Dynamic Applications Properties Editor page appears.
  • Select the Collections tab. The Dynamic Applications | Collections Objects page appears.
  • To create the discovery object, supply values in the following fields:
    • Object Name. Enter "Discovery" in this field.
    • XSLT Tags. The value you enter in this field must correspond with the name of an XML tag in the transformed response. Enter "name" in this field. The "Discovery" XSLT Request you defined in the previous section returns the following transformed response:
    • <response>

      <row>

      <name></name>

      </row>

      </response>

      This discovery object should look for the presence of a component name in the transformed response.

    • Class Type. Select 100 Discovery in this field. This specifies that the object is a discovery object.
    • XSLT Request. Select the Discovery request you created in the previous section.
  • For this example, you can leave the remaining fields set to the default values.
  • Select the Reset button to clear the form fields.
  • To create the collection object for the component ID, supply values in the following fields:
    • Object Name. Enter "Component ID" in this field.
    • XSLT Tags. Enter "id" in this field. The "Get Components" XSLT Request you defined in the previous section returns the following <row> block for each component device:
    • <row>

      <name></name>

      <id></id>

      </row>

      This collection object parses the component ID from each <row> block.

    • Class Type. Select 10 Config Character in this field. To maintain the leading zeroes in the collected component ID values, the ID is stored as a string.
    • Group Number. To maintain the association between the collected component ID and component name values, you must ensure that SL1 uses the same internal indexes for each list. SL1 maintains internal indexes for each group of collection objects. Therefore, the component ID and component name collection objects must be in the same group for SL1 to use the same internal index for both collection objects. Select Group 1 in this field.
    • Index. By default, SL1 assigns internal indexes to the list of collected values based on the order in which they appear in the response. Suppose that "component-four" is disabled on the management system. Suppose that when "component-four" is disabled, it no longer appears in the XML response from the management system. When "component-four" appeared in the XML response, the following internal indexes would have been assigned:
      • Index 0 = component-one
      • Index 1 = component-two
      • Index 2 = component-three
      • Index 3 = component-four
      • Index 4 = component-five

      When "component-four" is disabled, it no longer appears in the XML response from the management system. During the next poll period, the index for "component-five" will change:

      • Index 0 = component-one
      • Index 1 = component-two
      • Index 2 = component-three
      • Index 3 = component-five

      In cases where the order or size of the list of values might change, you must designate a collection object as an index. This example designates the component ID collection object as the index. The collection object that is designated as an index must meet the following requirements:

      • The list of values returned by the collection object must be unique. In this example, the component ID is unique.
      • If a previously collected value in the list of values appears in a new list of collected values, that collected value is associated with the same set of values. In this example, a set of values is a component ID/component name pair. When a previously collected component ID is collected again, it is always associated with the same component name; therefore, the component ID can be used as the index.

      Select the Index checkbox.

    • XSLT Request. Select the Get Components request you created in the previous section.
    • Component Identifiers. Each value collected for this collection object will be used as the unique identifier for a component device. Select Unique Identifier (%U) in this field.
  • For this example, you can leave the remaining fields set to the default values.
  • Select the Save button.
  • Select the Reset button to clear the form fields.
  • To create the collection object for the component name, supply values in the following fields:
    • Object Name. Enter "Component Name" in this field.
    • XSLT Tags. Enter "name" in this field. The "Get Components" XSLT Request you defined in the previous section returns the following <row> block for each component device:
    • <row>

      <name></name>

      <id></id>

      </row>

      This collection object parses the component name from each <row> block.

    • Class Type. Select 10 Config Character in this field. The component name is a string.
    • Group Number. To maintain the association between the collected values for component ID and component name, you must ensure that SL1 uses the same internal indexes for each list. SL1 maintains internal indexes for each group of collection object. Therefore, the component ID and component name collection objects must be in the same group for SL1 to use the same internal index for both collection objects. Select Group 1 in this field.
    • Index. Leave this checkbox unchecked. The collection object for the component ID has already been designated as the index for this group of collection objects.
    • XSLT Request. Select the Get Components request you created in the previous section.
    • Component Identifiers. Each value collected for this collection object will be used as the device name of a component devices. Select Device Name (%N) in this field.
  • For this example, you can leave the remaining fields set to the default values.
  • Select the Save button.

Creating a Device Class for the Component Devices

For SL1 to create a component device, the Dynamic Component Mapping Dynamic Application must include collection objects that map to the Device Name and Unique Identifier component identifiers. In addition, the same Dynamic Application must be associated with a component Device Class. When you associated a component Device Class with a Dynamic Application, you are telling SL1 to assign that device class to each component device that is created by the Dynamic Application.

To create a device class that is associated with the Example Dynamic Component Mapping Discovery Dynamic Application, perform the following steps:

  1. Go to the Device Class Editor page (System > Customize > Device Classes).
  2. In the Device Class Editor pane at the top of the page, supply values in the following fields:
    • Device Type. This device class will be assigned to component devices. Select Component in this field.
    • Root Device. The component devices in this example will not act as root devices. Leave this checkbox unchecked.
    • Device Class. Enter "Example" in this field.
    • Description. Enter "Component Device" in this field.
    • Dynamic App Alignment. Select Example Dynamic Component Mapping Discovery in this field.
  3. Select the Save button.

Creating the "Example Component Performance" Dynamic Application

Defining the Dynamic Application Properties

To create the Dynamic Application and define the general properties for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the Actions button, then select Create New Dynamic Application. The Dynamic Applications Create New Application page appears.
  3. Supply values in the following fields:
    • Application Name. Enter "Example Component Performance" in this field.
    • Application Type. This example uses the XSLT protocol. The data collected by this Dynamic Application will be displayed in a graph, so this example uses the Performance archetype. Select XSLT Performance in this field.
    • Poll Frequency. To see data as quickly as possible, select Every 1 Minute in this field.
    • Caching. This Dynamic Application will use the XML document collected by the Example Dynamic Component Mapping General Dynamic Application. Select Consume Cached Results in this field.
    • Component Mapping. Although this Dynamic Application will be aligned with component devices, this Dynamic Application does not include collection objects that are used to create component devices. Leave this checkbox unchecked.
  4. For this example, you can leave the remaining fields set to the default values.
  5. Select the Save button.

Adding the XSLT Request

This Dynamic Application includes one XSLT request. The XSLT request will contain XSLT Parser Code that transforms the XML document cached by the Example Dynamic Component Mapping General Dynamic Application. The transformed response will return the CPU and memory utilization values for the component device.

The XSLT request uses the "%U" substitution character to filter the cached XML document. Before performing the transformation, SL1 will replace "%U" with the unique identifier of the component device for which data is currently being collected. By filtering the cached XML document using the unique identifier, the transformed response will contain the CPU and Memory utilization only for the component device for which data is currently being collected.

This Dynamic Application will be aligned with each of the five component devices in this example. Therefore, during each poll, the transformation will be performed five times, resulting in five different sets of CPU and memory utilization data (one set for each component device).

To create the XSLT request for this Dynamic Application, perform the following steps:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • Select the wrench icon () for the Example Component Performance Dynamic Application. The Dynamic Applications Properties Editor page appears.
  • Select the Requests tab. The Dynamic Applications Request Editor and Registry page appears.
  • Supply values in the following fields:
    • Request Name. Enter "Get CPU+Memory" in this field. This request will return the XML document that contains the CPU and memory utilization values for the component devices.
    • Execution Sequence. This Dynamic Application will contain only one XSLT request. Select 0 in this field.
    • Active State. This XSLT request must be executed to collect data. Select Enabled in this field.
    • Cached XSLT Request. This field specifies the cached XML document to transform. Locate the Example Dynamic Component Mapping Discovery Dynamic Application and select Get Full Document from this list.
    • XSLT Parser Code. Two collection objects will be parsed from the output from this XSLT request: the CPU utilization and the memory utilization. The transformed response must include the set of CPU and memory utilization values only for the component device for which data is currently being collected. Therefore, the XSLT Parser Code must transform the returned XML document into an XML document with the following structure:
    • <response>

      <row>

      <cpu>CPU utilization value</cpu>

      <memory>Memory utilization value</memory>

      </row>

      </response>

      The XSLT Parser Code uses an xsl:for-each element to iterate through the component devices in the returned XML document. On each iteration, an xsl:if element is used to determine whether the ID value in the XML document matches the component ID value of the component device for which data is currently being collected (the "%U" substitution). If the ID values match, the <row> block is created using the CPU and memory values that appear in the XML document. Enter the following code in this field:

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

      <xsl:template match="/">

      <response>

      <xsl:for-each select="xml/component">

      <xsl:if test="id = '%U'">

      <row>

      <xsl:element name="cpu">

      <xsl:value-of select="cpu"/>

      </xsl:element>

      <xsl:element name="memory">

      <xsl:value-of select="memory"/>

      </xsl:element>

      </row>

      </xsl:if>

      </xsl:for-each>

      </response>

      </xsl:template>

      </xsl:stylesheet>

  1. Select the Save button.

Adding the Collection Objects

This Dynamic Application contains one collection object for the CPU utilization value and one collection object for the memory utilization value. To create the collection objects for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Component Performance Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Collections tab. The Dynamic Applications | Collections Objects page appears.
  4. To create the collection object for the CPU utilization, supply values in the following fields:
    • Object Name. Enter "CPU Usage" in this field.
    • XSLT Tags. Enter "cpu" in this field. The "Get CPU+Memory" XSLT Request you defined in the previous section returns the following XML structure:
    • <row>

      <cpu></cpu>

      <memory></memory>

      </row>

      This collection object parses the CPU utilization from the transformed response.

    • Class Type. The CPU utilization is a number that can go up or down between polls. Select 4 Performance Gauge in this field.
    • XSLT Request. Select the Get CPU+Memory request you created in the previous section.
  5. For this example, you can leave the remaining fields set to the default values.
  6. Select the Save button.
  7. Select the Reset button to clear the form fields.
  8. To create the collection object for the memory utilization, supply values in the following fields:
    • Object Name. Enter "Memory Usage" in this field.
    • XSLT Tags. Enter "memory" in this field. The "Get CPU+Memory" XSLT Request you defined in the previous section returns the following XML structure:
    • <row>

      <cpu></cpu>

      <memory></memory>

      </row>

      This collection object parses the memory utilization from the transformed response.

    • Class Type. The memory utilization is a number that can go up or down between polls. Select 4 Performance Gauge in this field.
    • XSLT Request. Select the Get CPU+Memory request you created in the previous section.
  9. For this example, you can leave the remaining fields set to the default values.
  10. Select the Save button.

Editing 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. This example makes some minor changes to the presentation objects that were automatically created. To edit the presentation objects for this Dynamic Application, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Component Performance Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Presentations tab. The Dynamic Applications Presentation Objects page appears.
  4. Select the wrench icon for the CPU Usage presentation object. Edit the following fields:
    • Active State. Select Enabled in this field.
    • Show as Percent. The CPU utilization values are reported as percentage used. Select Yes in this field.
  5. For this example, you can leave the remaining fields set to the default values.
  6. Select the wrench icon for the Memory Usage presentation object. Edit the following fields:
    • Active State. Select Enabled in this field.
    • Show as Percent. The memory utilization values are reported as percentage used. Select Yes in this field.
  7. For this example, you can leave the remaining fields set to the default values.
  8. Select the Save button.

Automatically Aligning the Dynamic Application to Component Devices

When SL1 creates component devices using data collected by a Dynamic Application, SL1 can automatically align other Dynamic Applications to those component devices as they are created. In this example, the Example Component Performance Dynamic Application should be aligned to the component devices created by the Example Dynamic Component Mapping Discovery Dynamic Application.

The Example Component Performance Dynamic Application does not include a discovery object. Instead of a discovery object, we explicitly tell SL1 to automatically align the Example Component Performance Dynamic Application with each component device that is created with the Example Dynamic Component Mapping Discovery Dynamic Application.

To do this, perform the following steps:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. Select the wrench icon () for the Example Dynamic Component Mapping Discovery Dynamic Application. The Dynamic Applications Properties Editor page appears.
  3. Select the Component tab. The Dynamic App Component Alignment modal page appears:
  4. Select the Example Component Performance Dynamic Application from the Unaligned Dynamic Apps list.
  5. Select the >> button. The Example Component Performance Dynamic Application moves to the Aligned Dynamic Apps list.
  6. Select the Save button.
  7. SL1 will automatically align the Example Component Performance Dynamic Application with each component device created by the Example Dynamic Component Mapping Discovery Dynamic Application.

Using the Dynamic Applications

Configuring a Test Device

To test the Dynamic Applications in this example, you must configure a web server to act as the management system. The web server must:

  • Return the XML document listed in the Overview section in response to a GET request.
  • Be discoverable by SL1 as an SNMP device or a Non-SNMP device.

This example uses an Administration Portal as the web server. The root directory for an Administration Portal is:

/usr/local/silo/gui/ap/www/

For this example:

  • A directory called "xml" was created in the root directory of the Administration Portal.
  • A file called "components.xml", which contains the XML listed in the Overview section, was created in the "xml" directory.
  • The permissions on the "xml" directory and the "components.xml" file were changed to 755.

Editing the Device Class for the Test Device

You must edit the device class that SL1 will assign to the device that hosts the web server. The device class for the test device must be enabled as a root device. A root device is a device for which SL1 can create children component devices. Perform the following steps to enable the device class as a root device:

  • Go to the Device Class Editor page (System > Customize > Device Classes).
  • In the Device Class Register at the bottom of the page, locate the device class that SL1 will assign to the device that hosts the web server. In our example, the device that hosts the web server will be assigned the device class with the description "EM7 G3 Admin Portal". Select the wrench icon () for the device class.
  • Check the Root Device checkbox.
  • Select the Save button.

Creating a Credential

For SL1 to align the Dynamic Applications in this example to the device that hosts the web server, we must include a SOAP/XML credential in the discovery session. SL1 will use the SOAP/XML credential to collect the XML document from the web server. To create the credential for this example:

  1. Go to the Credential Management page (System > Manage > Credentials).
  2. Select the Create button, and then select SOAP/XML Host Credential from the drop-down list. The Create New CURL/SOAP Credential page is displayed:
  3. Supply values in the following fields:
    • Profile Name. Enter "Components XML".
    • Method. Select GET in this field.
    • URL. Enter the URL of the XML document on the web server. Use the "%D" substitution character to supply the IP address of the test device. This example uses the URL "http://%D/xml/components.xml".
  4. For this example, you can leave the remaining fields set to the default values.
  5. Select the Save button.

Discovering the Test Device

To discover the device that hosts the web server:

  • Go to the Discovery Control Panel page (System > Manage > Classic Discovery).
  • Select the Create button. The Discovery Session Editor page is displayed in a new window:
  • Supply values in the following fields:
    • IP Address Discovery List. Enter the IP address of your device.
  • SNMP Credentials. If your device responds to SNMP, select the appropriate SNMP credential in this field.
  • Other Credentials. Select the Components XML credential you created in the previous section.
  • Initial Scan Level. Select at least 1. Initial Population of Apps in this field.
  • Discover Non-SNMP. If your device does not respond to SNMP, check this checkbox.
  1. For this example, you can leave the remaining fields set to the default values.
  2. Select the Save button.
  3. In the Discovery Control Panel page, select the Reset button. The discovery session you created will appear in the list of discovery sessions.

  1. Select the lightning bolt icon () for the discovery session you created to run the discovery session. The Discovery Session log will appear.

Verifying the Dynamic Application Alignments

To verify that the discovery process aligned the appropriate Dynamic Applications to the test device and that SL1 has created the component devices, perform the following steps:

  1. Go to the Device Manager page (Registry > Devices > Device Manager).
  2. Select the wrench icon () for the device that hosts the web server. The Device Properties page is displayed in a new window.
  3. Select the Logs tab. The Device Logs & Messages page is displayed.
  4. Enter "Component" in the search bar and select the Search button. The search results should show:
    • The Example Dynamic Component Mapping General and Example Dynamic Component Mapping Discovery Dynamic Applications were aligned to the device during discovery.
    • That SL1 created child component devices. The logs will contain one message for each component device that SL1 created.

Viewing the Device Components Registry

The Device Components page (Registry > Devices > Device Components) displays a list of all root devices and component devices discovered by SL1. The Device Components page is similar to the Device Manager page (Registry > Devices > Device Manager) page. The Device Components page displays all root devices and component devices in an indented view, so you can easily view the hierarchy and relationships between child devices, parent devices, and root devices. You can expand or hide the child devices for each root device and for each parent device.

To view the device that hosts the web server and its child component devices in the Device Components page:

  • Go to the Device Components page (Registry > Devices > Device Components).
  • Select the plus icon (+) for the device that hosts the web server. The list is expanded to show the component devices.

Viewing the Component Device Map

The Component Map page allows you to view root devices and their children component devices in a graphical map. To view the test device and the child component devices in the Component Map page:

  1. Go to the Component Map page (Classic Maps > Device Maps > Components).
  2. If there are multiple root devices discovered in your SL1 system, select the appropriate device from the drop-down list in the upper right of the page. A map of the device that hosts the web server and the child component devices is displayed.

Viewing the Performance Graphs

To view the performance graphs generated by the Example Component Performance Dynamic Application:

  1. Go to the Device Manager page (Registry > Devices > Device Manager).
  2. Select the graph icon () for one of the component devices. The Device Summary page is displayed in a new window.
  3. Select the Performance tab. In the NavBar to the left of the page, select Example Component Performance > CPU Usage. The CPU Usage graph is displayed. Because the XSLT request in this Dynamic Application filtered the returned XML document by component ID, the graph displays only the CPU data for this component.

Expanding this Example

If you would like to create additional Dynamic Component Mapping Dynamic Applications, here are some suggestions for ways you could try modifying this example:

  • Although the caching feature and the Dynamic Component Mapping feature are typically used together, you are not required to do so. Try combining the Example Dynamic Component Mapping General and Example Dynamic Component Mapping Discovery Dynamic Applications in to a single Dynamic Application that does not use the caching feature but still creates component devices. Use the XSLT Request Code from the Example Dynamic Component Mapping General Dynamic Application to create the XSLT requests for your combined Dynamic Application.
  • Modify the Example Component Performance Dynamic Application so that it does not use caching. Again, use the XSLT Request Code from the Example Dynamic Component Mapping General Dynamic Application to create the XSLT requests for the new Dynamic Application. For your new Dynamic Application to collect data, you must manually align a credential that uses the "%D" substitution in the URL field. When a credential that uses "%D" in the URL field is used with a component device, SL1 will substitute the IP address of the root device in to the URL.
  • Modify the XML document on the test device to include additional layers in the component tree, i.e. include additional components that are children of the existing components. Create an additional Dynamic Application that creates component devices as children of the existing component devices. You can then add your new Dynamic Application to the list of Dynamic Applications that SL1 should automatically align to each component device created by the Example Dynamic Component Mapping Discovery Dynamic Application. The modified XML document might look like this:
  • <xml>

    <component>

    <name>component-one</name>

    <id>00001</id>

    <cpu>80</cpu>

    <memory>80</memory>

    <sub_component>

    <name>sub-component-one</name>

    <id>10001</id>

    </sub_component>

    <sub_component>

    <name>sub-component-two</name>

    <id>10002</id>

    </sub_component>

    </component>

    <component>

    <name>component-two</name>

    <id>00002</id>

    <cpu>60</cpu>

    <memory>60</memory>

    <sub_component>

    <name>sub-component-three</name>

    <id>10003</id>

    </sub_component>

    </component>

    <component>

    <name>component-three</name>

    <id>00003</id>

    <cpu>70</cpu>

    <memory>70</memory>

    <sub_component>

    <name>sub-component-four</name>

    <id>10004</id>

    </sub_component>

    <sub_component>

    <name>sub-component-five</name>

    <id>10005</id>

    </sub_component>

    <sub_component>

    <name>sub-component-six</name>

    <id>10006</id>

    </sub_component>

    </component>

    <component>

    <name>component-four</name>

    <id>00004</id>

    <cpu>55</cpu>

    <memory>55</memory>

    </component>

    <component>

    <name>component-five</name>

    <id>00005</id>

    <cpu>20</cpu>

    <memory>20</memory>

    <sub_component>

    <name>sub-component-six</name>

    <id>10006</id>

    </sub_component>

    <sub_component>

    <name>sub-component-seven</name>

    <id>10007</id>

    </sub_component>

    </component>

    </xml>