Administration Guides
Integrations with Slack, rocket.chat and Webhook for Notifications of Eyeglass Monitoring Events
Home




Limitations of Slack, Webhook, Twitter Notifications

  1. All of these options require transparent NAT to reach the Internet services.  No support for OS proxy is available for this notification option.

How to configure Slack channel PowerScale events AND Eyeglass events

  1. Go to https://superna.slack.com/apps/manage/custom-integrations   (for your domain) as admin.
  2. Select Incoming WebHooks.
  3. Configure as per the screenshot and pick the channel to receive alarms.
  4. Cut and paste the Webhook URL for configuration in Eyeglass.

  1. Login to Eyeglass.
  2. Open notification centre.
  3. Select the Slack tab.
  4. Set the Webhook URL created above.
  5. Set the level alarms that will be sent to the channel.

Note: This includes DR events from Eyeglass and PowerScale events that are polled from the cluster.

Webhooks

Webhooks use http post commands to send events to any system that supports this interface.

  1. Open notification centre.
  2. Click the Webhooks tab.

  1. Enter the URL of the target system to receive the post command.
  2. Click plus headers to enter any key-value pairs needed to send to the upstream system
  3. Once completed test with the test button and verify with the upstream system the test even was sent.
  4. Now all alarms Eyeglass and PowerScale will be sent as Webhooks.



How to Configure rocket.chat Alarms

Rocket.chat App Setup: 

  1. https://www.rocket.chat/ and sign up or create an account. 

  2. Follow the steps to integrate webhooks

Example webhook payload

Webhooks deliver the responses to your typeforms in JSON format. Let's walk through each object in a typical webhook payload. First, here's what a complete payload looks like when it's delivered to a webhook:

"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"
                }

Rocket.chat Webhook payload object common properties

Each webhook event payload also contains properties unique to the event. You can find the unique properties in the individual event type sections.


element

type 

description

alarm

object

The user that triggered the event. This property is included in every webhook payload




Description


Followings are the example of Eyeglass notification JSON output which gets posted on any Webhook URL. This information will help the dev/support team to integrate any third party Chat Application incoming webhooks to post messages in a specific Chat Group.

Example 1: (Maximum Values)

1{  
2 source: 'Sample Source',
3 timestamp: 1667995921023,
4 severity: 'INFORMATIONAL',
5 sync_key: 'sbeca3_3',
6 message: 'Actual Message',
7 code: 'RSW0010',
8 extra_data: '{"reason":"Node sbeca3_3 version does not correspond to eyeglass version"}'
9}


Example 2: (Minimal Values)

1{  
2 source: '',
3 timestamp: 1667995921023,
4 severity: 'INFORMATIONAL',
5 sync_key: '',
6 message: '',
7 code: 'RSW0010',
8 extra_data: '{}'
9}

These fields can be mapped to respective webhook message schema to construct useful message events.

For example, Rocket.Chat application incoming webhook configuration script below uses these fields to send incoming messages in a specific group:

1class Script {
2  /**
3   * @params {object} request
4   */
5  process_incoming_request({ request }) {
6    console.log(request.content);
7
8 let msg = request.content.message;
9 let severity = request.content.severity;
10 let code = request.content.code;
11 let sk = request.content.sync_key || 'No Source';
12 let reason = request.content.extra_data === '{}' ? '': JSON.parse(request.content.extra_data).reason;
13 let txt = severity + ' | ' + code + ' | ' + sk;
15 if(msg !== ''){
16 txt += ' | ' + msg;
17 }
18
19 if(reason !== ''){
20 txt += ' | ' +  reason;
21 }
22
23    return {
24      content:{
25        text: txt
26       }
27    };
28  }
29}

 


 © Superna Inc