How to send notifications to a Stride room?

How can one configure notifications sent to a Stride room?

Q: I am switching to Stride messaging suite; can I send IPHost alert notifications to a Stride room?

A: Yes, you can. Stride from Atlassian is a HipChat successor. The below tutorial explains how to post IPHost Network monitor alert notifications to any Stride room. We will create custom application token and send messages using corresponding Stride API.

1. Obtain API token

Create a new room or use an existing room. Navigate to Apps (grey “+” in top right corner)

Stride notifications - open apps

Select the very first item, “Connect your own app”.

Stride notifications - connect app

Specify token name and create a token:

Stride notifications - create token

On the next screen we are interested in curl command. Copy it to a text editor.

Stride notifications - copy cURL command

2. Create Send HTTP(S) request action

Now open IPHost GUI client and create new “Send HTTP(S) request” action (click “Alerting > Alerts”, select “Simple Actions” tab):

Stride notifications - create HTTP(S) request action

In this action, use the keys from the above mentioned curl command, and define JSON payload using the variables:

Stride notifications - create Send HTTP(S) simple action

  • Copy URL from –url option of a curl command
  • Copy HTTP headers specified in two -H options to custom HTTP headers
  • Use the following message payload:
    {
      "version": 1,
      "type": "doc",
      "content": [
        {
          "type": "applicationCard",
          "attrs": {
            "text": "unused",
            "link": {"url": "$MonitorReportUrl"},
            "collapsible": true,
            "title": {
              "text": "$MonitorName on $HostName: $EventShortDescription $Duration | since $Time",
              "user": {
                "icon": {
                  "url": "//cdn.iphostmonitor.com/images/icons/40x40/$NewState.png",
                  "label": "$NewState"
                }
              }
            },
            "description": {"text": "$EventDetails, click to see report"}
          }
        }
      ]
    }
    
    
  • Add 201 to Accepted response codes (Stride uses HTTP 201 Created to report operation success)

Note that

  • link to report will only work if Web interface is served over secure (HTTPS) protocol, otherwise Stride will refuse the whole alert message; thus you should either configure HTTPS in “Settings > Web Interface”, or remove “link” JSON element from message template above
  • when link is configured, it becomes possible to click any application card to open a report for the monitor that caused this alert.

Now create new alert using this simple action:

Stride notifications - create alert

Alternatively, you can add this simple action to any existing alert.

Finally, create new alerting rule with this alert. We create the one that issues given alert when monitor transitions from OK to Warning state and back. You can also use it for Down State Alerts.

Stride notifications - create alerting rule

Alternatively, you can use Stride alert in any existing alerting rule.

Assign this alerting rule to some monitors. For example, assign it to “All Agents” tree node in Main view, this way it will be inherited by all monitors, unless explicitly overridden.

3. Test Stride notifications

Now that Post to Stride ”Alerts” room action has been added to alerts, try putting a monitor to Warning state and back (by altering its “State conditions” and polling the monitor), or use “Alerting > Testing” tab to simulate alert execution. For example, you can set Response Time Limit for a PING monitor to 0 to switch it to Warning state and to 1 (one second) to switch it back to OK state.

If Stride integration has been done correctly, you will see something like below in your Stride room. In this case, Stride alerts are also executed for state transitions from / to Down state.

Stride notifications - test notifications

Related topics