hvralertmanager
Usage
hvralertmanager
Desсription
The hvralertmanager command is responsible for the execution of all alerts that have been configured on a hub server (across all the hubs). Alerts that are disabled or belonging to a frozen hub will not be executed.
Alerts can be created either using the hvralertconfig command 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).
When executed, this command produces a log file in HVR_CONFIG/logs/hvralertmanager.out. Additionally every single alert will produce a log file in HVR_CONFIG/hubs/hub/logs/hvralert.alertout. Command hvralertmanager will also take care of rotating these log files, when appropriate, into the respective log archive directories.
Scheduling hvralertmanager
hvralertmanager can be scheduled to run at certain time intervals for monitoring the status of the HVR Hub 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/myhvr/hvr_home/bin/hvr -EHVR_HOME=/home/myhvr/hvr_home -EHVR_CONFIG=/home/myhvr/hvr_config hvralertmanager'
Alternatively, the crontab can be run directly as the HVR user. Typically, the 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 the user (e.g. myhvr):
0,10,20,30,40,50 * * * * /home/myhvr/hvr_home/bin/hvr -EHVR_HOME=/home/myhvr/hvr_home -EHVR_CONFIG=/home/myhvr/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.
C:\>schtasks /create /sc minute /mo 10 /tn HVR_Alert /tr C:\hvr\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.