Configuring the Email Alerts Service allows you to set up automatic notifications for key events and system updates. By defining the alert criteria and specifying email recipients, you ensure that relevant stakeholders are promptly informed. This service can be customized to trigger notifications based on specific conditions, such as system errors, updates, or user activity, enhancing communication and operational efficiency.
To configure alerts, run the following steps:
To enable email alerts, add the following settings to the dashboard.properties file located in the <install-path>/CONFIGURATION/HERO directory.
If you are using the default installation path, the file can be found at: /opt/hcl/hero/CONFIGURATION/HERO.
|
alertSmtpEmail |
The sender email account [Example: username@gmail.com] . |
|
alertSmtpPassword |
The password associated to the sender email account. |
|
smtpPasswordEncrypted |
Set encryption for the alertSmtpPassword. Can be "true" or "false". If smtp is configured through HERO installation script, the value of smtpPasswordEncrypted parameter is set to "true" (default value). If you configure smtp manually, you must set smtpPasswordEncrypted to "false". |
|
alertSmtpServer |
Fully qualified hostname of the SMTP Server that will be used by HERO to send alerts by email [Example: smtp.gmail.com] |
|
alertSmtpPort |
The port of the SMTP mail server. |
|
smtpTlsEnabled |
Set the TLS enablement for smtp client while establishing a connection from HERO. Can be "true" or "false". Default value is "true". |
Configure the target email in the Alert.js file located in the <install-path>/CONFIGURATION/HERO/Alerting directory.
If you're using the default installation path, the file can be found at:
/opt/hcl/hero/CONFIGURATION/HERO/Alerting.
Update the Targets Field
Add or modify the email addresses in the targets field as demonstrated below:
[
{
var alerts = [
{
"component" : "ENV",
"state" : "ERROR",
"action" : "SEND_EMAIL",
"subject" : "Environment in error",
"message" : "The environment %ENV_NAME% type %ENV_TYPE% is in error",
"targets" : "email1@example.com;email2@example.com"
},
{
"component" : "ENV",
"state" : "WARNING",
"action" : "SEND_EMAIL",
"subject" : "Environment in warning",
"message" : "The environment %ENV_NAME% type %ENV_TYPE% is in warning",
"targets" : "email1@example.com;email2@example.com"
}
];
Replace email1@example.com and email2@example.com with the actual email addresses you want to use as the recipients.
Restart Hero Docker Containers
Navigate to the <install-dir>/hero and execute the following commands to stop and start the Docker containers:
docker-compose stop
docker-compose start
By default, the installation directory is:
/opt/hcl/hero
Note: Ensure that the docker-compose.yml file is located in the <install-dir>/hero directory.