Integrations with Slack, Rocket.Chat, and Webhook for Notifications
Support Statement
This documentation is provided "as is" without support for 3rd party software. The level of support for this integration guide is best effort without any SLA on response time. No 3rd party product support can be provided by Superna directly. 3rd party components require support contracts. See EULA for more details.
Limitations
All of these options require transparent NAT to reach the Internet services. No support for OS proxy is available for this notification option.
Configure Slack Channel Notifications
- Go to
https://<your-domain>.slack.com/apps/manage/custom-integrationsas admin. - Select Incoming WebHooks.
- Configure the integration and select the channel to receive alarms.
- Copy the Webhook URL for use in the Eyeglass configuration.
The Slack Incoming WebHooks configuration page shows a form with the following fields: Post to Channel (dropdown to select the target channel), Webhook URL (auto-generated URL to copy), and Customize Name and Customize Icon (optional display settings for the bot).
- Log in to Eyeglass.
- Open Settings (gear icon, top-right of any page) → Notifications.
- Select the Slack tab.
- Set the Webhook URL created above.
- Set the alarm levels to send to the channel.
The Slack tab under Settings → Notifications shows a text field for the Webhook URL and a set of checkboxes for alarm severity levels: Critical, Error, Warning, and Informational. Select the severity levels you want forwarded to the Slack channel.
This includes DR events from Eyeglass and PowerScale events that are polled from the cluster.
Configure Webhooks
Webhooks use HTTP POST commands to send events to any system that supports this interface.
- Open Settings (gear icon, top-right of any page) → Notifications.
- Click the Webhooks tab.
The Webhooks tab shows a list of configured webhook endpoints. Each row displays the target URL, the configured headers, and a Test button.
- Enter the URL of the target system to receive the POST command.
- Click + Headers to enter any key-value pairs required by the upstream system.
The + Headers section expands to show a key-value pair input form. Enter the header name in the Key field and the header value in the Value field. Common examples include Content-Type: application/json or custom authentication headers required by the target system.
- Click Test to verify the upstream system received the test event.
- All Eyeglass and PowerScale alarms will now be sent as webhooks.
Configure Rocket.Chat Notifications
- Go to https://www.rocket.chat and sign up or create an account.
- Follow the steps to integrate incoming webhooks.
Webhook Payload Schema
Webhooks deliver Eyeglass notifications in JSON format. The following is the alarm object schema:
{
"Alarm": {
"type": "object",
"properties": {
"source": {
"description": "the source of the alarm",
"type": "string"
},
"timestamp": {
"description": "The timestamp when alarm was raised",
"type": "integer",
"format": "int64"
},
"severity": {
"description": "severity of the alarm",
"type": "string"
},
"sync_key": {
"description": "sync_key",
"type": "string"
},
"sync_group": {
"description": "sync_group",
"type": "string"
},
"message": {
"description": "message",
"type": "string"
},
"code": {
"description": "code",
"type": "string"
},
"extra_data": {
"description": "alarm extra data",
"type": "string"
}
}
}
}
Webhook Payload Common Properties
| Element | Type | Description |
|---|---|---|
| alarm | object | The alarm that triggered the event. This property is included in every webhook payload. |
Example Payloads
The following examples show the Eyeglass notification JSON output that is posted to any webhook URL. Use these to integrate any third-party chat application incoming webhooks to post messages in a specific chat group.
Example 1 — Maximum Values:
{
"source": "Sample Source",
"timestamp": 1667995921023,
"severity": "INFORMATIONAL",
"sync_key": "sbeca3_3",
"message": "Actual Message",
"code": "RSW0010",
"extra_data": "{\"reason\":\"Node sbeca3_3 version does not correspond to eyeglass version\"}"
}
Example 2 — Minimal Values:
{
"source": "",
"timestamp": 1667995921023,
"severity": "INFORMATIONAL",
"sync_key": "",
"message": "",
"code": "RSW0010",
"extra_data": "{}"
}
Rocket.Chat Incoming Webhook Script
These fields can be mapped to the respective webhook message schema to construct useful message events. The following Rocket.Chat incoming webhook configuration script uses these fields to send incoming messages to a specific group:
class Script {
/**
* @params {object} request
*/
process_incoming_request({ request }) {
console.log(request.content_raw);
let msg = request.content_raw.message;
let severity = request.content_raw.severity;
let code = request.content_raw.code;
let sk = request.content_raw.sync_key || 'No Source';
let reason = request.content_raw.extra_data === '{}'
? ''
: JSON.parse(request.content_raw.extra_data).reason;
let txt = severity + ' | ' + code + ' | ' + sk;
if (msg !== '') {
txt += ' | ' + msg;
}
if (reason !== '') {
txt += ' | ' + reason;
}
return {
content: {
text: txt
}
};
}
}