A complete set of alert configuration files as well as sample shell scripts are distributed with e-Biz Impact. The sample configuration files are located in:
~/Sybase/ImpactServer-5_4/samples/alerts
This section describes how to use the distributed sample configuration files and alert handler scripts. If you are using the sample Web OT configuration file, make sure the QMALERTS queue manager has been created with the queues PENDING, HISTORY, and ERROR. Also make sure that the WebSphere MQ queue manager is running.
Running the demonstration alert application
Go to the ~/Sybase/ImpactServer-5_4/samples/alerts on UNIX and x:\Sybase\ImpactServer-5_4\samples\alerts on Windows.
Type ims alertg
at
a command line in Windows or in a terminal window on UNIX. You should
see:
Alert/Trap publication test application
Constructing Alert...
Starting Alert support...
Sending Alert...
Sent!
Stopping Alert support...
Done.
Type ims alertd at a command line in Windows. In UNIX,
enter ims alertd -shell
in
the terminal window. You should see a command window display with
this content:
alertVersion = 1
alertServerName = myhost
alertDomainName = myImpact
alertDomainType = myTest
alertClusterName = myCluster
alertClusterConfigID = 999
alertEventTime = 2003-01-09T19:00:48
alertPublisherName = foobar
alertPublisherType = sfm
alertPublisherSessionID =
alertPublisherInstance = 2
alertObjectName = foobar
alertObjectType = sfm
alertObjectSessionID =
alertObjectInstance = 4
alertReasonCode1 = Refuse mode
alertReasonCode2 = Console
alertReasonCode3 = Fred
alertReasonCode4 =
alertReasonText = SFM 'foobar' was put in Refuse
mode by the Console by Fred
alertTextEncoding = ANSI
---------------------------------------
Press any key to continue . . .
Press Enter to continue and close the window.
Press Ctrl-C to exit alertd.
This is what happened:
alertg placed the alert data into a message and placed it on the Transport.AlertsIn device (PENDING queue or .ALERTS_PENDING file).
alertd read that message from the same device, and invoked the sample script, for example, myscript.cmd for Windows or myscript.sh for UNIX.
The script dumped out the environment variables set by alertd, and then paused, waiting for user input.
After pressing Enter, alertd goes back to waiting for more alert messages.
When you pressed Ctrl-C, alertd exited.
In one session, you can perform variations of the preceding steps by running alertd. In another session, run alertg multiple times while alertd is running.
Scripts or binaries should not generally block awaiting user input, but for the purposes of the demonstration, myscript paused for you to see the result; for example, all the echo statements that displayed the environment variables set by alertd.
In general, debug your handler scripts or binaries using foreground mode. When all of your scripts are debugged, run alertd as a Windows service or as a UNIX daemon (see “Configuring alertd to run as a service or daemon”). In the alertd configuration file, set Alerts.Visible to FALSE before running alertd as a service or daemon.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |