08-26-2019 10:41 PM
I'm writing a script to see if DHCP reservations are for devices still on the network. It is simple enough to call
client = meraki.getclient(apikey, networkid, mac, suppressprint=True)
But if the device is on an extended trip and hasn't been back in the office in 30 days, I may still want to keep the reservation. I could create a loop to cycle through all of my networks to see if the device is on any of the networks, but that isn't very efficient. It seems like I should be able to query Systems Manager for the information. I see documentation for the API that suggests that I should be able to find something from meraki.getsmdevices but I'm not sure what the network_id for my Systems Manager network would be. Can anyone point me to where I can find that?
Solved! Go to Solution.
08-27-2019 01:19 AM
A systems manager network is just like any other network. So the id can be found in the same place. If it's combined with the rest of the network, the id is the same. If it's a separate network you can find it through one of the calls. I believe your library should have this call:
getnetworklist(apikey, orgid, templateid=None, suppressprint=False)
That should give you the id's of all the networks in the org.
08-27-2019 01:19 AM
A systems manager network is just like any other network. So the id can be found in the same place. If it's combined with the rest of the network, the id is the same. If it's a separate network you can find it through one of the calls. I believe your library should have this call:
getnetworklist(apikey, orgid, templateid=None, suppressprint=False)
That should give you the id's of all the networks in the org.
08-27-2019 10:41 AM
Thank! I don't know how I overlooked that. I think in most of my scripts I'd grabbed the list of devices in the org and used that for my list of networks. Since the SM network doesn't have hardware, it didn't show up in the list.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide