Share this page

# Activate alerts

This section describes how to work with automatic notification alerts and actions to keep track of tests and test assets.

In this topic:

## Alert rules

You can keep track of your tests as you perform your testing process by setting up email alert notifications. You can instruct LoadRunner Enterprise to notify those responsible when a performance test starts, ends, or fails, if a timeslot is idle for a period of time, or a test host becomes non-operational. You can also set an alert action to release a timeslot after the timeslot has been idle for a specified period of time.

Note: Alerts notifications are disabled during LoadRunner Enterprise upgrades.

You can activate the following alert notifications and actions:

Alert/Action | Description
--- | ---
Test started | Sends an alert notification to the specified users when a test starts. Enable this alert from Tests > Test Start.
Test finished | Sends an alert notification to the specified users when a test’s state changes from Running to any state, except for collate or analyze. Enable this alert from Tests > Test Finish.
Test failed | Sends an alert notification to the specified users if a test fails. Enable this alert from Tests > Test Failure.
Idle timeslot | Sends an alert notification to the specified users if the timeslot is idle for <x> minutes. Enable this alert from Timeslots > Send email if timeslot is idle for X minutes.
Release timeslot | Releases the timeslot after the timeslot has been idle for <x> minutes. Enable this action from Timeslots > Release timeslot if idle for X minutes.
Hosts are non-operational | Sends an alert notification containing the host name and tenant ID to the specified users when test hosts become non-operational as a result of host status being manually changed to `Non-Operational` in LoadRunner Enterprise, or if a host becomes non-operational during a Check Host maintenance task. Enable this alert from Host Availability > Host becomes Non-Operational.

Back to top

## Set alert rules

To activate alerts or notifications:

1. In LoadRunner Enterprise Administration, select Configuration > Alerts.

2. Click Add Alert, and enter a name and description (optional) for the alert.

3. Select the alerts and/or the release timeslot action you want to activate from the Tests, Timeslots, and Host Availability tabs in the Alerts Template. For details, see Alert rules.

   - For test, timeslot, and host availability alerts:

     - Select the alert recipients: Owner, Administrator, and/or Other users. Use a comma (,) or semi-colon (;) to separate multiple email recipient addresses.

     - Enter an email subject line (Title) and alert notification text.

   - For timeslot alerts and the release timeslot action, enter the amount of time to wait before sending notification that the timeslot is idle, and before releasing the timeslot.

4. Select the Assign Projects tab and click Assign Projects . Select the projects to assign to the alert in the Assign Projects to Alert dialog box, and click Assign. Projects associated with the alert are listed in the grid.

   To unassign projects from an alert, select the projects to unassign in the Assign Projects grid, and click Unassign.

5. Click Save to save the alert template.

6. Use the Filter to display only those alerts that meet the criteria that you define. For details see Filter.

   Note: For very short tests (between 1-2 minutes), no statistics are displayed in the email alert.

Back to top

## Create custom email alert templates

You can create customized alert templates to alter the content and format of alert messages. By default, LoadRunner Enterprise uses built-in templates to generate alert messages for the different alert types.

You can create your own template by making a copy of an existing template, and customizing it by adding or removing text, changing the order of text or property variables that are included in the template, selecting a different image, and modifying the position of each element in the page.

Custom alert templates are also supported in multi-tenant environments. For details on enabling them in multi-tenant environment, see Alerts in a multi-tenant environment.

To configure custom templates in email alerts:

