Alert service XSL for Canister alerts

For alerts based on Canister metrics, the following XSL provides an example configuration, including the available data fields, for formatting Canister alerts.

Click to display default XSL.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text" indent="no" omit-xml-declaration="yes"
encoding="iso-8859-1"/>
    <!-- XML format for Alert Messaging                                  -->
    <!-- <AlertServiceAlertMessage MessageType="Default">                -->
    <!-- <AlertServiceAlertMessage MessageType="TopMovers">              -->
    <!-- <AlertServiceAlertMessage MessageType="SubjectDefault">         -->
    <!-- <AlertServiceAlertMessage MessageType="ReportsHead">            -->
    <!-- <AlertServiceAlertMessage MessageType="ReportsBody">            -->
    <!-- <AlertServiceAlertMessage MessageType="ReportsTail>             -->
    <!--     <AlertID>1</AlertID>                                        -->
    <!--     <EventID>1</EventID>                                        -->
    <!--     <AlertTime>0</AlertTime>                                    -->
    <!--     <Title>*** Discover ALERT ***</Title>                        -->
    <!--     <SubTitle>WARNING DETAILS</SubTitle>                        -->
    <!--     <AlertTitle>Alert Name</AlertTitle>                         -->
    <!--     <EventTitle>Event Name</EventTitle>                         -->
    <!--     <AlertGroup>Alert Group</AlertGroup>                        -->
    <!--     <ThresholdValue>1.0</ThresholdValue>                        -->
    <!--     <LastValue>2.0</LastValue>                                  -->
    <!--     <ThresholdType>Positive or Negative</ThresholdType>         -->
    <!--     <ThresholdCategory>Alert or Warning</ThresholdCategory>     -->
    <!--     <AlertTimeStamp>Monday, July 02, 2007 08:00</AlertTimeStamp> -->
    <!--     <AlertTimeStampShort>07/02/07 08:00:00</AlertTimeStampShort> -->
    <!--     <ReportPeriod>Monday, July 02, 2007 08:00</ReportPeriod>    -->
    <!--     <PortalURL>http://localhost/portal</PortalURL>              -->
    <!--     <AlertDateForReportBuilder>2012-06-30</AlertDateForReportBuilder>
-->
    <!--     <AlertEngineVersion>4.0.0.4500</AlertEngineVersion>         -->
    <!--     <AlertEngineTimeStamp>Monday, July 02, 2007 08:00:00
</AlertEngineTimeStamp> -->
    <!--     <CanistersLagging>george, sam, bobo</CanistersLagging>      -->
    <!--     <LaggingCount>3</LaggingCount>                              -->
    <!--     <CanistersStopped>fox, hound</CanistersStopped>             -->
    <!--     <StoppedCount>2</StoppedCount>                              -->
    <!-- The below are only populated for MessageType="TopMovers"        -->
    <!--     <Frequency>Hourly or Daily</Frequency>                      -->
    <!--     <ReportID>1</ReportID>                                      -->
    <!--     <DimensionID>1</DimensionID>                                -->
    <!--     <DimValueID>1,2,3 ... </DimValueID>                         -->
    <!--     <ReportTitle>Report Name</ReportTitle>                      -->
    <!--     <FullName>NAMESPACE.INTERNALNAME</FullName>                 -->
    <!--     <DimensionTitle>Dimension Name</DimensionTitle>             -->
    <!--     <DimValueTitle>Value0 Name,Value1 Name </DimValueTitle>     -->
    <!-- </AlertServiceAlertMessage>                                     -->

  <xsl:template match="AlertServiceAlertMessage">
    <xsl:choose>
      <xsl:when test="@MessageType[.='Default']">
        <xsl:call-template name="MailBodyDefault"/>
      </xsl:when>
      <xsl:when test="@MessageType[.='TopMovers']">
        <xsl:call-template name="MailBodyTopMovers"/>
      </xsl:when>
      <xsl:when test="@MessageType[.='SubjectDefault']">
        <xsl:call-template name="MailSubjectDefault"/>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

  <!-- Main Text Subject.  Remember, the space and new lines are taken
  <!-- The Subject line is truncated to yield a maximum length of 64
characters  -->

  <xsl:template name="MailSubjectDefault">Discover Event <xsl:value-of
select="ThresholdCategory"/> - <xsl:value-of
select="EventTitle"/></xsl:template>

  <!-- Main Text Body.  Remember, the space and new lines are
       taken literally! -->

  <xsl:template name="MailBodyDefault">
------------------------------------------------------------
-  <xsl:value-of select="Title"/>
-  <xsl:value-of select="SubTitle"/>
------------------------------------------------------------
<xsl:if test="CanistersLagging">
  - Slow Servers     : <xsl:value-of select="CanistersLagging"/>
</xsl:if>
<xsl:if test="CanistersStopped">
  - Silent Servers   : <xsl:value-of select="CanistersStopped"/>
