After you deploy OCP, you need to configure the alert notification channel and subscribe to the alerts so that you can receive alerts through the configured channel.
Background
The operation interface of OCP may vary with the version. The following describes how to configure alerts on OCP V2.4.4. For operations on OCP of other versions, see the OCP User Guide of the corresponding version.
Prerequisites
You have configured the basic information of the recipients.
If you use a custom script to create an alert notification channel with Configuration Method being Configure Script Name , ensure that the custom script file is stored in the
/home/admindirectory on each OCP service node.The content of the script need to meet the following requirements:
The script is a Bash or Python script.
The first line of the script content must contain Shebang (#!)to specify the execution program.
For the configuration example of a custom script, navigate the User Guide of OCP V2.4.x in the following path: Alert Management > Configure the alert channel > Configuration examples .
Procedure
Log on to the OCP console.
In the left-side navigation pane, choose System Management > Alerts .
On the Alert Channel Configuration page, click Create Channel .
Set basic information about the channel, and click Next .

The following table describes the parameters for setting the basic information about the channel.
Parameter Description Channel Name Specifies the name of the channel. Recipient Field Can be set to the user ID, email address, mobile phone number, or employee number. The recipient field is associated with the Basic Information of the OCP user. Channel Type Can be set to HTTP or a custom script. Group Message Channel If you select Yes, the system pushes notifications even when no one subscribes to the alerts. If you select No, the system pushes messages to users who have subscribed to the corresponding alerts based on the Recipient Field. Set Notification Content and click Next .

The following table describes the parameters for setting the notification content.
Parameter Description Alert Message Template Variables are supported in the alert message template. You can define custom alerts as prompted. Alert Message Aggregation Alert message aggregation can help you avoid missing important messages when you receive too many messages in a short time. You can check the aggregation rule as prompted. If you enable message aggregation, you must also configure the parameters such as the aggregation message template. Configure the channel. The parameters required vary with the channel type that you select.
If you select HTTP , configure the channel as follows:

The following table describes the parameters for setting the channel.
Parameter Description Request Method Specifies the way of sending requests. Post, Get, and Put methods are supported. Proxy If you do not specify this field, no proxy is used. URL Template You can enter $ and {} to reference variables in the template. Header Template You can enter $ and {} to reference variables in the template. If this parameter is left empty, the Header parameter does not apply. Body Template Variables can be referenced. By default, ${message} is used, indicating that the alert message template is referenced in the content of the Body template. If you set Channel Type to Custom Script , set the parameters as follows: The default value of Configuration Method is Configure Script Content . If you use the default value, enter the content of the script.

If the script file has been saved to the
/home/admindirectory, you can also set Configuration Method to Configure Script Name and enter the script file name.The script file name can contain only letters, digits, underscores (_), and dots (.)in half width.
To avoid shell injection risks caused by the script name field, spaces and tab characters are not allowed for the script name field.

After the configuration is complete, click Send Test Message and select the message recipient. Enter the message content, and then click OK . If the message is sent, click Submit . When OCP sends a notification through the script channel, OCP calls the configured script and passes all variables related to the notification to the script by using the environment variables. For more information about notification variables, see section OCP alert template variables in the User Guide of OCP V2.4.x.