Giter Site home page Giter Site logo

dakotageek / getmerakineighbor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from routetonull/getmerakineighbor

0.0 1.0 0.0 19 KB

Get CDP/LLDP neighbord from Meraki Dashboard API

Home Page: https://developer.cisco.com/codeexchange/github/repo/routetonull/getMerakiNeighbor

License: GNU General Public License v3.0

Python 100.00%

getmerakineighbor's Introduction

getMerakiNeighbor

Get CDP/LLDP neighbors from Meraki Dashboard API.

published

More details on IFCONFIG.IT

Requirements

Enable API access, instructions HERE

Install the necessary modules

 pip3 install -r requirements.txt

NOTE: I strongly advise to use virtualenv or other Virtual Environment tools.

How to

Provide key from command line

python3 getMerakiNeighbor.py -K 99999999999999999999999999999999999f88ec

or export an env variable

export apikey=MYMERAKIDASHBOARDAPIKEY

Running the script without parameters will print the list of the available organizations:

python3 getMerakiNeighbor.py

ORGANIZATIONS AVAILABLE

NAME: DevNet Sandbox                            ID: 549236
NAME: Meraki Launchpad🚀                        ID: 537758

Specify an organization to print a list of all the networks of the organization

python3 getMerakiNeighbor.py -O 549236

NETWORKS AVAILABLE FOR ORGANIZAZION "DevNet Sandbox" with ID 549236

NETWORK: DevNet Always On Read Only                         ID: L_646829496481099586
NETWORK: test - mx65                                        ID: N_646829496481152899
NETWORK: Long Island Office                                 ID: L_646829496481103488
NETWORK: DNSMB1                                             ID: L_646829496481103758
NETWORK: DNSMB4                                             ID: L_646829496481103761

Specify a network to get all the CDP or LLDP neighbors for that newtork:

python3 getMerakiNeighbor.py -O 549236 -N L_646829496481099586
CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT wan0     REMOTE DEVICE main-sw                                  REMOTE PORT GigabitEthernet1/0/3     REMOTE IP 10.10.10.254
CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE 881544dff3af                             REMOTE PORT Port 8                   REMOTE IP 10.182.255.47
LLDP LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE Meraki MS220-8P - DevNet Always On Read  REMOTE PORT 8                        REMOTE IP 10.182.255.47

Apply a filter for a specific protocol, CDP:

python3 getMerakiNeighbor.py -O 549236 -N L_646829496481099586 -P cdp

CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT wan0     REMOTE DEVICE main-sw                                  REMOTE PORT GigabitEthernet1/0/3     REMOTE IP 10.10.10.254
CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE 881544dff3af                             REMOTE PORT Port 8                   REMOTE IP 10.182.255.47

or LDDP:

python3 getMerakiNeighbor.py -O 549236 -N L_646829496481099586 -P lldp

LLDP LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE Meraki MS220-8P - DevNet Always On Read  REMOTE PORT 8                        REMOTE IP 10.182.255.47

Use the --all flag to print all the neighbors of a specific organization

python3 getMerakiNeighbor.py -O 549236 --all

CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT wan0     REMOTE DEVICE main-sw                                  REMOTE PORT GigabitEthernet1/0/3     REMOTE IP 10.10.10.254
CDP  LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE 881544dff3af                             REMOTE PORT Port 8                   REMOTE IP 10.182.255.47
LLDP LOCAL Q2QN-9J8L-SLPD           SOURCE-PORT port10   REMOTE DEVICE Meraki MS220-8P - DevNet Always On Read  REMOTE PORT 8                        REMOTE IP 10.182.255.47
LLDP LOCAL Q2MD-BHHS-5FDL           SOURCE-PORT wired0   REMOTE DEVICE Meraki MS220-8P - MS220-8P-BE67          REMOTE PORT 2                        REMOTE IP 192.168.128.19

Usefult links

Meraki API

Meraki API changelog

getmerakineighbor's People

Contributors

routetonull avatar

Watchers

James Cloos avatar

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.