cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7778
Views
1
Helpful
11
Replies

DNA Event Webhook to Microsoft Teams

itnetworking
Level 1
Level 1

Has anyone been able to get a webhook for an event to successfully post to Microsoft Teams? I have a channel and teams then I am the group owner for. I have installed the team's webhook app on the channel. I have been able to post data to that Channel via postman, with the same code. when I copy the same body into DNA All I get is a bad request. I am not a DEV so I could be missing something easy but I don't know where in DNA to look at the log to see what is happing.

dna1.JPG

dna2.png

  

 
{
    "@context": "http://schema.org/extensions",
    "@type": "MessageCard",
    "themeColor": "0076D7",
    "title": "$eventSource$",
    "summary": "DNA Alert",
    "Alert Infomation": [
        {
            "Type": "$eventSource$",
            "Assurance Issue Details": "The network is experiencing a high percentage of onboarding failures compared to usual. Clients are experiencing multiple onboarding failures while connecting to SSID $ssid$.",
            "Assurance Issue Priority": "$priority$",
            "Assurance Issue Name": "Excessive failures to connect - At least $pctDeviation$% increase in failures on $ssid$ in $siteHierarchy$.",
            "Assurance Issue Category": "$category$",
            "Assurance Issue Status": "$status$"
        }
    ]
}

 

11 Replies 11

Alex Stevenson
Cisco Employee
Cisco Employee

 

Hi @itnetworking,

I think this guide might be helpful:

Quick Start Guide on What Logs to Collect from Cisco DNA Center


I'm not sure the audit logs will give you enough details about what's going wrong, but here is what they will tell you, along with how to access them:

Audit Log Support for Cisco DNA Center Platform

Audit log support for the Cisco DNA Center platform. New Cisco DNA Center platform audit logs capture the following critical activities:

  • User actions to configure, enable, and disable any of the Cisco DNA Center platform bundles.

  • User actions to view, edit, duplicate, delete, download, and run any reports in Cisco DNA Center.

  • User actions to subscribe to any of the events or notifications.

  • User actions to create, update, and change any preference for an instance.

  • User actions to invoke both successful and unsuccessful API methods (POST / PUT/ GET / DELETE).

The following data is captured in the audit logs:

  • User Role: SUPER-ADMIN-ROLE, NETWORK-ADMIN-ROLE, OBSERVER-ROLE, or user-created role.

  • Who took the action: Captured data includes user group, username, and user role (could be same as user-group).

  • When action occurred: Time that modification was made (UTC time).

  • What type of action occurred: An abstract or high level view of the action performed and if the action was successful or failed.

To access the audit logs using the Cisco DNA Center GUI, click the Menu icon (alexstev_0-1615301709958.jpeg) > Activity > Audit Logs.

I am having a similar issue wanted to ask if you ever got this working?

jegan_rajappa
Level 1
Level 1

Microsoft teams expects to post with authentication, i tired with the same and still unsuccessful, please let me know if there is way to go..

itnetworking
Level 1
Level 1

I post the following with Postman and it works, no auth.

{
	"@type": "MessageCard",
	"@context": "http://schema.org/extensions",
	"themeColor": "0076D7",
	"summary": "DNA",
	"title": "DNA Alert",
	"sections": [{

		"facts": [{
			"name": "Service Incident:",
			"value": "ID"
		}]
	}]
}

I tried both content types, Json and text all I get back from DNA is a bad request but every other way I test this it works. 

I might try a chat with Devnet.  

Did you get this to work? I am trying the same thing and getting the same failures.

Marc0
Level 1
Level 1

Hello

Has this issue been resolved? I am also trying to setup a DNA Centre Event Notification webhook into MS Team (NHS Shared Tenant) and when sending a test alert it fails with & without authentication header in place

 

Marc0_0-1692135040437.png 

Marc0_1-1692135158141.png

 

 

Hi 
You can't directly call a MS incoming webhook. MS incoming webhooks expect a certain payload schema/format (see https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using), the payload from a DNAC event notification is in JSON, but does not much the expected payload schema (see example payload below). So you need to write your own webhook receiver (for example using Python flask) and using this receiver to forward the information to a MS incoming webhook.

If you don't know how to write such a receiver, you may be interested in a easier solution (for example using the DNAC-Webex integration: https://www.cisco.com/c/en/us/td/docs/cloud-systems-management/network-automation-and-management/dna-center-platform/2-3-5/itsm-ig/b-dnac-itsm-ig-2-3-5/m_appendix_webex.html).

DNAC event sample payload:

 

 

{
    "version": "",
    "instanceId": "ea6e28c5-b7f2-43a4-9937-def73771c5ef",
    "eventId": "NETWORK-NON-FABRIC_WIRED-1-251",
    "namespace": "ASSURANCE",
    "name": "",
    "description": "",
    "type": "NETWORK",
    "category": "ALERT",
    "domain": "Connectivity",
    "subDomain": "Non-Fabric Wired",
    "severity": 1,
    "source": "ndp",
    "timestamp": 1574457834497,
    "tags": "",
    "details": {
        "Type": "Network Device",
        "Assurance Issue Priority": "P1",
        "Assurance Issue Details": "Interface GigabitEthernet1/0/3 on the following network device is down: Local Node: PDX-M",
        "Device": "10.93.141.17",
        "Assurance Issue Name": "Interface GigabitEthernet1/0/3 is Down on Network Device 10.93.141.17",
        "Assurance Issue Category": "Connectivity",
        "Assurance Issue Status": "active"
    },
    "ciscoDnaEventLink": "https://10.93.141.35/dna/assurance/issueDetails?issueId=ea6e28c5-b7f2-43a4-9937-def73771c5ef"
}

 

 

 

Thank you for the feedback much appreciated.

I have managed to get DNAC to send alerts into Webex but my organization is using MSTeams as its main platform so hence looking to get it working.  

I'm actually playing a bit with AWS lambda functions these days - I will write an example DNAC to MSTeams hook and post it here as soon as I'm ready (I'm currently on PTO, so maybe it will take some days).

Thank you, look forward to hearing how things develop. 

Marcel Zehnder
Spotlight
Spotlight

Hi @Marc0 
See https://github.com/spie-ics-ag/dnac2teams - if you have questions/problems just let me know.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: