In IT operations, timely and relevant notifications are crucial for effective incident management. Dotcom-Monitor offers the flexibility to customize alert notifications according to specific monitoring event statuses, such as errors (Alerting) or recovery (OK) events. The customization described in this article ensures that the right stakeholders receive relevant information promptly.
Configuring Delivery Addresses for Specific Event Types
For the purpose of this article, we will use email delivery addresses. However, the described approach is applicable to other types of delivery addresses.
To direct alert notifications based on monitoring response statuses, follow these steps:
- Create a Delivery Address Group.
- Add an Email Address for Error Notifications:
- Within the group, add a new email address designated for error alerts.
- Access the address’s advanced settings and select the Alerting alert type.
- Customize the subject line and message body by creating new templates, as detailed in the Alert Templates Guide.
- Save the settings to apply your configurations.
- Add an Email Address for Recovery Notifications:
- In the same group, add another email address intended for recovery (Uptime) alerts.
- Even if using the same email address as in step 2, differentiate the notification type by selecting the OK alert type in the advanced settings.
- Customize the subject and message templates accordingly.
- Save the settings to finalize the configuration.
With this setup, the specified email addresses will receive tailored notifications corresponding to the monitoring events (errors or recovery response statuses).
Utilizing Conditional Alert Templates for Large Recipient Groups
For scenarios involving a large group of recipients requiring notifications with content that varies based on the monitoring response status, we recommend using conditional logic within a single alert template. This method ensures consistency and reduces the need for multiple templates.
In the templates provided below, the @switch
statement evaluates the Model.AlertType
to determine the type of the monitoring event (whether it’s an error or an uptime notification) and modifies the subject and message content accordingly.
Conditional Subject Template
@switch (Model.AlertType) { case Dotcom.Reporting.Common.NotificationType.Error: <text> ERROR alert for device "@Model.Site_Name" </text> break; case Dotcom.Reporting.Common.NotificationType.Uptime: <text> UPTIME alert for device "@Model.Site_Name" </text> break; }
Conditional Message Template
@switch (Model.AlertType) { case Dotcom.Reporting.Common.NotificationType.Error: <text> Device: "@Model.Site_Name" AlertType: Error </text> break; case Dotcom.Reporting.Common.NotificationType.Uptime: <text> Device: "@Model.Site_Name" AlertType: Uptime </text> break; }