Kurt Wolf

Microsoft Teams

Recommended Posts

I just sent out an email with some attached instructions for both of you - we're working on some more formal documentation, but I wanted to get it out there so you could use it!

Let me know how it goes - if others are interested, reply here and I can send over the same doc - and eventually I'll post a link to the official docs when they're ready.

Best,

Kerry

Share this post


Link to post
Share on other sites

I would be interested to see what this documentation looks like.  We have the email to Teams integration configured.  If there is a different way to do this, it would be very interested. 

Share this post


Link to post
Share on other sites

Hi All!

I've tested this and it works. No reply options yet, but it's a start

Create a channel for webhooks in Teams copy that adress and use it in your Integration ( I copied a Slack integration)

And I've used the following JSON formatting

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "themeColor": "ff0000",
    "title": "Company - LM Webhook Test",
    "text":"Alerts!",
    "sections": [{
        "activityTitle": "Action Required!",
        "activitySubtitle": "Here are the details",
        "Facts": [{
            "name": "Host:",
            "value": "##HOST##"
        }, {
            "name": "Datasource",
            "value": "##DATASOURCE##"
        }, {
            "name": "Displayname:",
            "value": "##system.displayname##"
        }, {
            "name": "InstanceGroup:",
            "value": "##INSTANCEGROUP##"
        }, {
            "name": "Datapoint:",
            "value": "##DATAPOINT##"
        }, {
            "name": "Datapoint Description:",
            "value": "##DPDESCRIPTION##"
        }, {
            "name": "Level:",
            "value": "##LEVEL##"
        }, {
            "name": "Start:",
            "value": "##START##"
        }, {
            "name": "Duration:",
            "value": "##DURATION##"
        }, {
            "name": "Value:",
            "value": "##VALUE##"
        }, {
            "name": "Threshold:",
            "value": "##THRESHOLD##"
        }, {
            "name": "ClearValue:",
            "value": "##CLEARVALUE##"
        }, {
            "name": "Reason:",
            "value": "##DATAPOINT## ##THRESHOLD##"
        }, {
            "name": "Group:",
            "value": "##GROUP##"
        }],
        "markdown": true
    }]
}

Share this post


Link to post
Share on other sites

Hey Guys,

Give me a couple hours to see if I can't make our instructions publicly accessible today - I can see now there's plenty of demand and we've had another go at cleaning them up so I will see what I can't get posted.

Have a couple meetings this morning but can follow up a bit later. Appreciate the patience ... !

Best,

Kerry

Share this post


Link to post
Share on other sites

Issue

Microsoft Teams is Microsoft's offering in the collaboration tools/ group chat space. Much like Slack or other similar tools, they provide an API interface for posting alerts to a Microsoft Teams channel.

Resolution

Screenshots of some of these steps are available down below after the code blocks.

  • - Add a new Custom Webhook Integration into LogicMonitor.
  • - "Use different URLs or data formats to notify on various alert activity."
  • - Insert the relevant payloads from the code sections below into each of the custom webhook stages.
  • - Once you've setup the Integration, you'll need to get the webhook URLs from Microsoft Teams as follows:
  • That should be it! Setup an escalation chain with your Integration, and set up Alert Rules for your escalation chain.