1. Create a custom template for the alert type: Tests, Timeslots, and/or Host Availability.

   You can use the default templates below as a basis for creating a custom template, and modify the layout and content as required. Save the template as an HTML file.

   Tests
   Copy code

       <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <title>$(TITLE)</title>
       <style type="text/css">
           body {
               font-family: Metric, Arial, Helvetica, sans-serif;
               color: #333333;
           }
           .product {
               height: 198pt;
               width: 900pt;
           }
           .title {
               font-size: 24pt;
               font-weight: 600;
               margin-top: 18pt;
           }
           hr.separator {
               border-top: 1px solid #E4E4E4;
           }
           .subtitle {
               font-size: 12pt;
               font-weight: 500;
           }
           .section-title {
               font-size: 12pt;
               font-weight: 600;
               margin: 0 0 8pt 0;
           }
           .comment {
               font-size: 10pt;
           }
           .details-title {
               font-size: 10pt;
               margin: 0 48pt 6pt 0;
           }
           .details {
               font-size: 10pt;
               margin: 0 0 6pt 0;
           }
           .statistics-title {
               font-size: 10pt;
               margin: 0 24pt 6pt 0;
           }
           .statistics-value {
               font-size: 10pt;
               margin: 0 0 6pt 0;
           }
           table {
               border-collapse: collapse;
           }
           td {
               text-align: left;
           }
       </style>
       </head>
       <body>
           <table>
               <tr>
                   <td><img class="product" src="cid:EMAIL_IMAGE_HEADER_CID" alt="OPENTEXT" /></td>
               </tr>
               <tr>
                   <td><div class="title">$(TITLE)</div></td>
               </tr>
           </table>
           <hr class="separator" style="margin: 15pt 0 11.25pt 0;">
           <table>
               <tr>
                   <td><img class="subtitle" src="cid:$(KEY_TEST_STATE_CID)" alt="T" /></td><td><div class="subtitle">$(TESTNAME) | $(RUN_ID_TITLE) : $(RUN_ID) | $(STATE)</div></td>
               </tr>
           </table>
           <div class="section-title" style="margin: 34.5pt 0 4.5pt 0;">$(COMMENT_TITLE)</div>
           <div class="comment">$(COMMENT)</div>
           <hr class="separator" style="margin: 22pt 0 22pt 0;">
           <table cellpadding="0" cellspacing="0" border="0">
               <tr>
                   <td><div class="section-title">$(DETAILS_TITLE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(TESTNAME_TITLE)</div></td><td><div class="details">$(TESTNAME)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(RUN_ID_TITLE)</div></td><td><div class="details">$(RUN_ID)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(PROJECTNAME_TITLE)</div></td><td><div class="details">$(PROJECTNAME)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(STARTDATE_TITLE)</div></td><td><div class="details">$(STARTDATE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(ENDDATE_TITLE)</div></td><td><div class="details">$(ENDDATE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(TIMESLOT_TITLE)</div></td><td><div class="details">$(TIMESLOT_ID)</div></td>
               </tr>
           </table>
           $(ATTACHMENT)
       </body>
       </html>

   Below is the list of macros that are replaced by real information in Test templates:

       $(TITLE),
       $(KEY_TEST_STATE_CID),
       $(STATE),
       $(COMMENT_TITLE),
       $(COMMENT),
       $(DETAILS_TITLE),
       $(TESTNAME),
       $(TESTNAME_TITLE),
       $(RUN_ID),
       $(RUN_ID_TITLE),
       $(PROJECTNAME),
       $(PROJECTNAME_TITLE),
       $(STARTDATE_TITLE),
       $(STARTDATE),
       $(ENDDATE_TITLE),
       $(ENDDATE),
       $(TIMESLOT_TITLE),
       $(TIMESLOT_ID),
       $(ATTACHMENT)

   Timeslots
   Copy code

       <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <title>$(TITLE)</title>
       <style type="text/css">
           body {
               font-family: Metric, Arial, Helvetica, sans-serif;
               color: #333333;
           }
           .product {
               height: 198pt;
               width: 900pt;
           }
           .title {
               font-size: 24pt;
               font-weight: 600;
               margin-top: 18pt;
           }
           hr.separator {
               border-top: 1px solid #E4E4E4;
           }
           .subtitle {
               font-size: 12pt;
               font-weight: 500;
           }
           .section-title {
               font-size: 12pt;
               font-weight: 600;
               margin: 0 0 8pt 0;
           }
           .comment {
               font-size: 10pt;
           }
           .details-title {
               font-size: 10pt;
               margin: 0 48pt 6pt 0;
           }
           .details {
               font-size: 10pt;
               margin: 0 0 6pt 0;
           }
           table {
               border-collapse: collapse;
           }
           td {
               text-align: left;
           }
       </style>
       </head>
       <body>
           <table>
               <tr>
                   <td><img class="product" src="cid:EMAIL_IMAGE_HEADER_CID" alt="MICRO FOCUS" /></td>
               </tr>
               <tr>
                   <td><div class="title">$(TITLE)</div></td>
               </tr>
           </table>
           <hr class="separator" style="margin: 15pt 0 11.25pt 0;">
           <table>
               <tr>
                   <td><img class="subtitle" src="cid:EMAIL_IMAGE_IDLE_CID" alt="I" /></td><td><div class="subtitle">$(TIMESLOT_TITLE) $(TIMESLOT_NAME):$(TIMESLOT_ID) $(IDLE_STATE)</div></td>
               </tr>
           </table>
           <div class="section-title" style="margin: 34.5pt 0 4.5pt 0;">$(COMMENT_TITLE)</div>
           <div class="comment">$(COMMENT)</div>
           <hr class="separator" style="margin: 22pt 0 22pt 0;">
           <table cellpadding="0" cellspacing="0" border="0">
               <tr>
                   <td><div class="section-title">$(DETAILS_TITLE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(TIMESLOT_NAME_TITLE)</div></td><td><div class="details">$(TIMESLOT_NAME)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(TIMESLOT_ID_TITLE)</div></td><td><div class="details">$(TIMESLOT_ID)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(PROJECTNAME_TITLE)</div></td><td><div class="details">$(PROJECTNAME)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(STARTDATE_TITLE)</div></td><td><div class="details">$(STARTDATE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(ENDDATE_TITLE)</div></td><td><div class="details">$(ENDDATE)</div></td>
               </tr>
           </table>
       </body>
       </html>

   Below is the list of macros that are replaced by real information in Timeslot templates:

       $(TITLE),
       $(TIMESLOT_TITLE),
       $(COMMENT_TITLE),
       $(COMMENT),
       $(IDLE_STATE),
       $(DETAILS_TITLE),
       $(TIMESLOT_NAME_TITLE),
       $(TIMESLOT_NAME),
       $(TIMESLOT_ID_TITLE),
       $(TIMESLOT_ID),
       $(PROJECTNAME_TITLE),
       $(PROJECTNAME),
       $(STARTDATE_TITLE),
       $(STARTDATE),
       $(ENDDATE_TITLE),
       $(ENDDATE),

   Host Availability
   Copy code

       <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <title>$(TITLE)</title>
       <style type="text/css">
           body {
               font-family: Metric, Arial, Helvetica, sans-serif;
               color: #333333;
           }
           .product {
               height: 198pt;
               width: 900pt;
           }
           .title {
               font-size: 24pt;
               font-weight: 600;
               margin-top: 18pt;
           }
           hr.separator {
               border-top: 1px solid #E4E4E4;
           }
           .subtitle {
               font-size: 12pt;
               font-weight: 500;
           }
           .section-title {
               font-size: 12pt;
               font-weight: 600;
               margin: 0 0 8pt 0;
           }
           .comment {
               font-size: 10pt;
           }
           .details-title {
               font-size: 10pt;
               margin: 0 48pt 6pt 0;
           }
           .details {
               font-size: 10pt;
               margin: 0 0 6pt 0;
           }
           table {
               border-collapse: collapse;
           }
           td {
               text-align: left;
           }
       </style>
       </head>
       <body>
           <table>
               <tr>
                   <td><img class="product" src="cid:EMAIL_IMAGE_HEADER_CID" alt="MICRO FOCUS" /></td>
               </tr>
               <tr>
                   <td><div class="title">$(TITLE)</div></td>
               </tr>
           </table>
           <hr class="separator" style="margin: 15pt 0 11.25pt 0;">
           <table>
               <tr>
                   <td><img class="subtitle" src="cid:EMAIL_IMAGE_HOST_STATE_CID" alt="H" /></td><td><div class="subtitle">$(HOST_TITLE): $(HOST_NAME) | $(HOST_ID_TITLE): $(HOST_ID) | $(HOST_STATE_TITLE): $(HOST_STATE)</div></td>
               </tr>
           </table>
           <div class="section-title" style="margin: 34.5pt 0 4.5pt 0;">$(COMMENT_TITLE)</div>
           <div class="comment">$(COMMENT)</div>
           <hr class="separator" style="margin: 22pt 0 22pt 0;">
           <table cellpadding="0" cellspacing="0" border="0">
               <tr>
                   <td><div class="section-title">$(DETAILS_TITLE)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(HOST_NAME_TITLE)</div></td><td><div class="details">$(HOST_NAMES)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(HOST_ID_TITLE)</div></td><td><div class="details">$(HOST_ID)</div></td>
               </tr>
               <tr>
                   <td><div class="details-title">$(PROJECTNAME_TITLE)</div></td><td><div class="details">$(PROJECTNAME)</div></td>
               </tr>
           </table>
       </body>
       </html>

   Below is the list of macros that are replaced by real information in Host Availability templates:

       $(TITLE)
       $(COMMENT_TITLE),
       $(COMMENT),
       $(DETAILS_TITLE),
       $(HOST_TITLE),
       $(HOST_NAME_TITLE),
       $(HOST_NAMES),
       $(HOST_ID_TITLE),
       $(HOST_ID),
       $(HOST_STATE_TITLE),
       $(HOST_STATE),
       $(PROJECTNAME_TITLE),
       $(PROJECTNAME),

2. Navigate to the <LRE server installation directory>\dat folder, and create a folder named templates. Copy the custom alert template to the templates folder.

3. Add the custom template to the configuration file.

   1. Open the PCAlertsSvc.exe.config file located in the <LRE server installation directory>\bin\ folder.

   2. Search for the Custom Alert mail teplate section, and uncomment the template type that you want to use.

      Copy code

          <!-- Custom Alert mail template -->
          <!--<add key="Mail.Template.Test" value="dat/templates/AlertTest.html"/>-->
          <!--<add key="Mail.Template.Test.{tenant-guid}" value="dat/templates/AlertTest.{tenant-guid}.html"/>-->
          <!--<add key="Mail.Timeslot.Test" value="dat/templates/AlertTimeslot.html"/>-->
          <!--<add key="Mail.Timeslot.Test.{tenant-guid}" value="dat/templates/AlertTimeslot.{tenant-guid}.html"/>-->
          <!--<add key="Mail.HostAvailability.Test" value="dat/templates/AlertHostAvailability.html"/>-->
          <!--<add key="Mail.HostAvailability.Test.{tenant-guid}" value="dat/templates/AlertHostAvailability.{tenant-guid}.html"/>-->

   3. Enter the path to your template file.

      Copy code

          <!-- Custom Alert mail template -->
          <add key="Mail.Template.Test" value="dat/templates/Mail.Test.html"/>

      If you are using a multi-tenant environment, you need to add the tenant UID for each tenant and provide a different template name:

      Copy code

          <!-- Custom Alert mail template -->
          <add key="Mail.Template.Test" value="dat/templates/Mail.Test.html"/>
          <add key="Mail.Template.Test.2e1b52fc-df12-44ed-94d4-f66f96fcc7c9" value="dat/templates/Mail.Test.2e1b52fc-df12-44ed-94d4-f66f96fcc7c9.html"/>

Back to top

## Alerts in a multi-tenant environment

To enable alerts to work in a multi-tenant environment:

1. Open the tenants.json file located in the <LR Enterprise server installation>\dat folder.

2. Copy the Tenant Unique IDs from LoadRunner Enterprise or the Site Management console, and paste them into the tenants.json file in the following format:

   Copy code

       {
       "tenants": [
       { "id": "fa128c06-5436-413d-9cfa-9f04bb738df3" },
       { "id": "<GUID>" },
       { "id": "<GUID>" }
       ]
       }

   Where `<GUID>` is a tenant unique ID which is taken from the Tenants page in the Site Management console. For details, see Manage tenants.

3. Restart the LoadRunner Alerts Service.

Back to top

https://admhelp.microfocus.com LoadRunner Enterprise 8942
Tips to improve your search results... LoadRunner Enterprise Help Center LoadRunner Enterprise Help LR Enterprise Help 2023-2023 R1 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: