Scheduling Alerts
HVR can send alert notification if a problem affects replication. Alerts can also be configured to send notification if the replication latency (the delay between capturing a change and delivering that change to the target) exceeds an SLA (Service Level Agreement). Alerts are sent by a separate process called hvralertmanager, which should be scheduled to run at a fixed frequency.
The hvralertmanager command is responsible for the execution of all alerts that have been configured on a HVR Hub System (across all (logical) hubs). Alerts that are disabled or belonging to a frozen hub will not be executed.
Alerts can be created either using the command hvralertconfig or using the User Interface Alerts page.
Every alert, depending on its configured properties, will scan the hub log files and send notifications (email, Slack, etc.) if any error or warning is found (including a latency check).
hvralertmanager can be scheduled to run at certain time intervals for monitoring the status of the HVR system.
Linux
In Linux, hvralertmanager can be scheduled to run using crontab.
Following is an example to check alerts every 10 minutes.
Add the following line to the crontab for user root (these should be single line without wrapping):
0,10,20,30,40,50 * * * * su - hvr -c '/home/fivetran/hvr_home/bin/hvr -EHVR_HOME=/home/fivetran/hvr_home -EHVR_CONFIG=/home/fivetran/hvr_config hvralertmanager'
Alternatively, the crontab can be run directly as the Fivetran user. Typically, the Fivetran user does not have this permission, unless it is named in file /etc/cron.allow, or file /etc/cron.deny exists. In that case the following line should be added to crontab for Fivetran user (e.g. fivetran):
0,10,20,30,40,50 * * * * /home/fivetran/hvr_home/bin/hvr -EHVR_HOME=/home/fivetran/hvr_home -EHVR_CONFIG=/home/fivetran/hvr_config hvralertmanager
Output/error redirection to cronout.log is optional.
- To verify that hvralertmanager is running correctly, check 10 minutes later that lines are being written to file alertmanager.out available in HVR_CONFIG/logs directory.
Windows
In Windows, hvralertmanager can be scheduled to run using Windows Scheduled Task.
Following is an example to check alerts every 10 minutes.
You can use either of the following two methods for creating Windows Scheduled Task.
Method 1: Create Windows Scheduled Task using CLI.
schtasks /create /sc minute /mo 10 /tn Fivetran_Alert /tr C:\fivetran\hvr_home\bin\hvralertmanager.exe
Method 2: Create Windows Scheduled Task using GUI.
Open Task Scheduler. This can be accessed from Control Panel ▶ Administrative Tools
Alternatively, Task Scheduler can be accessed by running (Winkey+r) taskschd.msc.
Click Action ▶ Create Task
In General tab, enter task Name, and optionally a task Description.
In Actions tab, click New... to open New Action dialog.
Browse and select the directory path for hvralertmanager.exe (available in HVR_HOME\bin) and click OK.
In Triggers tab, click New... to open New Trigger dialog.
Select the required frequency at which this task should be executed. For example, to execute this task every 10 minutes:
Click OK in Create Task dialog.
To verify that hvralertmanager is running correctly, check 10 minutes later that lines are being written to file alertmanager.out available in HVR_CONFIG\logs directory.