Triggers
Triggers are used to trigger actions based on the status of your monitors. You can use triggers to send notifications, or call webhooks when a monitor goes down or up.
Name
REQUIREDThe name is used to define the name of the webhook. It is required and has to be a string.
Description
The description is used to define the description of the webhook. It is optional and has to be a string.
Kener supports the following triggers:
Webhook
Webhook triggers are used to send a HTTP POST request to a URL when a monitor goes down or up.
URL
REQUIREDThe URL is used to define the URL of the webhook. It is required and has to be a valid URL.
You can also pass secrets that are set in the environment variables.
Example: https://example.com/webhook?secret=$SECRET_X
. Make sure $SECRET_X
is set in the environment variables.
Method
Method will always be POST
Headers
The headers are used to define the headers that should be sent with the request. It is optional and has to be a valid JSON object. You can add secrets that are set in the environment variables.
Example: Authorization: Bearer $SECRET_Y
. Make sure $SECRET_Y
is set in the environment variables.
While sending webhook kener will add two more headers: Content-Type: application/json
and User-Agent: Kener/3.0.0
.
Body
Body of the webhook will be sent as below:
{
"id": "mockoon-9",
"alert_name": "Mockoon DOWN",
"severity": "critical",
"status": "TRIGGERED",
"source": "Kener",
"timestamp": "2024-11-27T04:55:00.369Z",
"description": "🚨 **Service Alert**: Check the details below",
"details": {
"metric": "Mockoon",
"current_value": 1,
"threshold": 1
},
"actions": [
{
"text": "View Monitor",
"url": "https://kener.ing/monitor-mockoon"
}
]
}
Key | Description |
---|---|
id | Unique ID of the alert |
alert_name | Name of the alert |
severity | Severity of the alert. Can be critical , warn |
status | Status of the alert. Can be TRIGGERED , RESOLVED |
source | Source of the alert. Can be Kener |
timestamp | Timestamp of the alert |
description | Description of the alert. This you can customize. See below |
details | Details of the alert. |
details.metric | Name of the monitor |
details.current_value | Current value of the monitor |
details.threshold | Alert trigger threshold of the monitor |
actions | Actions to be taken. Link to view the monitor. |
Discord
Discord triggers are used to send a message to a discord channel when a monitor goes down or up.
Discord URL
REQUIREDThe Discord URL is used to define the URL of the discord webhook. It is required and has to be a valid URL.
How to get the Discord URL?
- Go to your discord server
- Right-click on the channel you want to send the messages
- Click on
Edit Channel
- Go to
Integrations
- Click on
Create Webhook
- Copy the URL
Discord Message
The discord message when alert is TRIGGERED
will look like this
The discord message when alert is RESOLVED
will look like this
Slack
Slack triggers are used to send a message to a slack channel when a monitor goes down or up.
Slack URL
REQUIREDThe Slack URL is used to define the URL of the slack webhook. It is required and has to be a valid URL.
How to get the Slack URL?
- Go to your slack workspace
- Click on
Apps
on the left sidebar - Search for
Incoming Webhooks
- Click on
Add to Slack
- Select the channel you want to send the messages
- Click on
Add Incoming Webhook Integration
- Copy the URL
Slack Message
The slack message when alert is TRIGGERED
will look like this
The slack message when alert is RESOLVED
will look like this
Email triggers are used to send an email when a monitor goes down or up.
Note
Please make sure you have set the RESEND_API_KEY
in the environment variables.
To
REQUIREDThe email addresses to which the email should be sent. It is required and has to be a valid email addresses. You can pass multiple email addresses separated by a comma.
Sender
The email address from which the email should be sent.
It should be in the format Name <email@address.com>
If you have not connected your domain with resend, then use Some Name <onboarding@resend.dev>
Subject
Subject of the email when TRIGGERED
[TRIGGERED] Mockoon DOWN at 2024-12-27T04:42:01.430Z
Subject of the email when RESOLVED
[RESOLVED] Mockoon DOWN at 2024-12-27T04:42:01.430Z
Body
The emaik message when alert is TRIGGERED
will look like this
The emaik message when alert is RESOLVED
will look like this
Edit Triggers
Click on the ⚙️ to edit the trigger.
Deactivate Trigger
You can deactivate the trigger by switching the toggle to off. You cannot send message to a deactivated trigger. Any monitor with this trigger will not send any notifications.