Page tree

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:

  • 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 Visual Basic (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.
  • Perl script that sends e-mail notification by means of Blat.

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.

Default script 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

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

Script 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

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.

Editing scripts

Before using the sample scripts, you must edit them.

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.

: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.

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 (#):

#system("c:\\blat\\blat.exe $email_file -t \"$ntargets\" -s \"$nmsg\"");

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 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 

Editing scripts when using Blat

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:

  • Which servers will send notifications (act as notification servers)
  • To whom e-mail or paging notifications are sent (targets)
  • Which servers will monitor the notification servers for availability
  • Which notification servers will be monitored for availability
  • Where to place notification rules (notification server or monitored agent)
  • No labels