</xsl:if>
  - Event            : <xsl:value-of select="EventTitle"/>
  - Alert            : <xsl:value-of select="AlertTitle"/>
  - Threshold        : <xsl:value-of select="ThresholdValue"/>
  - Last Value       : <xsl:value-of select="LastValue"/>
  - Threshold Type   : <xsl:value-of select="ThresholdType"/>
  - Generated At     : <xsl:value-of select="AlertTimeStamp"/>
  - Report Period    : <xsl:value-of select="ReportPeriod"/>
QUICK LINK
- View Alert Status  : <xsl:value-of
select="PortalURL"/>/alerts.aspx?alertid=<xsl:value-of
select="AlertID"/>&amp;uniqueid=<xsl:value-of
select="EventID"/>&amp;alerttime=<xsl:value-of select="AlertTime"/>
<xsl:if test="AlertDateForReportBuilder">
- View Event Counts  : <xsl:value-of
select="PortalURL"/>/ReportBuilder.aspx?d1=<xsl:value-of
select="AlertDateForReportBuilder"/>&amp;eventid0=<xsl:value-of
select="EventID"/>
</xsl:if>
<xsl:if test="CanistersLagging or CanistersStopped">
  - Notes            : This alert has been delayed due to extra time
    required to process event data from the listed Slow or Silent Servers.
    Event data is still recorded as occurring at the correct times
    but the recording process is delayed.  As a result, this will be
    the only notification for this specific alert during the delayed
    processing period.  Please refer to the Alert Service Debug Log
    and Windows Application Event Log for more details.
</xsl:if>
------------------------------------------------------------
Notification sent by Discover Alert Service (<xsl:value-of
select="AlertEngineVersion"/>)
Timestamp: <xsl:value-of select="AlertEngineTimeStamp"/>
 </xsl:template>

</xsl:stylesheet>

XML Canister alert message format

Below is attribute information for the XML generated for Canister alerts.

Attribute
Description
AlertServiceAlertMessage
Identifier for the type of message you are configuring.
  • Default - selects the Body formatting for all messages except Top Movers
  • TopMovers - selects the Body formatting for Top Movers
  • SubjectDefault - selects the Subject line formatting for all messages
  • ReportsHead - (Top Movers alerts only) selects the header of a generated report
  • ReportsBody - (Top Movers alerts only) selects the body of a generated report
  • ReportsTail - (Top Movers alerts only) selects the detail of a generated report
AlertID
Internal identifier for the alert.
  • This value is displayed in the tooltip in the Alerts tab.
EventID
Internal identifier for the event.
AlertTime
Time that alert occurred in Discover system time.
Title
Subject of the alert email.
SubTitle
You can use this field to provide a subtitle for the alert.
AlertTitle
Title of the alert
EventTitle
Title of the event
AlertGroup
Group to which the alert belongs
ThresholdValue
The threshold value for the alert
LastValue
The last recorded value for the event at the time when the alert was generated
ThresholdType
The Direction value in the Configuration tab. Set to Positive or Negative.
ThresholdCategory
Category for the alert: Alert or Warning.
  • By default, all alerts are defined as Alert type. If the Enable Warnings check box is selected, a Warning type alert is generated when the specified thresholds are exceeded.
AlertTimeStamp
Timestamp when the alert was generated. Example: Monday, July 02, 2010 08:00.
AlertTimeStampShort
Timestamp when the alert was generated in short format. Example: 07/02/10 08:00:00.
ReportPeriod
Timestamp of the beginning of the alert Interval.
PortalURL
URL to reach the Portal login screen
AlertDateforReportBuilder
Date that is passed to the Report Builder for rendering the report
AlertEngineVersion
Build number of the version of the alert engine
AlertEngineTimeStamp
Timestamp that is generated by the alert engine on last alert evaluation run
  • The alert engine evaluates active alerts every minute.
CanistersLagging
If alert information obtained from one or more individual Canisters is delayed for longer than 10 minutes, the names of those Canisters are listed here in comma-separated format.
LaggingCount
Count of lagging Canisters
CanistersStopped
If alert information from one or more individual Canisters was not available for more than 3 minutes, the names of those Canisters are listed here in comma-separated format.
StoppedCount
Count of stopped Canisters

Adding links to reports

Through the XSL, you can configure links to be added to the alert, enabling access to alert status information and a generated event count report. Below, you can review the example configuration for Canister alerts.

Note: To disable these links, comment out this code.

QUICK LINK

- View Alert Status  : <xsl:value-of
select="PortalURL"/>/alerts.aspx?alertid=<xsl:value-of
select="AlertID"/>&amp;uniqueid=<xsl:value-of
select="EventID"/>&amp;alerttime=<xsl:value-of select="AlertTime"/>

<xsl:if test="AlertDateForReportBuilder">

- View Event Counts  : <xsl:value-of
select="PortalURL"/>/ReportBuilder.aspx?d1=<xsl:value-of
select="AlertDateForReportBuilder"/>&amp;eventid0=<xsl:value-of
select="EventID"/>