I have MS Teams working with ActiveCard 1.2 format and webhooks. I'm happy with the format. My issue is that MS Teams channels via webhook don't yet support @mentions, so the only way to really filter is to have different alerts go to different channels for the various teams. I'd really like to do this with 1 alert - the problem is I need a variable working in the URL box. Right now, variables are rejected for some reason. Is there a way to get this box to accept a variable so I don't have to make 15 duplicate copies of the same alert with a different URL in each one? It's just frustrating when you run into little quirks like this.
See sample image - the red highlight is not accepted unless I put a raw URL in there.
Also for reference, here is my ActiveCard I'm using. The card has several action buttons and an expanding info window that gives out some of our custom fields. Here is the compact card:
Here is the same card expanded with more information about the system:
Here is the body of the Post for a Down alert. I do pull in a lot of custom fields so if you want to use this format you might need to remove them.
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type":"ColumnSet",
"columns":[
{
"type":"Column",
"padding":"None",
"width":"auto",
"items":[
{
"type":"Image",
"url":"https://www.iconsdb.com/icons/preview/red/down-xxl.png",
"size":"Small"
}
],
"horizontalAlignment":"Left"
},
{
"type":"Column",
"padding":"None",
"width":"stretch",
"items":[
{
"type":"TextBlock",
"text":"${N=SwisEntity;M=CustomProperties.Monitoring}: ${N=SwisEntity;M=Caption} at ${IP_Address} is ${N=SwisEntity;M=Status}",
"wrap":true
}
],
"verticalContentAlignment":"Center"
}
]
}
],
"actions": [
{
"type": "Action.ShowCard",
"title": "More Info",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Node Name: ${NodeName}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "System Name: ${DNS}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "IP Address: ${IP_Address}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Time of Alert: ${Date} ${Time}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Monitoring: ${N=SwisEntity;M=CustomProperties.Monitoring}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Device Type: ${N=SwisEntity;M=CustomProperties.DeviceType}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Site: ${N=SwisEntity;M=CustomProperties.Site}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Location: ${location}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Contact: ${N=SwisEntity;M=Contact}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Comment: ${N=SwisEntity;M=CustomProperties.Comments}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "EmailPrimary: ${N=SwisEntity;M=CustomProperties.EmailPrimary}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "EmailSecondary: ${N=SwisEntity;M=CustomProperties.EmailSecondary}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "ON Call Text: ${N=SwisEntity;M=CustomProperties.EmailOnCall}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "On Call Escalation: ${N=SwisEntity;M=CustomProperties.EmailEscalation}",
"size": "Medium",
"wrap": true
},
{
"type": "TextBlock",
"text": "Open Alert: [${N=Alerting;M=AlertDetailsUrl}](${N=Alerting;M=AlertDetailsUrl})",
"size": "Medium",
"wrap": true
},
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
},
{
"type": "Action.OpenUrl",
"title": "Open Node",
"url": "${N=SwisEntity;M=DetailsUrl}"
},
{
"type": "Action.OpenUrl",
"title": "Acknowledge ",
"url": "${N=Alerting;M=AcknowledgeLink}"
}
]
}
}
]
}
This is awesome. I don't suppose you have created a template for SAM and WPM have you?
Kevin
BUMP, DITTO, Please save us Obi wan developers....
Love the use of Custom Properties, and completely agree with how you are trying to use them. I am surprised that this cannot be done as you posted. I might be copying what you did, just swapping out the custom properties.😁 I like it as webhooks are starting to get a following around me.
Thanks for sharing
Marc
I brought this to their attention 3 months ago as well. This needs to be a thing! Setting the alert to call out the user or group responsible for the alert is the ONLY way to make teams alerts useful. Otherwise,everyone is seeing everything and it just becomes background noise and ignored eventually. This is critical to making the teams alerts an actually useful thing.
Unfortunately, variables for the URL are not supported. I have created an internal Feature Request CUST-69408 to track this, as the only option available to simplify this process for you would be to use a PowerShell script to do the POST in a similar way to what is described here
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 150,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.