Hi Everyone,
We recent discovered that unfortunately when some of the AP were commissioned at our site the tech did not set the Switch port the AP is on to a Trunk port. This is causing issues. We need to do an audit of all the AP in our Org to make sure the switch port the are on is set to Trunk.
What is the most efficient API end point we can use for this?
I'm think of below route:
Get Organization Devices -> Filter to wireless only.
Loop through each device then work out which switch and which port its connects to? <-- this step I am not sure how to get the info?
Then use Update Device Switch Port to update the port.
Thanks.
Solved! Go to solution.
I'm surprised nobody recommended https://developer.cisco.com/meraki/api-v1/get-network-topology-link-layer/ -- which is purpose built for this kind of thing! And way easier than polling per-device discovery info.
Depending on how many networks you have, you could go into each network and go Switching/Switchports.
Use the spanner in the top right hand corner, and enabled the CDL/LLDP column.
And then search on "MR" to see all access points. You can then select all the switch ports and change them in one hit.
Thanks. That's handy to know. 150 networks otherwise I would have just done the manual route.
API wise;
You could use this to get a list of all MS switches (set productTypes filter to "switch"):
https://developer.cisco.com/meraki/api-v1/get-organization-inventory-devices/
And then for each switch, use this to get the LLDP neighbours.
https://developer.cisco.com/meraki/api-v1/get-device-lldp-cdp/
And then for each switch port above that shows something with a systemName containing "Meraki MR", update the port.
Thanks. I'll explore this route.
I think the way you suggest is straightforward 😀
Tbh with all the new/updated API calls, I need to spend a while reading through the details on each one - used to do this back in 80s/90s on new UNIX releases, I think it was actually faster riffling through the paper manuals than it is to do on the developer website...
Going sideways; depending on what model switches you have; you could enable SecurePort which can automatically recognise and configure a switch port for an MR.
https://documentation.meraki.com/MS/Access_Control/SecurePort_(formerly_known_as_SecureConnect)
You could also consider create a standardised port profile for APs, and rather than apply specific port settings, apply the profile for an AP.
https://developer.cisco.com/meraki/api-v1/get-organization-switch-ports-statuses-by-switch/
This will return ALL switchports statuses from your Orgs ( contains CDP LLDP info )
The second call will return the config.
If the port has cdp lldp corresponding to a AP , then loop through the ports and find the config. Voila.
As suggested by Phil , if you have MS and MR , I would suggest to configure SecurePort ( https://documentation.meraki.com/MS/Access_Control/SecurePort_(formerly_known_as_SecureConnect) )
I have a python script that pulls all the switch / port / client data for our org. You can see AP's by name in the lldp field, and the switch port settings (access, trunk, and associated vlans,. It's a down and dirty script, but will output a csv file and you can just filter on the APs. You can use a similar API to go correct them once you have a list. Not sure how this will come across but shoot me a note if you have a question.
# Start of python file -------
Thank you for sharing. I will give that a try.
I'm surprised nobody recommended https://developer.cisco.com/meraki/api-v1/get-network-topology-link-layer/ -- which is purpose built for this kind of thing! And way easier than polling per-device discovery info.