Configuring WebHooks for each Network

JohnPaul
Getting noticed

Configuring WebHooks for each Network

Hello Everyone!

 

First let me start out by saying I'm a programming novice! I just started getting into writing some extremely simple bash and Python code to accomplish some things I've always wanted to do, like configuring alerts and content filtering categories uniformly across all my networks. What a game changer!

 

Now I am trying to configure a Teams webhook alert for each of my network sites. To start, I first pick a "template" network where I want to configure all my alerts for exactly how I want it to be throughout the organization. I run a Meraki API request to get those settings and copy the JSON output for later application.

 

Unfortunately, this didn't go as planned using the template JSON I collected. The webhooks are not applied to the network alerts as I had intended. How can I use the Meraki API to push out the webhook alerts to all networks? Does this functionality even exist at the moment?

Would be a shame if I had to go into each of my networks and manually configure the web hooks.

 

Thanks!

 

 

7 REPLIES 7
Inderdeep
Kind of a big deal
Kind of a big deal

@JohnPaul : Check this out if it helps you 
https://developer.cisco.com/meraki/webhooks/#!introduction/assign-alerts 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com

Sorry I looked at the link. It's not obvious to me how I would assign the Webhook to all my alerts using the API. Could you please point me in the right direction? Is there some JSON documentation I am not seeing? That shows me the GUI, and my goal is to apply the webhooks as recipients to all the networks.

Inderdeep
Kind of a big deal
Kind of a big deal

These are the only available APIs for Webhook. Check out
https://developer.cisco.com/meraki/api-v1/#!delete-organization-webhooks-http-server 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
sungod
Head in the Cloud

You don't say what went wrong with what you tried so far.

 

Starting from scratch I'd say there are a few steps involved...

 

Use the calls under the link @Inderdeep sent to set up the HTTP servers.

 

You can get / set network alert webhooks using https://developer.cisco.com/meraki/api-v1/#!get-network-alerts-settings / https://developer.cisco.com/meraki/api-v1/#!update-network-alerts-settings

 

If you want to do it on all networks, just iterate over network IDs.

 

To start, it'd be simplest to manually set up the webhook servers and the alerts of just one of the networks, then you can use the API to get the alert settings on that network and use them as the basis of doing an update call on the other networks.

 

If that's what you tried, but it went wrong, then if you post exact details (x'ing out any real ID info) maybe someone can help more.

 

Now I am trying to configure a Teams webhook alert for each of my network sites. To start, I first pick a "template" network where I want to configure all my alerts for exactly how I want it to be throughout the organization. I run a Meraki API request to get those settings and copy the JSON output for later application.

 

Normally I use the GET /networks/{networkId}/alerts/settings to get a JSON of the network that I want to replicate alert settings from. Then I use the PUT /networks/{networkId}/alerts/settings and insert the JSON data I got from the GET.

 

This normally works like I want, but for the webhook part its not working. It brings in the webhook:teams recipient to the correct alerts, but its not configuring the webhook at the bottom of the alerts page

 

JohnPaul_0-1671808735831.png

 

 

 

I will try creating a simple python script to get information from a CSV file. If you already have a python script that get's networkIDs from a CSV file to run meraki API calls, please share.

Inderdeep
Kind of a big deal
Kind of a big deal

@JohnPaul : https://github.com/oldnotebook/Meraki-API-Network-CSV-List 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
Get notified when there are additional replies to this discussion.