Device Type by Serial Number

Toddomation
New here

Device Type by Serial Number

I have written Python code using the "meraki" Python package and it's working great.  I just ran into an issue where my code attempted to add MR devices to a "Switch Only" network.  This got me thinking that along with the serial number format validation regex I'm using, r'([A-Z0-9]{4}-){2}([A-Z0-9]{4})\b', I'd like to identify the "Device Type" with ReGex as well.  This way if I have a network that's not "Combined" and I try to add a new device I will know prior to getting the reject message.  I've looked on the Cisco DevNet site and API documentation and can't seem to find an official listing of how the first four (4) characters of the serial number Identify the device type.  Someone posted this here, but it's pretty old.

 

https://community.meraki.com/t5/Security-SD-WAN/Serial-Number-Lookup/m-p/46655#M11682

 

I would think that Meraki would have a table listed somewhere, but can't seem to find it.

 

Thanks for any help,

 

Todd

youtube.com/@toddomation

4 Replies 4
sungod
Head in the Cloud

Tbh I'd never even noticed the serial number prefix mapped to device type, so I learned something new today!

 

But in the same position, I'd use https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-devices filtered for unused inventory, or just look up an individual serial number with... https://developer.cisco.com/meraki/api-v1/#!get-organization-inventory-device

 

...then look at the productType field for the device(s) concerned.

 

This avoids relying on manually maintaining a lookup table.

 

Toddomation
New here

Sungod,

 

Thanks for the reply.  The automation I'm working on is when my field services team is installing a new network.  The first part of my code reads an Excel sheet that has all of the Serial Numbers that are going to be applied to the site.  When I create the network, my code needs to know if its for a single product or combined products.  I want to take the Serial Numbers from the spreadsheet and using ReGex determine what products are being installed.  That way when my code creates the site it knows what products should be in the list being passed, eg ['appliance', 'switch', 'wireless'].

NetworkLarry
Getting noticed

Do you have the device model number in the spreadsheet? 

If so, determine the device type by the first two characters of the model field, MX, MS, MR, etc. 

 

david_n_m_bond
Building a reputation

The following file tracks this.  Pull requests welcome.

 

https://github.com/panoramicdata/Meraki.Api/blob/main/Meraki.Api/MerakiClient_SerialNumberInfo.cs

Author, https://www.nuget.org/packages/Meraki.Api/
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.