Active Alerts:

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "summary": "LogicMonitor Alert",
    "themeColor": "ff0000",
    "sections": [
        {
            "startGroup": true,
            "title": "LogicMonitor Automated Alert Notification",
            "activityImage": "http://www.logicmonitor.com/wp-content/uploads/2015/07/LM_Logo_Circle_Indigo_300px.png",
            "activityTitle": "Group: **##GROUP##**",
            "activitySubtitle": "##LEVEL## Alert received: ##ALERTID##",
            "text": "LogicMonitor Alert Details",
            "facts": [
                {
                    "name": "Group",
                    "value": "##GROUP##"
                },
                {
                    "name": "Host",
                    "value": "##HOST##"
                },
                {
                    "name": "Datasource",
                    "value": "##DATASOURCE##"
                },
                {
                    "name": "Datapoint",
                    "value": "##DATAPOINT##"
                },
                {
                    "name": "Threshold",
                    "value": "##THRESHOLD##"
                },
                {
                    "name": "Value",
                    "value": "##VALUE##"
                },
                {
                    "name": "Duration",
                    "value": "##DURATION##"
                },
                {
                    "name": "Start",
                    "value": "##START##"
                },
                {
                    "name": "Alert URL",
                    "value": "##AlertDetailURL##"
                },
                {
                    "name": "Service URL",
                    "value": "##URL##"
                },
                {
                    "name": "Website Description",
                    "value": "##WEBSITEDESCRIPTION##"
                },
                {
                    "name": "Website Checkpoint",
                    "value": "##CHECKPOINT##"
                },               
                {
                    "name": "Website Group",
                    "value": "##WEBSITEGROUP##"
                }
            ],
            "potentialAction": [
                {
                    "@type": "OpenUri",
                    "name": "Open Alert",
                    "targets": [
                        { "os": "default", "uri": "##AlertDetailURL##" }
                    ]
                }
            ]
        }
    ]
}

Escalated Alerts:

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "summary": "LogicMonitor Alert",
    "themeColor": "ffcc00",
    "sections": [
        {
            "startGroup": true,
            "title": "LogicMonitor Alert Update Notification",
            "activityImage": "http://www.logicmonitor.com/wp-content/uploads/2015/07/LM_Logo_Circle_Indigo_300px.png",
            "activityTitle": "Group: **##GROUP##**",
            "activitySubtitle": "##LEVEL## Alert received: ##ALERTID##",
            "text": "LogicMonitor Alert Details",
            "facts": [
                {
                    "name": "Group",
                    "value": "##GROUP##"
                },
                {
                    "name": "Host",
                    "value": "##HOST##"
                },
                {
                    "name": "Datasource",
                    "value": "##DATASOURCE##"
                },
                {
                    "name": "Datapoint",
                    "value": "##DATAPOINT##"
                },
                {
                    "name": "Threshold",
                    "value": "##THRESHOLD##"
                },
                {
                    "name": "Value",
                    "value": "##VALUE##"
                },
                {
                    "name": "Duration",
                    "value": "##DURATION##"
                },
                {
                    "name": "Start",
                    "value": "##START##"
                },
                {
                    "name": "Alert URL",
                    "value": "##AlertDetailURL##"
                },
                {
                    "name": "Service URL",
                    "value": "##URL##"
                },
                {
                    "name": "Website Description",
                    "value": "##WEBSITEDESCRIPTION##"
                },
                {
                    "name": "Website Checkpoint",
                    "value": "##CHECKPOINT##"
                },               
                {
                    "name": "Website Group",
                    "value": "##WEBSITEGROUP##"
                }
            ],
            "potentialAction": [
                {
                    "@type": "OpenUri",
                    "name": "Open Alert",
                    "targets": [
                        { "os": "default", "uri": "##AlertDetailURL##" }
                    ]
                }
            ]
        }
    ]
}

