cancel
Showing results for 
Search instead for 
Did you mean: 

Grabbing Client Info from Systems Manager

SOLVED
Here to help

Grabbing Client Info from Systems Manager

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? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kind of a big deal

Re: Grabbing Client Info from Systems Manager

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.

2 REPLIES 2
Kind of a big deal

Re: Grabbing Client Info from Systems Manager

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.

Here to help

Re: Grabbing Client Info from Systems Manager

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. 

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.