Alert service XSL for event alerts
The following example configuration is the default AlertServiceText.xsl
.
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> -->
<!-- <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
literally! -->
<!-- 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"/>
<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>
<!-- Main Text Body for TopMovers. Remember, the space and new lines
are taken literally! -->
<xsl:template name="MailBodyTopMovers">
------------------------------------------------------------
- <xsl:value-of select="Title"/>
- <xsl:value-of select="SubTitle"/>
------------------------------------------------------------
Alert: <xsl:value-of select="AlertTitle"/>
<xsl:if test="not(ReportTitle='')">
Report: <xsl:value-of select="ReportTitle"/>
</xsl:if>
TopMover: <xsl:value-of select="EventTitle"/>
<xsl:if test="not(DimensionTitle='')">
Dimension: <xsl:value-of select="DimensionTitle"/>
</xsl:if>
<xsl:if test="not(DimValueTitle='')">
Dim Value: <xsl:value-of select="DimValueTitle"/>
</xsl:if>
Frequency: <xsl:value-of select="Frequency"/>
Last Value: <xsl:value-of select="LastValue"/>
Alert Threshold: <xsl:value-of select="AlertThreshold"/>
Warn Threshold: <xsl:value-of select="WarningThreshold"/>
Threshold Type: <xsl:value-of select="ThresholdType"/>
Generated At: <xsl:value-of select="AlertTimeStamp"/>
Report Period: <xsl:value-of select="ReportPeriod"/>
QUICK LINK
<xsl:choose>
<xsl:when test="not(DimValueID='0')">
View Event <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?devid0=<xsl:value-of
select="EventID"/>?dimid0=<xsl:value-of select="DimensionID"/>?<xsl:value-of
select="DimValueID"/>
</xsl:when>
<xsl:when test="not(DimensionID='0')">
View Event <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?devid0=<xsl:value-of
select="EventID"/>?dimid0=<xsl:value-of select="DimensionID"/>
</xsl:when>
<xsl:otherwise>
View Event <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?devid0=<xsl:value-of
select="EventID"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(ReportID='')">
View Report <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?reportid=<xsl:value-of
select="ReportID"/>
</xsl:if>
Notification sent by Discover Alert Service (<xsl:value-of
select="AlertEngineVersion"/>)
Created on <xsl:value-of select="AlertEngineTimeStamp"/>
</xsl:template>
<!-- XML format for Report Messaging -->
<!-- <AlertServiceReportMessage> -->
<!-- <Head> -->
<!-- <Title>*** Discover ALERT ***</Title> -->
<!-- <SubTitle>WARNING DETAILS</SubTitle> -->
<!-- <AlertTitle>Alert Name</AlertTitle> -->
<!-- <ReportTitle>Report Name</ReportTitle> -->
<!-- <FullName>NAMESPACE.INTERNALNAME</FullName> -->
<!-- <AlertID>1</AlertID> -->
<!-- <EventID>1</EventID> -->
<!-- <ReportID>1</ReportID> -->
<!-- <PortalURL>http://localhost/portal</PortalURL> -->
<!-- <Frequency>Hourly or Daily</Frequency> -->
<!-- <Day>YYYY-MM-DD</Day> -->
<!-- <Hour>0 to 23</Hour> -->
<!-- </Head> -->
<!-- <Body> -->
<!-- <EventTitle>TopMover Name</EventTitle> -->
<!-- <DimensionTitle>Dimension Name</DimensionTitle> -->
<!-- <DimValueTitle>Value Name </DimValueTitle> -->
<!-- <TopMoverID>1</TopMoverID> -->
<!-- <DimensionID>1</TopMoverID> -->
<!-- <DimValueID>1</DimValueID> -->
<!-- <LastValue>2.0</LastValue> -->
<!-- <LastCount>1000</LastCount> -->
<!-- <PortalURL>http://localhost/portal</PortalURL> -->
<!-- </Body> -->
<!-- <Tail> -->
<!-- <ThresholdValue>1.0</ThresholdValue> -->
<!-- <AlertThreshold>1.0</AlertThreshold> -->
<!-- <WarningThreshold>1.0</WarningThreshold> -->
<!-- <ThresholdType>Positive or Negative</ThresholdType> -->
<!-- <ThresholdCategory>Alert or Warning</ThresholdCategory> -->
<!-- <AlertTime>0</AlertTime> -->
<!-- <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> -->
<!-- <FullName>NAMESPACE.INTERNALNAME</FullName> -->
<!-- <AlertEngineVersion>4.0.0.4500</AlertEngineVersion> -->
<!-- <AlertEngineTimeStamp>Monday, July 02, 2007 08:00:00
</AlertEngineTimeStamp> -->
<!-- <Frequency>Hourly or Daily</Frequency> -->
<!-- <Day>YYYY-MM-DD</Day> -->
<!-- <Hour>0 to 23</Hour> -->
<!-- </Tail> -->
<!-- </AlertServiceReportMessage> -->
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/AlertServiceReportMessage">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/AlertServiceReportMessage/Head">
------------------------------------------------------------
- <xsl:value-of select="Title"/>
- <xsl:value-of select="SubTitle"/>
------------------------------------------------------------
Alert: <xsl:value-of select="AlertTitle"/>
<xsl:if test="not(ReportTitle='')">
Report: <xsl:value-of select="ReportTitle"/>
</xsl:if>
</xsl:template>
<xsl:template match="/AlertServiceReportMessage/Body">
TopMover: <xsl:value-of select="EventTitle"/>
<xsl:if test="not(DimensionTitle='')">
Dimension: <xsl:value-of select="DimensionTitle"/>
</xsl:if>
<xsl:if test="not(DimValueTitle='')">
Dim Value: <xsl:value-of select="DimValueTitle"/>
</xsl:if>
Last Value: <xsl:value-of select="LastValue"/>
<xsl:choose>
<xsl:when test="not(DimValueID='0')">
View Event
<xsl:value-of select="PortalURL"/>
/DeviationReports.aspx?devid0=<xsl:value-of
select="TopMoverID"/>?dimid0=<xsl:value-of
select="DimensionID"/>?<xsl:value-of select="DimValueID"/>
</xsl:when>
<xsl:when test="not(DimensionID='0')">
View Event <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?devid0=<xsl:value-of
select="TopMoverID"/>?dimid0=<xsl:value-of select="DimensionID"/>
</xsl:when>
<xsl:otherwise>
View Event <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?devid0=<xsl:value-of
select="TopMoverID"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/AlertServiceReportMessage/Tail">
Frequency: <xsl:value-of select="Frequency"/>
Alert Threshold: <xsl:value-of select="AlertThreshold"/>
Warn Threshold: <xsl:value-of select="WarningThreshold"/>
Threshold Type: <xsl:value-of select="ThresholdType"/>
Generated At: <xsl:value-of select="AlertTimeStamp"/>
Report Period: <xsl:value-of select="ReportPeriod"/>
<xsl:if test="not(ReportID='')">
View Report <xsl:value-of
select="PortalURL"/>/DeviationReports.aspx?reportid=<xsl:value-of
select="ReportID"/>
</xsl:if>
Notification sent by Discover Alert Service (<xsl:value-of
select="AlertEngineVersion"/>)
Created on <xsl:value-of select="AlertEngineTimeStamp"/>
</xsl:template>
</xsl:stylesheet>
XML alert message format
Below are the attributes of the XML messages that are generated by the Alert Service for event alerts.
- Attribute
- Description
AlertServiceAlertMessage
- Identifier for the type of message you are configuring.
Default
- selects the Body formatting for all messages except Top MoversTopMovers
- selects the Body formatting for Top MoversSubjectDefault
- selects the Subject line formatting for all messagesReportsHead
- (Top Movers alerts only) selects the header of a generated reportReportsBody
- (Top Movers alerts only) selects the body of a generated reportReportsTail
- (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.
- This value is displayed in the tooltip in the Events tab. See Manage Events - Events tab.
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
orNegative
. ThresholdCategory
- Category for the alert:
Alert
orWarning
.- 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.
- By default, all alerts are defined as
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
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