ITM v6.x Situation Event Reports: Part 2

by Nick Lansdowne

Part 1 of this article discussed the basics of historical data collection and reporting for ITM situation events. However, all reports demonstrated were static. This tip will explore the use of Link Symbols to facilitate dynamic reports, where the data is filtered dependent on the user selection.

What is a Link Symbol?

A link symbol is a variable that is assigned a value when an ITM TEP user selects a link. The value assigned to the link symbol is context sensitive, i.e. is dependent on where the link is activated from. For example, links can be embedded into the bars within a bar chart. On selecting such a link, the values assigned to the link symbols are substitued into the queries in the target worskpace, filtering the data returned by the query, and hence filtering the data displayed within the views.

How is a Link Symbol Created?

A link symbol is actually defined within a query, and is an alpha-numeric string starting and finishing with the dollar character ‘$‘, for example $Date$. The Link Symbol is part of the WHERE clause of the query, adding a dynamic filter to the query.

For example, in part 1 of this article the following custom SQL was utilised to generate a report of the situation events status counts for the past month:

SELECT ITMUSER.EVENTSTATUS("Status") "Status", COUNT("Status") "Total"
FROM "Status_History"
WHERE "Status" = 'Y' OR "Status" = 'A' OR "Status" = 'N'
AND ITMUSER.DB2TIMESTAMP("Global_Timestamp", 'D') > (current timestamp - 31 days)
GROUP BY "Status"

This query can be adapted to provide a summary of events for a specific date. Instead of adding a static date into the query, a Link Symbol can be used, for example the Link Symbol $SelectedDate$:

SELECT ITMUSER.EVENTSTATUS("Status") "Status", COUNT("Status") "Total"
FROM "Status_History"
WHERE "Status" = 'Y' OR "Status" = 'A' OR "Status" = 'N'
AND ITMUSER.DateForm("Global_Timestamp", 'D') = $SelectedDate$
GROUP BY "Status"

Note: This assumes that the date value assigned to the Link Symbol $SelectedDate$ is in the format YYYY/MM/DD.

How is a value assigned to a Link Symbol?

Assigning a value to a link symbol is a two step process:

  1. Create a Workspace including at least one view that utilises the query with the embedded Link Symbol
  2. Create an link to navigate to the workspace created in step 1, and use the advanced link options to assign an attribute value to the link symbol

Creating the Workspace
The standard process is used for ITM workspace creation:

  1. Select the navigator item that will host the workspace
  2. Press F12, the short-cut for Save as…
  3. In the dialogue, enter a suitable name and select the option Only selectable as the target for a workspace link, as demonstrated in the figure below

Creating a new workspace

  1. Click OK to create the new workspace
  2. Remove/Split the current views to arrange the views within the workspace as desired
  3. Assign a view type and configure the properties for each of the views, including a minimum of one query based view that uses the custom query that includes the Link Symbol **Note1
  4. Press Ctrl-S to save the changes to the new workspace

**Note1: The user will be prompted to assign values to Link Symbols when assigning the query to a view. This is for development purposes only, and the values will not be saved with the workspace.

The workspace is now ready to be accessed, but will not be availble from the workspace menu as the option Only selectable as the target for a workspace link was selected.

Creating the Advanced Link

ITM links are associated with a source navigator item or view within a workspace. When creating an advanced link, the values of attributes in the navigator or view are assigned to the Link Symbols. For the example above, it is necessary to assign a date, in the format DD/MM/YYYY, to the Link Symbol $SelectedDate$. Hence the source of the link must include a date attribute in that format.

Part 1 of the article details the definition of a report that displayed the events opened on each day during the past month. Each bar within the bar chart represented a specific date. Hence, a link can be created on the bar chart, where the date associated with the selected bar is mapped to the Link Symbol $SelectedDate$.

To define the link:

  1. Select the source workspace that includes the bar chart indicated above
  2. Open the link wizard, by right clicking on one of the bars within the bar chart and selecting Link To… and Link Wizard…

Accessing the Link Wizard

  1. Select the radio-button Create New Link… and click Next >
  2. Enter a descriptive name for the new link (this will appear in the Link To… menu), for example Event Status Summary for Selected Date, enter a description and click Next >
  3. Select the Absolute radio-button and click Next >
  4. Select the target workspace (with the embedded Link Symbol):
    1. Select the relevant Navigator View from the drop-down menu
    2. Select the Navigator Item hosting the workspace from the Navigator Panel on the left-hand side of the dialogue
    3. Select the Workspace in the Workspace panel on the right-hand side of the dialogue
    4. Click Next > to accept the target workspace

Select the target workspace

The next dialogue displays a list of parameters on the left of the panel and expressions on the right hand side, including a section titled Symbols that will include the Link Symbols defined in the queries in the target workspace.

Advanced Link Definition

To assign an attribute value to the Link Symbol:

  1. Highlight the row for the Link Symbol, in this example SelectedDate
  2. Click Modify Expression… to open the Expression Editor
  3. Click Symbol… to open the Symbols selection dialogue
  4. Highlight Date in the Selected Row section and click OK to return the Expression Editor
  5. To verify the assigned attribute:
    1. Click Evaluate
    2. Confirm the displayed value
    3. Click OK to close the Value dialogue
  6. Click OK to close the Expression Editor

Although this completes the required definitions, it is also possible to update the Header and Footer of the target view, enabling the administrator to clarify the information displayed in the target workspace. To do this:

  1. Highlight the Header row for the specific view in the target workspace (there will be multiple Header rows if there are multiple views in the target workspace)
  2. Click Modify Expression…
  3. Enter the text ‘Event Status Summary for ‘ +
  4. With the cursor after the plus sign, click Symbol…, select the Date attribute and click OK. The resultant entry will look similar to the following:

'Event Status Summary for ' + $kfw.TableRow: ATTRIBUTE.@#@Status_History@#@.Date$

  1. Add the Date attribute to the Footer using the same technique.

The completed dialogue is demonstrated below:

Completed Advanced Link Options

To complete the Link definition:

  1. Click Next >
  2. Click Finish (to close the Link Wizard dialogue)

Testing the Link

To verify the link:

  1. Right-click on a bar within the bar chart for Situation Events opened in the past month, noting the date of the selected bar. This will open a pop-up menu
  2. Click Link To… to open the Link sub-menu
  3. Click Event Status Summary for Selected Date to open the workspace

The workspace will display a summary of the situation events opened, acknowledged and closed on the selected date. Note also the header and footer updates.

What Next?

The use of advanced links is a very powerful technique for providing on-demand workspaces, filtered to the user’s requirement. In a similar fashion to above, additional links could be provided to display more detailed information for the selected date by adapting the query embedded in the target workspace. For example, situation counts for each managed system on the selected date. Multiple levels could also be developed, each level displaying more granular detail, for example, displaying the individual situation events for a specific server on a specific date. The types of reports required will likely be driven by those analysing the data, but the techniques discussed within this article provide the springboard for fulfilling those requirements.

by Nick Lansdowne

Visits: 21