Configure Pro2 e-mail notifications
- Last Updated: April 22, 2020
- 2 minute read
You can configure Pro2 to send e-mail notifications when a replication thread
stalls or stops. To do this, Pro2 compares the timestamp of the thread’s most recent
replication activity (a heartbeat) against a configurable time period, regardless of the
HEARTBEAT_CHECK _MINUTES property. The default time
period is 10 seconds. If the last recorded activity of the thread is more than 10
seconds from the time of comparison, then an e-mail notification is triggered. Note: The heartbeat functionality
(with e-mail alarm) is applicable for both replication and CDC administrator
threads.
To set up Pro2 e-mail alarms:
- Edit the predefs.i file
located in the Pro2 root directory and define the following e-mail
properties:
FROM-EMAIL-ADDR—The e-mail address of the sender of the e-mail alertTO-EMAIL-ADDR—The e-mail address of the recipient of the e-mail alertCOMPANY-MAIL-SERVER—The SMTP mail server of the sender of the e-mail alert
- On the Pro2 web interface Properties tab, designate a user name and password by using the SMTP AUTH field. The user name and password should be separated by a comma.
- Create a new task in Windows Task Scheduler to periodically run a batch file called statusCheck.bat.
Reset the e-mail notification
StatusCheck sends only one e-mail
notification per day by default. After the e-mail is received and replication is
restarted, you can reset the notification to alert you if replication unexpectedly
stops again on that same day.
To reset the e-mail notification:
- In the Pro2 web interface, go to the Actions tab and select Tools.
- Select Reset Alarm.
To remove the restriction of one notification per day:
- In the Pro2 web interface, go to the Properties tab.
- Set the value of the
ALERT_1_PER_DAYproperty to NO.
Set up third-party e-mail program
To use a third-party command-line e-mail program like Blat:
- In the Pro2 web interface, go to the Properties tab.
- Set the property
USE_3RD_PARTY_EMAILto YES. - Edit the mail.bat file
located in bprepl/scripts, and modify
the batch script to send the e-mail. For example, for Blat, use the
following statement:
blat -to %1 -subject %2 -body %3 -from %4 -server %5 -q
Note: The argument
values (
%1, %2) are variables that are
populated by the smtpmail.p procedure, so you
need to pass the appropriate variable to the arguments of your command-line
e-mail program. For example, %1 denotes the e-mail recipient
address, %2 denotes the subject of the e-mail, and so on. The
mail.bat file contains remarks that explain
the purpose of each the variables.