cancel
Showing results for 
Search instead for 
Did you mean: 

Global dashboard search via API

SOLVED
Here to help

Global dashboard search via API

Hello,

 

I've checked the dashboard API docs and searched on this forum but can't find a way of emulating the global search functionality of the HTTPS dashboard (where you can search for a client at the top of the dashboard across all networks), has anyone managed this?

 

Currently my very clunky way of finding a client MAC via IP is:

1) Get list of networks

2) for each network get list of devices

3) for each device get list of clients

Obviously I could cache these results and refresh them periodically.

 

Which is very slow in comparison to the global search. 

I tried inspecting the calls and results that the dashboard makes when you search (e.g. https://dashboard.meraki.com/o/XXYYZZ/manage/dashboard/live_search_react?query=%2F00c0) and replicated in postman but it just returns the login page.

 

So has anyone got any suggestions on implementing a global search or a faster way of finding a client's MAC address from their IP in any network?

 

Thanks in advance,

 

Dave

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Here to help

Re: Global dashboard search via API

To close this topic out, this is what I've done -

- create a python spark bot that's hosted on Google App Engine

- grabbed the Meraki python SDK from github

- mangled it a bit to run in python 2.7 instead of 3

- added data models and storage functions from GAE

- modified the Meraki SDK functions to check if the network/device/client they're retrieving already exists in the datastore

- created some jobs that run on a schedule in the background to renew the networks/devices/clients

- created some query functions that allow you to find a client's details by IP or MAC.

 

Now I can find a client's details from slack and response time is ~1 second from 12k+ clients, 20 networks and 345 devices.

 

Next on my list is to allow updating of the client's policy from slack.

3 REPLIES
Here to help

Re: Global dashboard search via API

Dave-

 

I have a script that will find users based on MAC or IP address.  Its slow, but if you are going network by network in the dashboard, this is easier.

 

https://github.com/steinbep/Meraki-API---Python/blob/master/find_machine.py

Highlighted
Here to help

Re: Global dashboard search via API

Thanks for this, it looks like you're following the same process of searching networks then devices and finally clients. Maybe that is the only option so I'll have to look at storing the data and refreshing periodically.

I might also try setting the timestamp to 8 hours instead of 24 to speed things up.

 

Kind regards,

 

Dave

Here to help

Re: Global dashboard search via API

To close this topic out, this is what I've done -

- create a python spark bot that's hosted on Google App Engine

- grabbed the Meraki python SDK from github

- mangled it a bit to run in python 2.7 instead of 3

- added data models and storage functions from GAE

- modified the Meraki SDK functions to check if the network/device/client they're retrieving already exists in the datastore

- created some jobs that run on a schedule in the background to renew the networks/devices/clients

- created some query functions that allow you to find a client's details by IP or MAC.

 

Now I can find a client's details from slack and response time is ~1 second from 12k+ clients, 20 networks and 345 devices.

 

Next on my list is to allow updating of the client's policy from slack.

Community News

View all community news »