Obtain device serial numbers using Meraki CLI?

SOLVED
rollacosta82
Conversationalist

Obtain device serial numbers using Meraki CLI?

I've noticed there are Meraki commands that can provide lists of network devices; for example, all switches, APs, or all Meraki devices in a network or organization. 
However, some commands specific to switches (get switch port statuses) require the serial number of the switch or switches. Is there a Meraki CLI command that can get retrieve the serial numbers of all switches? That way I wouldn't have to go through 100s of switches and manually copy and paste. 

1 ACCEPTED SOLUTION

You can use this API to get all devices.

https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices 

 

Then filter the list for devices with a model number beginning with MS.

View solution in original post

6 REPLIES 6
RomanMD
Building a reputation

Meraki switches are meant to be managed from the cloud. What you are referring to, most probably is the meraki-cli python module that is emulated kind of CLI interface. But that module is making use of Meraki API - and there is no api endpoint for your request. 

However, your request is easily done with a script and you will not have to copy/paste anything.

DarrenOC
Kind of a big deal
Kind of a big deal

Or…..simply log into the dashboard, click on the Organisation > Configure > inventory > Download as CSV

 

Boom, you have all the required information and you haven’t had to faff around with an API

Darren OConnor | doconnor@resalire.co.uk
https://www.linkedin.com/in/darrenoconnor/

I'm not an employee of Cisco/Meraki. My posts are based on Meraki best practice and what has worked for me in the field.

I'll definitely have to try that. Thank you @DarrenOC 

Hi RomanMD. I am using the Meraki API. Would you happen to have a script to get the information I'm looking for?

You can use this API to get all devices.

https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices 

 

Then filter the list for devices with a model number beginning with MS.

This is great! Thank you for sharing

 

Get notified when there are additional replies to this discussion.
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.