Global dashboard search via API

Solved
Dave_Lewis
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

1 Accepted Solution
Dave_Lewis
Here to help

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.

View solution in original post

5 Replies 5
Steinbep
Getting noticed

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

Dave_Lewis
Here to help

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

Dave_Lewis
Here to help

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.

John_on_API
Meraki Employee
Meraki Employee
ilcomix
New here

I rewrited python script for search asset by IP in 2024: https://github.com/ilcomix/meraki_search_from_ip/blob/main/meraki_search_from_ip.py

Get notified when there are additional replies to this discussion.