Using Notification Scripts
The PATROL KM for Event Management provides sample notification scripts that call command-line utilities to initiate notification (such as e-mail and page). This section describes the sample scripts, their locations, requirements for use, and editing guidelines. Editing is required on most platforms.
Unix and Linux Scripts
On Unix and Linux, the following script options are available:
- A Unix shell script that sends e-mail notification using mailx (Unix) or mail (Linux)
- A Perl script that sends e-mail notification using mailx (Unix) or mail (Linux)
Default Location on Unix
The scripts that run on Unix, shown in the following table, are located in $PATROL_HOME$/lib/psl
Notification Script Location on Unix
Unix Requirements
To use the Unix scripts, the server sending the notification must meet the requirements shown in the following table.
Requirements for Using Scripts on Unix Notification Server
Windows Scripts
On Windows, the following script options are available:
- A Windows batch file that you mustedit before use, which can send any of the following types of notification:
- SMTP e-mail message by means of a Visual Basic (VB) script (provided)
- MAPI e-mail message by means of a VB script (provided)
- SMTP e-mail message by means of Blat ( not provided)
Blat is a free command-line e-mail client, that you can download from the Web. You can also use any other SMTP-based, command-line e-mail client if you edit the batch file accordingly. For more information, see Editing Scripts.
- A Perl script that sends e-mail notification by means of Blat
Default Location on Windows
The Windows scripts are located in the *%PATROL_HOME%\lib\psl* directory and are named as shown in the following table.
Notification Script Location on Windows
Windows Requirements
To use these Windows scripts, the server sending the notification must meet the requirements shown in the following table.
Requirements for Notification Server When Using Windows e-mail Clients
AS/400 (iSeries) Scripts
On AS/400 (iSeries), the script AS_EVSLocalAlertNotify is provided. By default, this script sends e-mail notifications using the AS/400 SNDDST ( Send Distribution) utility. If you use this mail utility, no script modifications are required.
OpenVMS Scripts
On OpenVMS, the script AS_EVSLocalAlertNotify.com is provided. By default, this script sends e-mail notifications using the native OpenVMS utility MAIL. If you use this mail utility, no script modifications are required.
Editing Scripts
Before using the sample scripts, you may have to edit them, as described in the following table.
Editing Scripts
Editing the Windows Batch File
If you use AS_EVSLocalAlertNotify.bat, remove the REM comments from the mail client that you want to use. The script provides sections for MAPI-based e-mail, SMTP-based e-mail, and Blat. For example, to use Blat, in the script shown below, remove the REM comments beginning with the line that starts with set and ending with the line that reads goto BYE.
If you use a third-party command-line e-mail client or if you want to use the script to perform other types of notification, such as paging or trouble tickets, you must add the code to the script that calls the e-mail client or appropriate notification utility.
Editing Perl Script for use on Windows
On Windows, you must edit the Perl script before you can use it to send e-mail notifications with Blat. Find the following line in the Perl script and remove the comment (#):
Editing the SMTP VB Script
To use the SMTP VB Script (sendmail.vbs ), you must edit the script to add the following information:
- name of the e-mail server
- the SMTP server port
Add this information in the script as shown below.
iConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.bmc.com"
' Enter the SMTP Server Port number
iConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Backing up and Renaming the Notification Script
Before configuring notification servers, copy the notification script from the default installation location, %PATROL_HOME%\lib\psl\, to another location. This action prevents the script from being overwritten during a new installation or upgrade. Place the notification script in the same location on both the primary and backup notification servers.
Other Types of Notification
In addition to e-mail, the notification scripts that are included with the PATROL KM for Event Management can also be used to send the following types of notifications:
- pages
- trouble tickets
- custom notifications
The PATROL KM for Event Management notification scripts have clearly marked sections where you can add scripting to support these notification types.