Configure Pro2 email notifications
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
You can configure Pro2 to send email 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, irrespective 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, an email notification is triggered. Note: The heartbeat functionality (with email alarm) is applicable for both
replication and CDC admin threads.
To set up Pro2 email alarms, use the following procedure:
- Edit the predefs.i file
located in the Pro2 root directory and define the following email properties:
- FROM-EMAIL-ADDR—the email address of the sender of the email alert.
- TO-EMAIL-ADDR—the email address of the recipient of the email alert.
- COMPANY-MAIL-SERVER—the SMTP mail server of the sender of the email alert.
- In the Pro2 web UI Properties tab, designate a user name and password by using the SMTP AUTH. 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 email notification
StatusCheck sends only one email
notification per day by default. After the email is received and replication is
restarted, you can reset the notification to alert you if replication unexpectedly
stops again on that same day.
To do this reset the email notification, use the following
procedure:
- In the web UI, go to the Actions tab and select Tools.
- Select Reset Alarm.
To remove the restriction of one notification per day, use the following procedure:
- In the web UI, go to the Properties tab.
- Set the value of the
ALERT_1_PER_DAYproperty to NO.
Set up third-party email program
If you want to use a third-party command-line email program like Blat,
perform the following steps:
- Set the property
USE_3RD_PARTY_EMAILto Yes in the Pro2 web UI. - Edit the mail.bat located
in bprepl/scripts and modify the batch
script to send the email. For example for Blat, you would use the following
statement:
blat -to %1 -subject %2 -body %3 -from %4 -server %5 -q
Note: The argument values (%1, %2) are variables which are populated by
the
smtpmail.p procedure, so you need to
pass the appropriate variable to the arguments of your command-line email
program. For example, %1 denotes the email recipient address, %2 denotes the
subject of the email, and so on. The mail.bat
file contains remarks which explain the purpose of each the variables.