How to use Rational Performance Tester scripts to raise alerts on server errors

The problem: While running Rational Performance Tester (RPT) HTTP scripts, if you happen to shut down the monitored application, you might see the RPT script response time increase dramatically, but there is no indication in the TEP that anything is wrong. You might want to configure alerts to indicate that the application is down.

The solution: This is the default behavior of Rational Performance Tester (RPT) scripts. To raise alerts in the Tivoli Enterprise Portal (TEP), you need to include verification points in your RPT script, and you need to add situations to raise appropriate alerts in the TEP. The following sections describe how to do these tasks.

Sample default behavior

The following examples display sample Robotic Response Time (RRT) workspaces for a script that monitors the PlantsByWebSphere application. The application has been shut down, but the TEP does not indicate that anything unusual has happened, except that the Average Response Time is unusually high. Notice that the script Last Run Status is Complete. Here, the response time is high because the script is actually timing out while trying to connect to the application.

Example of RRT workspace
Example of RRT workspace
Example of RRT workspace

Effect of adding verification points

In this example, we added page title verification points to the PlantsByWebSphere script. This is the text that you see in HTML TITLE tags in the HTML source. The PlantsByWebSphere script now reports errors when the web page is not available. Notice that the Last Run Status is 'Complete'. But, this time, we report verification point failures and zero Percent Available.

Example of RRT workspace
Example of RRT workspace
Example of RRT workspace
Example of RRT workspace

Configuring situations to raise alerts on URL Unavailable and Slow Response Time conditions

In addition to adding verification points to your scripts, you also need to add appropriate situations to raise alerts based on verification point failures and behavior such as unusually high response time.

For example, make a copy of the following situations and customize the copies of these situations:
  • RRT Availability Critical
  • RRT Response Time Warning
  • RRT Verification Point Failure
For more information on creating situations, please refer to the following technote:
http://www-01.ibm.com/support/docview.wss?uid=swg21421211

The following example shows a copy of the RRT Availability Critical situation with modifications:

Example of modified RRT Availability Critical situation

The following example shows a copy of the RRT Response Time Warning situation with modifications:

Example of modified RRT Response Time Warning situation

The following example shows a copy of the RRT Verification Point Failure situation with modifications:

Example of modified RRT Verification Point Failure situation

Global situation modifications: Use the Action tab in situations to program how the situation responds to events. The System Command entry is where you insert a system command to launch an email when the situation fires. Note that the format of the command should be appropriate for the operating system where the command runs.

The Attribute Substitution button allows you to insert parameters such as the Application name. For more information on launching email from a situation, please refer to the following technote:
http://www-01.ibm.com/support/docview.wss?uid=swg21405122

If you are going to send email, typically you don't want to send an email each time the situation condition is true. Most users select the options to take action on the first item (take action the first time the condition is true) and don't take action twice in a row. These options allow the situation to raise an alert the first time the condition is true (for example, the script playback time is suspiciously slow, or the percent availability is greater than zero). The situation resets and is ready to fire again after the condition becomes false (the web site is available again).

Typically you would run the take action at the agent to avoid burdening the server. However, if you have configured your email server on the TEMS host, you might choose to run the action at the TEMS.

Inserting verification points in RPT scripts

You can insert the following types of verification points (VP) into a script:
  • Content
  • Page Title
  • Response Code
  • Response Size

Note that you can insert verification points in the parent node, in the transaction, and in the page element. If you insert a verification point in the parent node or in the page element, you globally insert the verification point in lower-level elements.

The following sections review how to insert content and page title verification points. For more information on RPT verification points, please refer to your RPT workbench online help and the following best practices whitepaper on RPT scripting:
http://www-01.ibm.com/software/brandcatalog/portal/opal
/details?catalog.label=1TW10CP19

Using content verification points

Use the following procedure to insert content verification points:
  1. In the test perspective in the RPT workbench, right-click a page element.
  2. From the pop-up menu, select Verification Points -> Enable Content VPs.
    RPT workbench, enabling content verification points
  3. Click OK.
    Test Editor dialog
  4. The Select Strings window is displayed, similar to the following example. Click Close.
    Test Editor dialog
  5. Click OK.
    Test Editor dialog
  6. Select the response code verification point under the page element. Then, place your cursor inside the Content box, and press Ctrl + Shift + Space to display the HTML text for this page element. Select a text string for verification.
    RPT dialog
  7. Select Content Verification (1) and then click New String (2).
    RPT dialog
  8. Enter the text exactly as it appears in the source view. Elect to make the verification point case sensitive or not. In this example, the selected text appears in the HTML title tag. As an alternative, you can elect to insert page title verification points. Click OK.
    Test Editor dialog
  9. Select the string in the Test Editor (add a checkmark to the selection box). Then, click Close to close the Test Editor.
    Test Editor dialog
  10. Under Test Element Details, ensure that Enable verification point is enabled (1). Ensure that the appropriate verification mode is selected (2):
    • Verification fails if at least one of the checked strings is found.
    • Verification fails if none of the checked strings are found.

    Ensure that the string you entered displays as expected (3).

    RPT dialog

Using page title verification points

The simplest way to add page title verification points is to add them at the parent node. Then, a page title verification point will be added to each of the appropriate page elements.

Use the following procedure to insert page title verification points:
  1. Right-click the parent node, and select Verification Points -> Enable Page Title VPs from the pop-up menus.
    RPT dialog
  2. Click OK. RPT workbench adds the page title verification points to the appropriate page elements. In this example, page title verification points are added to nine page elements.
    RPT dialog