The PATROL KM for Event Management provides sample notification scripts that call command-line utilities to initiate notification (such as email message and page).
On Windows, the following script options are available:
Note
The PATROL for Microsoft Windows Servers has been tested with Blat version 1.7.
This section describes the Windows sample scripts, their locations, requirements for use, and editing requirements.
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
Script | Name |
---|---|
Batch File Script | AS_EVSLocalAlertNotify.bat |
SMTP VB Script | sendmail.vbs This VB script is called from AS_EVSLocalAlertNotify.bat. This script uses an ActiveX control. |
MAPI VB Script | send_mapi.vbs This VB script is called from AS_EVSLocalAlertNotify.bat. This script uses an ActiveX control. |
Perl Script | AS_EVSLocalAlertNotify.pl |
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
Script | Requirement |
---|---|
Batch File Script | If Blat is installed in a directory other than C:\Blat, you must move Blat to this directory or edit AS_EVSLocalAlertNotify.bat to execute Blat from the directory where it is installed. |
Perl Script | The Perl script assumes the use of Blat. If Blat is installed in a directory other than C:\Blat, you must move Blat to this directory or edit the Perl script, AS_EVSLocalAlertNotify.pl, to execute Blat from the directory where it is installed. Associate the .pl extension with Perl. Otherwise, you must call the script using the following syntax:perl C:\PATROL3-4\lib\psl\AS_EVSLocalAlertNotify.pl |
SMTP VB Script | The SMTP service must be running. |
MAPI VB Script | Microsoft Outlook must be installed. |
Before using the sample scripts, you must edit them.
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.
:EMAIL rem \-\- rem \-\- BLAT based eMail rem \-\- rem set email_file=c:\blat\mtext%AS_PARAMETER_NAME%_%AS_SSTIME%.txt rem if ."%AS_USERDEFINED%"==."" echo "%nmsg%" > %email_file% rem if not ."%AS_USERDEFINED%"==."" echo "%AS_USERDEFINED%" > %email_file% rem if .%email_file%==. set email_file=c:\blat\default.txt rem if exist c:\blat\blat.exe c:\blat\blat %email_file% \-t %ntargets% \-s %nmsg% rem 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.
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 (#):
#system("c:\\blat\\blat.exe $email_file -t \"$ntargets\" -s \"$nmsg\"");
To use the SMTP VB Script (sendmail.vbs ), you must edit the script to add the following information:
Add this information in the script as shown in the following code block:
' Enter the Mail Server name [FQDN/IP Address] 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
If you use Blat and Blat is not installed in the C:\Blat directory, you must edit the script to indicate the appropriate path.
Before you can use PATROL for Microsoft Windows Servers, you must gather information and plan your configuration. You should gather the following information: