Meraki Dashboard Reports with Google Sheets

DexterLaBora
Meraki Employee
Meraki Employee

Meraki Dashboard Reports with Google Sheets

I created a simple tool to import Meraki Dashboard API data directly into a Google Sheet. 

 

Check out the full write-up

https://create.meraki.io/build/meraki-dashboard-reports-with-google-sheets/

 

 

If you have cool ideas or feedback, let me know!

 

22 Replies 22
jdsilva
Kind of a big deal

Very cool. I can see this being quite useful. Nice work!

Adam
Kind of a big deal

Awesome thanks

Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
DexterLaBora
Meraki Employee
Meraki Employee

Now with more reports!

 

+ admins

+ device details

+ clients

 

GoogleSheetsMerakiReports-2.png

Ben_Donaldson
New here

This is great, thank you! Anyway you could add a function to return the uplink status to the code? 

 

api call is {{baseUrl}}/networks/{{networkId}}/devices/{{serial}}/uplink 

 

 

DexterLaBora
Meraki Employee
Meraki Employee

Hi Ben,

 

You can use the Device Status report to get the uplink status for every device in the org. This is a very fast call, as it returns an array of every device in the organization by default.

 

I could write a recursive script to iterate through every device in every network in every org... but that takes a lot longer. If there is critical information in that call that you still need, I could consider writing an additional report.

 

I added some extra reports and refined how the data is parsed be more dynamic with available attributes.

Make sure you the newest script (simply replace yours with this new one). 
https://gist.github.com/dexterlabora/9884aa4399715df8f453ea9de63255a0

 

(formatting colors were applied after report)

Google Sheets Meraki Reports - Device Status.png

DexterLaBora
Meraki Employee
Meraki Employee

Hello!

 

This has been added to the report!

 

Overwrite your Code.GS file with this one 

https://gist.github.com/dexterlabora/9884aa4399715df8f453ea9de63255a0

 

Delete or Rename your settings sheet

Refresh the Sheet window to load new script

Update the new settings sheet

Screen Shot 2018-08-30 at 5.43.57 PM.png

Mandryk
Conversationalist

Love your work. Thanks!

ciph3r
Getting noticed

@DexterLaBora

 

I have a fairly large org and want to pull a client list. Can you give me some ideas how to overcome a the time out (settings tab?) and the 2,000,0000 limit in sheets? Is there a way for it to break the data up between sheets?

DexterLaBora
Meraki Employee
Meraki Employee

Hi,

 

I have updated a few things with this script. It now has an Org-wide and Net-wide menu. This will allow for some large reports to be more focused, such as Clients.

 

Script: https://gist.github.com/dexterlabora/9884aa4399715df8f453ea9de63255a0
(replace your existing script with this one)


google sheets reports network-wide menu.png

 

Mandryk
Conversationalist

This works great, however, I am getting 'Exceeded maximum execution time' when running the clients script.

 

Any ideas how to fix this?

DexterLaBora
Meraki Employee
Meraki Employee

This script takes a while because it iterates through every device in every network to pull clients over a period of 86400 seconds.

 

 

I was motivated by this question, so I have updated the script with a few additions. I've added a timespan and network setting so you can focus on a particular network and limit the search range.

 

I also extended the reports with a Details version, that makes an API call for every client to get its SSID and other info. This will likely break on a large network, but I built it for another use case. 

 

Replace your existing code file with this one

Code.gs 

 

Delete the settings tab or rename it so you have a copy

Refresh the sheet to load the new version. 

It will generate a new settings sheet, which you must update.

Its a work in progress, so still working on the UI, etc. Happy to hear any feedback. 


Riser
Getting noticed

Hi guys. Is this still functional? I don't see " Meraki Reports" on the sheets even after refreshing severally. I had it initially but no longer there.

DexterLaBora
Meraki Employee
Meraki Employee

@Riser , yes it should work but it's a bit of an old script. 

 

You will likely need to first run the onOpen function, to load the menu the first time. It will prompt you for your Google auth to allow it to run. 

 

Screen Shot 2021-06-16 at 12.17.58.png

 

Then setup a trigger to run the script every time you open the doc.

 

Screen Shot 2021-06-16 at 12.15.41.png

 

Screen Shot 2021-06-16 at 12.18.22.png

 

 

FYI,

There is a more powerful version of this app that support Dashboard API v1

https://workspace.google.com/marketplace/app/meraki_tools/11340767263

 

Pumilio
Here to help

Hi @DexterLaBora 

How do I get the "monitoring" sheet to load automatically?

Most reports works great, thx

The device loss and latency gives a Code 404

DexterLaBora
Meraki Employee
Meraki Employee

If you want the script launch the menu when you open the Google Sheet, just add a Trigger. 

Do this in the Script editor section.

Select the "onOpen" function to run for the event type "On open"

DexterLaBora_0-1636977864922.png

 

You could also create macros that will run a specific function and insert the data on scheduled basis. 

 

create a new file called macros.gs and then add this code

 

// example function I want to run via macro
function DeviceUplinkDetails() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('A2').activate();
  callUplinkInfos();
};

 

Then create a new trigger for this that calls the function on a schedule.

DexterLaBora_1-1636978110106.png

 

 

Hope this helps!

WellyHartanto
Getting noticed

Hi @DexterLaBora 

 

I just stumbled upon your amazing work, and after looking at the code, it is still using API v0.

Any chance that you have updated this to the latest v1?

WellyHartanto
Getting noticed

Ah nevermind.

I've found that you created an extension instead.

BDillon
Here to help

Afternoon;
Could this be setup to interrogate and report back on Meraki MT10 Sensors?
E.g. Name, Latest Readings for Temp,Humidity and Battery life?

ShawnHu
Meraki Employee
Meraki Employee

Yes, you can achieve this by combining the organizations > Organization Devices (set device model as mt10)and sensor > Organization Sensor Readings Latest calls (with the targeted devices selected)

 

The reason you will need the Organization Devices is in the sensor reading returns there is no device names but serial numbers.

BDillon
Here to help

Nice one - thanks
Its going to take a little more investigation then. I'm not very clued up on JSON scripting etc at the moment. This gives me something to work with though.

Jaganmohan
Conversationalist

While running "Organization Wireless Devices Ethernet Statuses" report for an Organization with more than 4000 APs, what should be the Optional "Per Page" and "Pages" settings?

BDillon
Here to help

I have now created another work around for my issue - collecting MT Sensor information.
Using POSTMAN and API GET queries.

This was a great place to start however.

Get notified when there are additional replies to this discussion.