You can send Up and Down alerts from Dotcom-Monitor to a Google Chat space by configuring a Webhook delivery address and using custom JSON alert templates.
Before you begin, create an incoming webhook for your Google Chat space and copy its webhook URL.
Step 1: Create Alert Templates
Login to your Dotcom-Monitor account and create separate alert templates for Down and Up notifications.
Create the Down Alert Template
The Down template will be used when a monitoring device enters the Down state (an alert is generated).
- On the left-side navigation menu, select to Manage > Custom Alert Templates.
- Click Add New Template.
- Select JSON as the template format.
- Enter the JSON message body. The message text must be specified in the text field.
- In the template, use Dotcom-Monitor system variables to include dynamic information such as the device name, error details, and outage time. For a list of available variables, see Dotcom-Monitor System Variables.
- Save the template.
- Repeat the same steps to create a second template for Up notifications.
Example Down Template
{
"text": "Monitoring Device: @Model.Site_Name\nService: @Model.FirstErrorResponse.Task.Name\nError Type: @Model.FirstErrorResponse.AllErrors[0].ErrorType\nError Code: @Model.FirstErrorResponse.AllErrors[0].ErrorCode\nDescription: @Model.FirstErrorResponse.AllErrors[0].Reason\nOutage Started: @Model.CurrentState.StartTime"
}
Create the Up Alert Template
Create a second template to be sent when the monitoring device recovers and returns to the Up state.
Repeat the steps above, modifying the message to indicate that the device is online again.
Example Up Template
{
"text": "Service: @Model.Site_Name\nStatus: Online\nRecovery Time: @Model.CurrentState.StartTime"
}
Step 2: Create a Delivery Address Group
Next, configure a Delivery Address Group containing two webhook delivery addresses:
- Google Chat (DOWN) – sends notifications when a device enters the Down state.
- Google Chat (UP) – sends notifications when a device returns to the Up state.
To add the group follow the below steps:
- Navigate to Manage > Delivery Address Groups.
- Create a new delivery address group.
- Add a new Webhook delivery address.
- Paste your Google Chat webhook URL.
- Set Request Type to POST.
- Add the following request header: Content-Type: application/json; charset=UTF-8
- Under Post Data:
- Set Data Type to Raw.
- Set Content Type to JSON.
- Select Alert Template as the body type.
- Choose the Down alert template you created earlier.
- Expand Advanced Settings and set Delivery On to Alerting.
- Save the delivery address.
Repeat these steps to create the UP webhook delivery address, selecting the Up alert template and configuring it to send notifications when the device recovers (in the Advanced Settings, set Delivery On to Ok).
Step 3: Assign the Delivery Address Group
To start receiving Google Chat notifications, assign the Delivery Address Group to your monitoring device.
You can do this in either of the following ways:
- Assign the device from the Assigned Devices section of the Delivery Address Group settings.
- Assign the Delivery Address Group from the monitoring device’s Alert settings.
Once the group is assigned, Dotcom-Monitor will send Down and Up notifications to your Google Chat space using the configured webhook.