Acknowledged Alerts:

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "summary": "LogicMonitor Alert",
    "themeColor": "003366",
    "sections": [
        {
            "startGroup": true,
            "title": "LogicMonitor Acknowledgement Notification",
            "activityImage": "http://www.logicmonitor.com/wp-content/uploads/2015/07/LM_Logo_Circle_Indigo_300px.png",
            "activityTitle": "Group: **##GROUP##**",
            "activitySubtitle": "##LEVEL## Alert received: ##ALERTID##",
            "text": "LogicMonitor Alert Details",
            "facts": [
                {
                    "name": "Group",
                    "value": "##GROUP##"
                },
                {
                    "name": "Host",
                    "value": "##HOST##"
                },
                {
                    "name": "Datasource",
                    "value": "##DATASOURCE##"
                },
                {
                    "name": "Datapoint",
                    "value": "##DATAPOINT##"
                },
                {
                    "name": "Threshold",
                    "value": "##THRESHOLD##"
                },
                {
                    "name": "Value",
                    "value": "##VALUE##"
                },
                {
                    "name": "Duration",
                    "value": "##DURATION##"
                },
                {
                    "name": "Start",
                    "value": "##START##"
                },
                {
                    "name": "Alert URL",
                    "value": "##AlertDetailURL##"
                },
                {
                    "name": "Service URL",
                    "value": "##URL##"
                },
                {
                    "name": "Website Description",
                    "value": "##WEBSITEDESCRIPTION##"
                },
                {
                    "name": "Website Checkpoint",
                    "value": "##CHECKPOINT##"
                },               
                {
                    "name": "Website Group",
                    "value": "##WEBSITEGROUP##"
                }
            ],
            "potentialAction": [
                {
                    "@type": "OpenUri",
                    "name": "Open Alert",
                    "targets": [
                        { "os": "default", "uri": "##AlertDetailURL##" }
                    ]
                }
            ]
        }
    ]
}

Cleared Alerts:

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "summary": "LogicMonitor Alert",
    "themeColor": "33f449",
    "sections": [
        {
            "startGroup": true,
            "title": "LogicMonitor Alert Clear Notification",
            "activityImage": "http://www.logicmonitor.com/wp-content/uploads/2015/07/LM_Logo_Circle_Indigo_300px.png",
            "activityTitle": "Group: **##GROUP##**",
            "activitySubtitle": "##LEVEL## Alert received: ##ALERTID##",
            "text": "LogicMonitor Alert Details",
            "facts": [
                {
                    "name": "Group",
                    "value": "##GROUP##"
                },
                {
                    "name": "Host",
                    "value": "##HOST##"
                },
                {
                    "name": "Datasource",
                    "value": "##DATASOURCE##"
                },
                {
                    "name": "Datapoint",
                    "value": "##DATAPOINT##"
                },
                {
                    "name": "Threshold",
                    "value": "##THRESHOLD##"
                },
                {
                    "name": "Value",
                    "value": "##VALUE##"
                },
                {
                    "name": "Duration",
                    "value": "##DURATION##"
                },
                {
                    "name": "Start",
                    "value": "##START##"
                },
                {
                    "name": "Alert URL",
                    "value": "##AlertDetailURL##"
                },
                {
                    "name": "Service URL",
                    "value": "##URL##"
                },
                {
                    "name": "Website Description",
                    "value": "##WEBSITEDESCRIPTION##"
                },
                {
                    "name": "Website Checkpoint",
                    "value": "##CHECKPOINT##"
                },               
                {
                    "name": "Website Group",
                    "value": "##WEBSITEGROUP##"
                }
            ],
            "potentialAction": [
                {
                    "@type": "OpenUri",
                    "name": "Open Alert",
                    "targets": [
                        { "os": "default", "uri": "##AlertDetailURL##" }
                    ]
                }
            ]
        }
    ]
}

 

Custom Webhook Overview

image2018-10-25_16-40-52.png?version=1&modificationDate=1540510852000&api=v2

 

Teams Channel Connectors

image2018-10-25_16-42-10.png?version=1&modificationDate=1540510931000&api=v2

 

Incoming Webhook Connector

image2018-10-25_16-42-44.png?version=1&modificationDate=1540510964000&api=v2

Edited by Kerry DeVilbiss
formatting clarity

Share this post


Link to post
Share on other sites

Hi,

Interested to try this integration piece with our Microsoft Teams. I cannot see the pictures as well. Is there a possibility you can provide the information.

 

Thanks

Share this post


Link to post
Share on other sites

For anyone else who might be interested, you can now download this integration from the following location:

https://github.com/kdevilbiss/Integrations/blob/master/Microsoft_Teams_v1.json

Cheers,

Kerry

Share this post


Link to post
Share on other sites

I've added the JSON to our integration with teams.  Looks good, thank you.  The Facts sections seem to look great on my iPhone, but are very narrow under windows.  I'm going to see if there's a way to nudge them wider.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.