Giter Club home page Giter Club logo

meraki-channel-distribution's Introduction

Meraki Wireless Clients Distribution

published

The Challenge

The year is 2020. And yet some of our wireless clients are still connected to the wireless network on the 2.4GHz spectrum which cannot provide them the performance they are looking for. The Meraki dashboard is amazing, but (at the moment) is does not allow us to have a single view of all clients connected via 2.4GHz (vs. 5GHz).

The Solution

This script will use the Meraki API to query all wireless clients on a given Meraki network, and return the client distribution between 2.4GHz and 5GHz. In addition, it will mark 5GHz-capable clients that are connected to 2.4GHz for some reason.

How to run the script:

Generate your Meraki API Key

  1. Access the Meraki dashboard.
  2. For access to the API, first enable the API for your organization under Organization > Settings > Dashboard API access.

3. After enabling the API, go to "my profile" on the upper right side of the dashboard to generate an API key. This API key will be associated with the Dashboard Administrator account which generates it, and will inherit the same permissions as that account. You can generate, revoke, and regenerate your API key on your profile.

**Always keep your API key safe as it provides authentication to all of your organizations with the API enabled. If your API key is shared, you can regenerate your API key at any time. This will revoke the existing API key.**

Storing the Meraki API Key as an environment variable

Once the API key is obtained, you'll need to store the Meraki dashboard API key as an environment variable: export MERAKI_KEY = <YOUR MERAKI API KEY> and install the Meraki SDK via pip install -r requirements.txt

Now you're ready. Good luck! python run.py

Troubleshooting

The is a isDebug variable in the script, changing it to True should shed more light on what's happening for troubleshooting purposes. The script will search for clients that were connected during the last hour (or still are connected). You can change the search span by changing the timespan attribute.

The dashboard API does not have a direct query to the channel a client is associated with (at least today). The workaround is to analyze the client events and search for their last association event, where the channel association is mentioned. The achilles heel of the process is that clients associated for more than the searched time span will not return an associated channel.

You can change the log search span by changing the starting_after attribute. Increasing the time span will increase the running time of the code, while decreasing it will increase the number of unknown clients.


Licensing info

Copyright (c) 2020 Cisco and/or its affiliates.

This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at

           https://developer.cisco.com/docs/licenses

All use of the material herein must be in accordance with the terms of the License. All rights not expressly granted by the License are reserved. Unless required by applicable law or agreed to separately in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.