Chromebook DNS names in dashboard?

Gleep52
Here to help

Chromebook DNS names in dashboard?

A recent update to google's dashboard allows us to set the name of the DHCP client to be the serial number, asset ID, or MAC address.  We opted for our SN so it's easier to search in our inventory system.  Now our DNS is happily populated with 2500 chromebook host A records.  YET Meraki still sees some wonky garbly name for all of our chromebooks... 

 

How does Meraki identify the hostnames of devices and can we switch the method to DNS/DHCP lookup?  It would GREATLY help the visualization of our network.

15 Replies 15
PhilipDAth
Kind of a big deal
Kind of a big deal

chuyendang
Getting noticed

Hi,

 

I use a Google Spreadsheet to import/rename all Chromebooks clients.

 

https://docs.google.com/spreadsheets/d/1a-TT0hkbC18OsqjPJOhBytDXnuAXab4yYNejam98Ucw/edit#gid=0

 

Just need to update your API and network ID.

 

Cheer,

Gleep52
Here to help

How do we find our URL?  I know the first part with nxxx.meraki.com but I don't know the latter part.  I dinked around with the API site to try to find the ID and I got one that starts with L_xxx... I have a combined network - does that matter?  I generated an API key - what does f_import and import do differently?

 

When I run f_import it crashes at line 18.  Import seems to want data prepopulated so I'm guessing f is the downloader and the non F_ is the uploader?

 

Sorry for the newbish questions... I really appreciate the help!

 

@chuyendang 

 

https://www.screencast.com/t/QIKCY2JfW

 

Thats the error I get when running the f_importclient macro...

BrechtSchamp
Kind of a big deal

That's the network ID. I think it's probably best that you take a look here:

https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

 

I think postman is probably the easiest way to get going with the API. First you'll use the organizations call to find out the IDs of the orgs you have access to. Then you will use the networks call to get the IDs of the networks you have access to. That should allow you to complete the url from @chuyendang 's script.

 

Regarding the next question, f_import is actually called by importclient on line 57, so that last one would be the the only function that needs to be called. It'll take care of the rest. Running f_import directly will indeed crash as it requires parameters: url & payload.

 

If I understand the script correctly, you need to fill in mac-addresses and client names in the sheet, and then run the importclient function. But maybe @chuyendang will chip in.

chuyendang
Getting noticed

Hi,

 

You will need to use API to find the ORG ID, then the Network ID, just follow @BrechtSchamp link.

 

I use Chromebook Getter to export Chromebooks list (with serial/mac address...) and paste into the google sheet.

 

Please use the importClient function 

 

P/S: I'm not good at programming, hope someone can modify the script to make it more friendly 🙂

Gleep52
Here to help

I believe I found the right ID - but when I did a test import of just one chromebook mac address with a name - no group policy or GP ID, it says "imported" but the name of the device doesn't change in the dashboard - how soon/quickly does it update on the Meraki cloud side?  

chuyendang
Getting noticed

It should update right after... Do you see the event on the change log (Organization > Change log) ?

 

2019-09-20 16_34_25-Window.png

 

Gleep52
Here to help

Nope it doesn't show up in the change logs... but I don't get any errors either.  The imported field says "Imported" when it's done running the importclient macro.

 

I found my org ID by going to the API site, then used that baseurl/org ID/networks to see the network IDs.  I tried using postman but found it too confusing - however I'm 99% sure this is the right ID as it has my network name next to it and shows my alternate network as well...  I did manage to get postman to list my org ID and it is the same as the one I found from the API site.  Do the group policy and group policy ID need to be filled in as well perhaps?  I've been skipping those (left blank) so i could update just the name.

chuyendang
Getting noticed

If you don't set the Group policy, it will be set as Normal.

 

If you are using combined network, you can contact Meraki support team and ask them to give you the NETID for the Wireless network and try that...

Gleep52
Here to help

Why wireless?  I'm interested in the MX side of things honestly.  And I don't want the spreadsheet to change the custom profiles I have setup so I left it blank.  Does it auto reset them as normal if I leave it blank?

Gleep52
Here to help

OK so I've spent some more time on this - and using postman I've been able to successfully change values via API.  However I do not get any errors, nor any changed values via spreadsheet.  I see it was updated a bit in the note section since I made a copy - but even a fresh copy yields no fruit for me.  As you can see from my screenshot here, I've found the mac, grouppolicyID, and name - and use the post command with my network ID I've got in my google sheet values and using postman it works.  

 

Anyone have some pointers for me?  Is there a way to see what URL it is passing as the payload values?  Postman shows the format/syntax of URL followed by

 

?mac=xx:xx&groupPolicyId=108&name=TestName

 

 

I'm only dabbling with the code here - but it seems it's passing the request_payload value which in my case looks like this: 

 

{name=TestName, groupPolicyId=108.0, mac=xx:xx, devicePolicy=Group policy}

 

 

How does that get translated with the f_importclient function to be the syntax listed above format?

 

?mac=xx:xx&groupPolicyId=108&name=TestName

 

 

 

2019-09-25_14-00-34.png

chuyendang
Getting noticed

Maybe this does not work on a combine network... We don't use MX so I set this on our Wireless network

Gleep52
Here to help

Well the weird part is - I was able to push out this via postman directly using a csv with Meraki support's help.  I'm using the same variables that are in the script, and it works fine from postman.  So at least I have names now thanks to the URL syntax from the script! 🙂

chuyendang
Getting noticed

I found the problem with the script... if you did not fill the Group Policy, it did not set as Normal as expected.

 

I updated the script, with a simpler workflow.

AirborneJoe
Comes here often

Does this Script still work?  I have tried using it, it shows "Imported" but doesn't actually change the name in the meraki dashboard for the device

 

 

Get notified when there are additional replies to this discussion.