Using alerts  Sample configuration files and alert-handler scripts

Chapter 5: Configuring and Using Alerts

Alerts automation

To automate the treatment of XML-alerts,

For each XML alert picked up from the OT queue by alertd:

The user-maintained script is responsible for automating and handling the response to the alert. It can for example, page an operator depending on the alert severity, send an e-mail, log the alert into a database for warehousing, execute file or log maintenance tasks, and so on.

e-Biz Impact provides the sample myalert.sh script that demonstrates how to read the environment variables and dump the elements of the alert to the console output. myalert.sh is located in x:\Sybase\ImpactServer-5_4\samples\alerts on Windows and in ~/Sybase/ImpactServer-5_4/samples/alerts on UNIX, where “x” and “~” represent the location where the e-Biz Impact server is installed.

#!/usr/bin/sh
# Impact Alert Handler Script
# Utilize the alert* environment variables as
# appropriate for your site. 
echo alertVersion = $alertVersion
echo alertServerName = $alertServerName
echo alertDomainName = $alertDomainName
echo alertDomainType = $alertDomainType
echo alertClusterName = $alertClusterName
echo alertClusterConfigID = $alertClusterConfigID
echo alertEventTime = $alertEventTime
echo alertPublisherName = $alertPublisherName
echo alertPublisherType = $alertPublisherType
echo alertPublisherSessionID = $alertPublisherSessionID
echo alertPublisherInstance = $alertPublisherInstance
echo alertObjectName = $alertObjectName
echo alertObjectType = $alertObjectType
echo alertObjectSessionID = $alertObjectSessionID
echo alertObjectInstance = $alertObjectInstance
echo alertReasonCode1 = $alertReasonCode1
echo alertReasonCode2 = $alertReasonCode2
echo alertReasonCode3 = $alertReasonCode3
echo alertReasonCode4 = $alertReasonCode4
echo alertReasonText = $alertReasonText
echo alertTextEncoding = $alertTextEncoding
echo 
---------------------------------------
# In production, handler scripts should not block on
# user input since it prevents the alert handler daemon
# from processing other alerts.
# Pausing can be useful during development. On Windows,
# make sure you set Alerts.Visible to TRUE so you can
# interact (e.g. respond to pause).
echo press Enter/Return to continue 
read xxx




Copyright © 2005. Sybase Inc. All rights reserved. Sample configuration files and alert-handler scripts

View this book as PDF